[Haskell-cafe] Re: ANNOUNCE: fixpoint 0.1

apfelmus apfelmus at quantentunnel.de
Wed Nov 21 04:36:35 EST 2007


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, type functions 
> didn't really work anyway. I'll try again now that they are more mature.

Actually, I don't think that

    hylo :: Fixpoint f t => (f s -> s) -> (p -> f p) -> p -> s
    hylo f g = cata f . ana g

will typecheck, the  t  is still ambiguous. It's just that it's one of 
those cases where the type signature is ambiguous but the program isn't. 
Well, from a denotational point of view anyway, different  t  will 
generate different code for  hylo .


Regards,
apfelmus



More information about the Haskell-Cafe mailing list