[Haskell-cafe] Re: Laziness question
Brandon S Allbery KF8NH
allbery at ece.cmu.edu
Mon Aug 2 19:49:41 EDT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 8/2/10 17:18 , Stefan Holdermans wrote:
> Brandon,
>>> h :: (x ~ y, Eval (y -> Int)) => (x -> Int) -> (y -> Int) -> Int
>
>> But actually if you push the constraint inward, into the type so to say, you actually get quite close to Janis' and David's solution.
>
> 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.
- --
brandon s. allbery [linux,solaris,freebsd,perl] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxXWZUACgkQIn7hlCsL25XhxACdFLFtCUrJqEpqGSsymt1uE3Zc
yWgAoKcyJZdjng1zthyAtPkMCIvHce27
=XkFz
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe
mailing list