Simon,

Thanks a lot for looking into this. One question regarding maps that I
still don't understand: can you explain me if it is indeed to be expected
that GHC won't fuse `map f . map g` into `map (f . g)` by default? Also,
same for `map f [x]` ~> `[f x]`?

Regarding your reply:

2012/3/9 Simon Peyton-Jones <simo...@microsoft.com>

> You wondered why it made a difference whether you said
>
>   instance GEnum Nat where
>     genum = map to genum'
> or
>   instance GEnum Nat    -- Fill in from default method
>
> Well, it turns out that the difference is largely accidental.


I understand your explanation for why this can result in different
behaviour. But I think we should try to find a way to address this. We came
up with DefaultSignatures to simplify instantiating generic functions, but
now it turns out that using them can make the code slower! This is rather
unexpected. Could we perhaps have a way to let users specify rewrite rules
involving `cast`?


Cheers,
Pedro
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to