
5 Oct
2008
5 Oct
'08
10:43 a.m.
* Claus Reinke:
-- erase_range :: (Sequence s) => RangeTrait s -> IO (RangeTrait s)
This can't work, as you can see after desugaring:
-- erase_range :: (Sequence s,RangeTrait s~rs) => rs -> IO rs
There is nowhere to get 's' from, unless you start applying type families backwards, from results to parameters.
Thanks. Indeed, this is a bug in my reading of the specification (and the original even had that Sequence argument). I was led astray by the fact that the type checker accepted the class declaration, even though there's no really good way to provide a concrete implementation. Another example I encountered is this: class Foo f where foo :: f -> g -- oops, typo It was very difficult for me to spot this one, too. 8-/