[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Tue Nov 20 11:04:46 EST 2007


[redirecting from haskell at ...]
apfelmus wrote:
[...]
> I wonder whether a multi parameter type class without fundeps/associated 
> types would be better.
>
>   class Fixpoint f t where
>     inject  :: f t -> t
>     project ::   t -> f t
>
[...]
> Interestingly, this even gives slightly shorter type signatures
>
>   cata :: Fixpoint f t => (f s -> s) -> t -> s
>   size :: (Fixpoint f t, Foldable f) => t -> Int

size can't be used now though, because there is no way to infer f.

Bertram


More information about the Haskell-Cafe mailing list