In the crypto package, I have two functions

> encrypt :: AESKey a => a -> Word128 -> Word128
> decrypt :: AESKey a => a -> Word128 -> Word128

which are exported.

I also have

> class (Bits a, Integral a) => AESKey a
> 
> instance AESKey Word128
> instance AESKey Word192
> instance AESKey Word256

unexported which stops you using invalid keys.

Someone has asked me to export AESKey as they want to write an explicit
type signature for a function they are creating e.g.

foo :: AESKey a => a -> Word128 -> Word128
foo x y = encrypt x y

but this generates an error. Is there a way of allowing someone to use
AESKey in a type signature but not allow them to declare new instances?

Thanks, Dominic.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to