[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-21 Thread apfelmus
Bertram Felgenhauer wrote: [redirecting from [EMAIL PROTECTED] 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

Re: [Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-21 Thread Roman Leshchinskiy
apfelmus wrote: Bertram Felgenhauer wrote: [redirecting from [EMAIL PROTECTED] 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 [...]

[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-21 Thread apfelmus
Roman Leshchinskiy wrote: apfelmus wrote: Making f an associacted type synonym / fundep instead of a associated data type is still worth it, since we can use it for Mu f But alas, this breaks hylomorphisms: hylo :: Fixpoint t = (Pre t s - s) - (p - Pre t p) - p - s If Pre is a type

Re: [Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-21 Thread Roman Leshchinskiy
apfelmus wrote: Roman Leshchinskiy wrote: apfelmus wrote: Making f an associacted type synonym / fundep instead of a associated data type is still worth it, since we can use it for Mu f But alas, this breaks hylomorphisms: hylo :: Fixpoint t = (Pre t s - s) - (p - Pre t p) - p - s If

[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-21 Thread apfelmus
Roman Leshchinskiy wrote: apfelmus wrote: Ah, right. But unlike size , this is unambiguous since t can (and probably should) be fused away: hylo :: Functor f = (f s - s) - (p - f p) - p - s hylo f g = f . fmap (hylo f g) . g Excellent point! When I originally developed the code,

[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

2007-11-20 Thread Bertram Felgenhauer
[redirecting from [EMAIL PROTECTED] 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