[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

Roman Leshchinskiy rl at cse.unsw.edu.au
Wed Nov 21 04:25:17 EST 2007


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 Pre is a type function, there is no way to infer t.
> 
> 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, type functions 
didn't really work anyway. I'll try again now that they are more mature.

Roman



More information about the Haskell-Cafe mailing list