In Haskell, data types and contructors must be designated by
names whose first letter is capitalised.
So,
data currency = ...
is illegal.
Instead use,
data Currency = Dollar Double | Pound Double | Zloty Double | Euro Double
Above are four data constructors and they can be used to contruct
Hi to anyone reading this. i'm still strugling a bit with data type declarations.
The was i understand it is that if i delcare a new data type:
data myType =myType a | b | c
The constructor is of type a - myType. can it also be of type b - myType, or c - myType ?
What I am reall strugling to
Hi again,
On Wed, 5 Nov 2003, Patty Fong wrote:
Hi to anyone reading this. i'm still strugling a bit with data type
declarations.
The was i understand it is that if i delcare a new data type:
data myType = myType a | b | c
This isn't entirely correct. The names of types have to begin
type Variable = Name
type Name = String
type Number = Int
From: Hal Daume III To: Patty Fong CC: Haskell Cafe , Hal Daume Subject:
Re: Data types basics Date: Tue, 4 Nov 2003 22:10:03 -0800 (PST)
Hi again,
On Wed, 5 Nov 2003, Patty Fong wrote:
Hi to anyone reading this. i'm still strugling a bit