[Haskell-cafe] Re: Laziness question
stefan at vectorfabrics.com
Tue Aug 3 01:11:29 EDT 2010
>> Sorry, I was thinking out loud there. I meant the Eval constraint, not the equality constraint. But, right now, I guess my comment only makes sense to me, so let's pretend I kept quiet. ;-)
> The point of this discussion is that the Eval constraint needs to be on one
> of the functions. So I tried to specify that (x -> Int) and (y -> Int) are
> different types despite x and y being the same type, because one of them has
> an Eval constraint. This may be a shortcoming of Haskell (or System Fc?)
> types, although it may be doable with a newtype.
That was kind of what my thinking out loud was getting at. If you want x -> Int and y -> Int to be different types even if x and y actually are the same type, then apparently you want x -> Int and y -> Int to be built from different function-space constructors, say -> and ->*, yielding x -> Int and y ->* Int. Replacing equals for equals again, you get x -> Int and x ->* Int. So, basically, we are annotating function types, what is IIRC exactly what Janis and David are doing. (I hope Janis corrects me if I'm wrong here).
More information about the Haskell-Cafe