--
-----------------------------------------------------------------------------
-module Data.Tuple where
+module Data.Tuple
+ ( fst -- :: (a,b) -> a
+ , snd -- :: (a,b) -> a
+ , curry -- :: ((a, b) -> c) -> a -> b -> c
+ , uncurry -- :: (a -> b -> c) -> ((a, b) -> c)
+#ifdef __NHC__
+ , (,)(..)
+ , (,,)(..)
+ , (,,,)(..)
+ , (,,,,)(..)
+ , (,,,,,)(..)
+ , (,,,,,,)(..)
+ , (,,,,,,,)(..)
+ , (,,,,,,,,)(..)
+ , (,,,,,,,,,)(..)
+ , (,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,,,)(..)
+#endif
+ )
+ where
#ifdef __GLASGOW_HASKELL__
import GHC.Base
+#endif /* __GLASGOW_HASKELL__ */
+
+#ifdef __NHC__
+import Prelude
+import Prelude
+ ( (,)(..)
+ , (,,)(..)
+ , (,,,)(..)
+ , (,,,,)(..)
+ , (,,,,,)(..)
+ , (,,,,,,)(..)
+ , (,,,,,,,)(..)
+ , (,,,,,,,,)(..)
+ , (,,,,,,,,,)(..)
+ , (,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,,)(..)
+ , (,,,,,,,,,,,,,,)(..)
+ -- nhc98's prelude only supplies tuple instances up to size 15
+ , fst, snd
+ , curry, uncurry
+ )
+#endif
default () -- Double isn't available yet
+#ifdef __GLASGOW_HASKELL__
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)
-- ---------------------------------------------------------------------------
-- Standard functions over tuples
-#ifndef __HUGS__
+#if !defined(__HUGS__) && !defined(__NHC__)
fst :: (a,b) -> a
fst (x,_) = x
uncurry :: (a -> b -> c) -> ((a, b) -> c)
uncurry f p = f (fst p) (snd p)
-#endif /* __HUGS__ */
+#endif /* neither __HUGS__ nor __NHC__ */