Hello!

On Thu, Aug 27, 1998 at 05:35:04PM +0100, Tina Yu wrote:
> Hello,

>       I would like to include Array in Haskell 1.4 Standard Libraries 
> to be part of the language I define :

> data Expression = Constant String 
>                |Array Int Expression

Small mistake here: "Array" is a data constructor (such like "Constant")
here, *not* a reference to the Array type.

Correct is:

import Array
data Expression = Constant String | Arr (Array Int Expression)

> anExp = array (0,1)[(0, (Constant "0")),
>                     (1, (Constant "1"))]

And this should be

anExp = Arr $ array (0,1) [(0, (Constant "0")), (1, (Constant "1"))]

>       This does not seem to work. Any suggestion of how to
> implement this ? Thank you very much for your help.

Hope that helps.

Regards,

Felix.

Reply via email to