projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2004-07-26 17:22:41 by ross]
[ghc-base.git]
/
Data
/
Tuple.hs
diff --git
a/Data/Tuple.hs
b/Data/Tuple.hs
index
ea7191a
..
3fb4074
100644
(file)
--- a/
Data/Tuple.hs
+++ b/
Data/Tuple.hs
@@
-258,17
+258,19
@@
data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-- Standard functions over tuples
#if !defined(__HUGS__) && !defined(__NHC__)
-- Standard functions over tuples
#if !defined(__HUGS__) && !defined(__NHC__)
+-- | Extract the first component of a pair.
fst :: (a,b) -> a
fst (x,_) = x
fst :: (a,b) -> a
fst (x,_) = x
+-- | Extract the second component of a pair.
snd :: (a,b) -> b
snd (_,y) = y
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)
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__ */
uncurry :: (a -> b -> c) -> ((a, b) -> c)
uncurry f p = f (fst p) (snd p)
#endif /* neither __HUGS__ nor __NHC__ */