I have one problem. I want to implement function which will compare two nodes and give ordering,where nodes the following structure:
data Node a = Node { label :: a, adjacent :: [(a,Int)] } deriving Show
sortNode:: Node a->Node a->Ordering
sortNode node1 node2
| takeLabel node1 > takeLabel node2 = GT
| takeLabel node1 < takeLabel node2 = LT
| takeLabel node1 == takeLabel node2 = EQ
hugs complain about this
ERROR "Network.hs":35 - Cannot justify constraints in explicitly typed binding
*** Expression : sortNode
*** Type : Node a -> Node a -> Ordering
*** Given context : ()
*** Constraints : Ord a
can you explain?(i am beginner in haskell)