Crytpo for nhc

Malcolm Wallace
Tue, 29 Apr 2003 14:33:39 +0100

"Dominic Steinitz" <> writes:

> I have been trying to write a Crypto library and so far it works with ghc
> and hugs.
> Am I right in thinking I am going to struggle with nhc? It uses Word8 and
> Word64 heavily. For example, cipher block chaining relies on xoring Word64.

The things you mention are not a particular problem for nhc98.
The only problem I encountered in the Crypto.hs code is that its use
of the type class machinery is not Haskell'98 compliant.

    instance Bits [Bool] where ...

is illegal in Haskell'98, because an instance head must be either a
simple type name, or a type constructor applied to only type variables.
(See the Report section 4.3.2)  If ghc and Hugs permit this, then it is
a non-standard extension to the language.

Unfortunately, I don't immediately see an easy way to convert this
construction into something more amenable.