Computer Science Canada

Does anyone know the explanation of this !!!

Author:  neokewl [ Fri Dec 29, 2006 9:51 pm ]
Post subject:  Does anyone know the explanation of this !!!

type Person = String
type Book = String

are the two types tht i have defined. when i define a type tht corresponds to a tuple of Person and Book, i get the following error:

type database = [ (Person, Book) ]

' Malformed LHS to type of class declaration '

but when i change to :

type Database = [ (Person, Book)] , things are fine and everything seems proper...

a) Why does this happen ?
b) What is the meaning of the above error specified ?

Thanx..
NeoKewl...

Author:  rdrake [ Fri Dec 29, 2006 10:50 pm ]
Post subject: 

Well...
code:
Prelude> :t 5
5 :: (Num t) => t
Hm...
code:
Prelude> :t "HI!"
"HI!" :: [Char]
Hmmmmmmmm...
code:
Prelude> :t 5 ** 2
5 ** 2 :: (Floating t) => t
Seems to me like every datatype in Haskell begins with a capital letter. Maybe that could be why? Wink

The error, of course, tells us that.

Author:  neokewl [ Sat Dec 30, 2006 1:59 am ]
Post subject: 

Hey ..

possibly could mean that .... dint think of tht ...thnx buddy...


: