[Haskell-cafe] List implementation.

Ronny Wichers Schreur ronny at cs.ru.nl
Tue Oct 12 08:19:47 EDT 2004


Keean writes (in the Haskell cafe):

> [..] 
> data AList a = One !a (AList a)
>                  | Many !Int !(UArray Int a) (AList a) | Nil
> [..]
>    head (Many i a _) = a!i
> [..]
>    a ++: l = Many 0 a l

You probably want to test in the definition of (++:) that
the array a is not of length 0.


Cheers,

Ronny Wichers Schreur


More information about the Haskell-Cafe mailing list