20 Dec 10:33
type trickery
From: Adrian Neumann <aneumann <at> inf.fu-berlin.de>
Subject: type trickery
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2007-12-20 09:34:53 GMT
Subject: type trickery
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2007-12-20 09:34:53 GMT
Hello haskell-cafe! After making "data Number = Zero | Succ Number" an instance of Integral, I wondered how I could do the same with galois fields. So starting with Z mod p, I figured I'd need something like this data GF = GF Integer Integer so that each element of the finite field would remember p. However I can't think of a way to use the typesystem to ensure that p is always the same. I think that would need an infinite number of different types, but the type hackers here probably know something better. Adrian
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe <at> haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RSS Feed