X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FTuple.hs;h=a1495854a5982aa2ae141848a4de544de871bc83;hb=a70f356e023abdd0abb130cc149b0e3de7469044;hp=ea7191ae78ec65fd3eb24d589f8b000c6ae0e6e8;hpb=7a5cd3c3868a53f1c9b06a98faa37ffcf787b1c0;p=haskell-directory.git diff --git a/Data/Tuple.hs b/Data/Tuple.hs index ea7191a..a149585 100644 --- a/Data/Tuple.hs +++ b/Data/Tuple.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Tuple @@ -258,17 +258,19 @@ data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -- Standard functions over tuples #if !defined(__HUGS__) && !defined(__NHC__) +-- | Extract the first component of a pair. fst :: (a,b) -> a fst (x,_) = x +-- | Extract the second component of a pair. snd :: (a,b) -> b snd (_,y) = y --- curry converts an uncurried function to a curried function; --- uncurry converts a curried function to a function on pairs. +-- | 'curry' converts an uncurried function to a curried function. curry :: ((a, b) -> c) -> a -> b -> c curry f x y = f (x, y) +-- | 'uncurry' converts a curried function to a function on pairs. uncurry :: (a -> b -> c) -> ((a, b) -> c) uncurry f p = f (fst p) (snd p) #endif /* neither __HUGS__ nor __NHC__ */