
27 Apr
2010
27 Apr
'10
5:53 p.m.
On 2010-04-27 23:22, Isaac Dupree wrote:
Can this be implemented in terms of GHC's RULES?
Hi Isaac, Thanks a lot for mentioning the RULES pragma, which I did not know about. It turns out that using it to specialize Foldable's toList for things like NonEmptyList works like a charm. Indeed, this is exactly the use case described in: http://www.haskell.org/ghc/docs/latest/html/users_guide/rewrite-rules.html#r... Hence, there's no need to make toList a member of Foldable (which, as you rightly point out, has other problems), and so I withdraw my proposal. :) Sorry for the noise, Eelis