    module UU.Scanner.GenTokenOrd() where

    import UU.Scanner.GenToken(GenToken(..))

    instance (Eq key, Eq tp) => Eq (GenToken key tp val) where
       Reserved key
    x    Pos
    _ == :: GenToken key tp val -> GenToken key tp val -> Bool
    == Reserved key
    y    Pos
    _ = key
    x key -> key -> Bool
    forall a. Eq a => a -> a -> Bool
    == key
    y
       ValToken tp
    tx val
    _ Pos
    _ == ValToken tp
    ty val
    _ Pos
    _ = tp
    tx tp -> tp -> Bool
    forall a. Eq a => a -> a -> Bool
    == tp
    ty
       GenToken key tp val
    _               == GenToken key tp val
    _               = Bool
    False

    instance (Ord key, Ord tp) => Ord (GenToken key tp val) where
      compare :: GenToken key tp val -> GenToken key tp val -> Ordering
    compare (Reserved key
    x    Pos
    _) (Reserved key
    y    Pos
    _) = key -> key -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare key
    x key
    y
      compare (Reserved key
    _    Pos
    _) GenToken key tp val
    _                 = Ordering
    LT
      compare (ValToken tp
    tx val
    _ Pos
    _) (ValToken tp
    ty val
    _ Pos
    _) = tp -> tp -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare tp
    tx tp
    ty
      compare GenToken key tp val
    _              GenToken key tp val
    _                    = Ordering
    GT