| * Putting the signature into the rule name seems a little bit
| strange, e.g. "fromIntegral/Int8->Int16" vs "foldr/build".
|
| * Has `"foobar/Int8->Int16" fromIntegral = int8ToInt16' the same
| effect?
The name is only used in debug reporting. You can use whatever
name you want.
| * I don't fully understand the following quote from the docs:
|
| "A pattern variable may optionally have a type signature. If
| its type is polymorphic, it must have a type signature."
|
| Why does "map/map" *not* need a type signature, but "foldr/build"
| does? f, g, and xs are all polymorphic.
It's *g* that is polymorphic (that is, has a forall at the top of
its type) in the build rule. In map/map, f,g,xs don't have a forall
at the top of their types.
| * What happens when more than one rule matches? Warning? Error?
| Sound of silence? :-)
GHC will choose one of them. At the moment it's an arbitrary choice.
Thanks for these points. I've checked in a modified documentation.
Simon