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
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
[...]
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
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
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,
[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