[Haskell-cafe] Runtime strictness analysis for polymorphic HOFs?

Stefan Holdermans stefan at cs.uu.nl
Thu Jun 18 00:19:31 EDT 2009


> In trying to follow your email I got a bit confused by your notation -
>  const :: a -> b -> a   const x y = x  could read   a -> {S} -> b - 
> >{L} a
> Here, we have annotated the function-space constructor (->) with  
> information about whether the corresponding function is strict or  
> lazy in its argument. Indeed, const is lazy in its first argument  
> and lazy in its second.
> Did you mean to say that const is strict in its first param and lazy  
> in its second (since const _|_ y = _|_)? Also, can you explain your  
> notation, how does a -> {S} -> b ->{L} a indicate the strictness?  
> Why not just {S} a -> {L} b -> a?

I'm sorry for the confusion. Indeed, const, as the type was intended  
to reflect, const is strict in its first argument and lazy in its  

I prefer to put the annotation on the function arrow as strictness is  
a property of functions, but if you want to have these annotations  
prefixing the argument types, then I guess that's fine as well; in the  
end, it really doesn't matter, does it?



More information about the Haskell-Cafe mailing list