Arrows and GHC rewrite rules

2007-03-29 Thread Eric Cheng
In GHC's Control.Arrow implementation, there are several rewrite rules which exploit some properties of arrows. For example, "compose/arr" forall f g . arr f >>> arr g = arr (f >>> g) "first/arr" forall f . first (arr f) = arr (first f) "second/arr" forall f . second (arr f) = arr (second f)

Re: More on FreeBSD/amd64

2007-03-29 Thread Gregory Wright
Hi SImon, On Mar 29, 2007, at 5:40 AM, Simon Marlow wrote: Hi Greg, Good analysis so far. I think you're close to this one. Thank you for checking over what I've done thus far. Based on what you said, I looked at Compat.Unicode and there is indeed a type error in this foreign call: f

Re: More on FreeBSD/amd64

2007-03-29 Thread Ian Lynagh
On Thu, Mar 29, 2007 at 10:40:32AM +0100, Simon Marlow wrote: > > Based on what you said, I looked at Compat.Unicode and there is indeed a > type error in this foreign call: > > foreign import ccall unsafe "u_gencat" > wgencat :: CInt -> Int > > The return type should be CInt, not Int. Try c

cost of modules

2007-03-29 Thread Fawzi Mohamed
woops sorry for the previous post, the subject was wrong... this one is correct. Simon Peyton-Jones wrote: Generally speaking GHC will inline *across* modules just as much as it does *within* modules, with a single large exception. If GHC sees that a function 'f' is called just once, it inl

Re: GADT + Newtype deriving = Erroneous errors

2007-03-29 Thread Fawzi Mohamed
Simon Peyton-Jones wrote: Generally speaking GHC will inline *across* modules just as much as it does *within* modules, with a single large exception. If GHC sees that a function 'f' is called just once, it inlines it regardless of how big 'f' is. But once 'f' is exported, GHC can never se

Re: RULES and type classes

2007-03-29 Thread Pepe Iborra
On 29/03/2007, at 11:38, Mike Hamburg wrote: Is there any way to use RULES substitutions with type classes? I'm writing a reactive programming arrow (same idea as Yampa, different design goals), and it would help performance (and not just in the speed sense) to be able to tell when a value

Re: RULES and type classes

2007-03-29 Thread Donald Bruce Stewart
haskell: > Is there any way to use RULES substitutions with type classes? > > I'm writing a reactive programming arrow (same idea as Yampa, different > design goals), and it would help performance (and not just in the speed > sense) to be able to tell when a value derived with arr hasn't changed.

Re: More on FreeBSD/amd64

2007-03-29 Thread Simon Marlow
Hi Greg, Good analysis so far. I think you're close to this one. Based on what you said, I looked at Compat.Unicode and there is indeed a type error in this foreign call: foreign import ccall unsafe "u_gencat" wgencat :: CInt -> Int The return type should be CInt, not Int. Try changing t

RULES and type classes

2007-03-29 Thread Mike Hamburg
Is there any way to use RULES substitutions with type classes? I'm writing a reactive programming arrow (same idea as Yampa, different design goals), and it would help performance (and not just in the speed sense) to be able to tell when a value derived with arr hasn't changed. So I'd like to be a

RE: GADT + Newtype deriving = Erroneous errors

2007-03-29 Thread Simon Peyton-Jones
Right. There are two things going on in this thread. First, when you say newtype T = MkT Int then T and Int are distinct types. Adding a deriving( whatever ) doesn't change that fact. Earlier messages make this point. The second is that GHC's current "newtype deriving" mechanism is pl