
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 8/2/10 11:41 , Janis Voigtländer wrote:
alright that we don't know more about where (==) is used. But for a function of type f :: Eval (a -> Int) => (a -> Int) -> (a -> Int) -> Int, in connection with trying to find out whether uses of seq are harmful or not, it is absolutely *essential* to know on which of the two functions (a -> Int) seq is used. The type class approach cannot tell
Hm. Seems to me that (with TypeFamilies and FlexibleContexts)
h :: (x ~ y, Eval (y -> Int)) => (x -> Int) -> (y -> Int) -> Int
should do that, but ghci is telling me it isn't (substituting Eq for Eval for the nonce): Prelude> let h :: (x ~ y, Eq (y -> Int)) => (x -> Int) -> (y -> Int) -> Int; h = undefined Prelude> :t h h :: (Eq (x -> Int)) => (x -> Int) -> (x -> Int) -> Int Bleah. (as if it weren't obvious) I still don't quite grok this stuff.... - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@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/ iEYEARECAAYFAkxW+VwACgkQIn7hlCsL25Us2gCbBaiDCutFcN7URjqBL0RUUMUl fkkAoJ6jV52RUeNQcISeyzTMFtDwic+y =0fBN -----END PGP SIGNATURE-----