[Haskell-cafe] type trickery

Adrian Neumann aneumann at inf.fu-berlin.de
Thu Dec 20 04:34:53 EST 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Signierter Teil der Nachricht
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071220/e61e5da1/PGP.bin


More information about the Haskell-Cafe mailing list