0 Replies - 587 Views - Last Post: 19 March 2010 - 03:32 PM

#1 s243a   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 137
  • Joined: 17-March 10

Haskell Type Error (Please Help)

Posted 19 March 2010 - 03:32 PM

module BasicTypes where


data Type a = Top a|Subtype a (Type a)
getTypeParrent (Subtype a B)/>=b
isTopType (Subtype a B)/>=False
isTopType (Top a) = True
--getTypeType ::  Type a b -> Type a

getTypeType (Subtype (Top a) B)/>=a

--isTypeTypeA::Subtype a b->Subtype c d->Bool
isTypeTypeA a b
      |a==b=True
      |isTopType(a)=False
      |otherwise=(isTypeTypeA (getTypeParrent a) B)/>
instance Eq (Type t) where
   a == b = getTypeType(a)==getTypeType(B)/>


On the second last line I get the error:
Expected type: Type (Type t)
Inferred type: Type t1
in the first argument of 'getTypeType' namely 'a'

And in the next line I get the error:
't1' is a ridged type variable bounded by

Note that Type is my own type which I created.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1