data Tuple3 a b c = Tuple3 a b c deriving (Show)
data Tuple2 a b = Tuple2 a b deriving (Show)
class Indexable idx where
first :: idx c -> a
instance Indexable (Tuple2 a) where
first (Tuple2 a b) = a
Couldn't match expected type ‘a1’ with actual type ‘a’
‘a’ is a rigid type variable bound by
the instance declaration at TypeClasses.hs:35:10
‘a1’ is a rigid type variable bound by
the type signature for first :: Tuple2 a c -> a1
at TypeClasses.hs:36:4
Relevant bindings include
a :: a (bound at TypeClasses.hs:36:18)
first :: Tuple2 a c -> a1 (bound at TypeClasses.hs:36:4)
In the expression: a
In an equation for ‘first’: first (Tuple2 a b) = a