X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Data%2FTuple.hs;h=3fb4074c8591452ef35d53563730e3f5e25404c0;hb=fd14d1940233a4563d14a89fc195587c95750300;hp=ea7191ae78ec65fd3eb24d589f8b000c6ae0e6e8;hpb=06bb288c8d7e2f46276f25c3ef16d091de8f3ded;p=ghc-base.git diff --git a/Data/Tuple.hs b/Data/Tuple.hs index ea7191a..3fb4074 100644 --- a/Data/Tuple.hs +++ b/Data/Tuple.hs @@ -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__ */