[Haskell-cafe] Equality constraints and RankNTypes - how do I assist type inference

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Fri Aug 20 20:34:02 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/20/10 16:08 , DavidA wrote:
> type Tensor u v =
>     (u ~ Vect k a, v ~ Vect k b) => Vect k (TensorBasis a b) -- **

IIRC this actually substitutes as

  (forall k a b. (u ~ Vect k a, v ~ Vect k b) => Vect k (TensorBasis a b))

and the implicit forall will generally mess things up because it won't be
floated out to the top level.  (Or in other words, constraints in type
declarations don't generally do what you intend.)

- -- 
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/

iEYEARECAAYFAkxvHvoACgkQIn7hlCsL25V7/gCgt9NaWZBFV7VFCYbs5Q6hqgGG
ke0AoNFQU6VOXboK7daFI6IAgUiyKfGx
=JL3q
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list