%*********************************************************
\begin{code}
-data (,) a b = (,) a b deriving (Eq, Ord, Bounded)
-data (,,) a b c = (,,) a b c deriving (Eq, Ord, Bounded)
-data (,,,) a b c d = (,,,) a b c d deriving (Eq, Ord, Bounded)
-data (,,,,) a b c d e = (,,,,) a b c d e deriving (Eq, Ord, Bounded)
+data (,) a b = (,) a b deriving (Eq, Ord)
+data (,,) a b c = (,,) a b c deriving (Eq, Ord)
+data (,,,) a b c d = (,,,) a b c d deriving (Eq, Ord)
+data (,,,,) a b c d e = (,,,,) a b c d e deriving (Eq, Ord)
data (,,,,,) a b c d e f = (,,,,,) a b c d e f
data (,,,,,,) a b c d e f g = (,,,,,,) a b c d e f g
data (,,,,,,,) a b c d e f g h = (,,,,,,,) a b c d e f g h
= (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_
\end{code}
-@Show@ instances for just the first few.
-
-\begin{code}
-instance (Show a, Show b) => Show (a,b) where
- showsPrec p (x,y) = showChar '(' . shows x . showString ", " .
- shows y . showChar ')'
- showList = showList__ (showsPrec 0)
-
-instance (Show a, Show b, Show c) => Show (a, b, c) where
- showsPrec p (x,y,z) = showChar '(' . showsPrec 0 x . showString ", " .
- showsPrec 0 y . showString ", " .
- showsPrec 0 z . showChar ')'
- showList = showList__ (showsPrec 0)
-
-instance (Show a, Show b, Show c, Show d) => Show (a, b, c, d) where
- showsPrec p (w,x,y,z) = showChar '(' . showsPrec 0 w . showString ", " .
- showsPrec 0 x . showString ", " .
- showsPrec 0 y . showString ", " .
- showsPrec 0 z . showChar ')'
-
- showList = showList__ (showsPrec 0)
-
-instance (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) where
- showsPrec p (v,w,x,y,z) = showChar '(' . showsPrec 0 v . showString ", " .
- showsPrec 0 w . showString ", " .
- showsPrec 0 x . showString ", " .
- showsPrec 0 y . showString ", " .
- showsPrec 0 z . showChar ')'
- showList = showList__ (showsPrec 0)
-\end{code}
-
%*********************************************************
%* *
\begin{code}
fst :: (a,b) -> a
-fst (x,y) = x
+fst (x,_) = x
snd :: (a,b) -> b
-snd (x,y) = y
+snd (_,y) = y
-- curry converts an uncurried function to a curried function;
-- uncurry converts a curried function to a function on pairs.