From 534fbd8db1f30ae1e72665a77776df4e868ae958 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 9 Feb 2008 14:50:56 +0000 Subject: [PATCH] Added a new helper function to Utils, and corrected a comment too --- common/Utils.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/Utils.hs b/common/Utils.hs index 9934079..84bfba0 100644 --- a/common/Utils.hs +++ b/common/Utils.hs @@ -119,10 +119,14 @@ combineCompare (EQ:os) = combineCompare os transformPair :: (x -> a) -> (y -> b) -> (x,y) -> (a,b) transformPair f g (x,y) = (f x, g y) --- | Maps two functions over members of a triple +-- | Maps three functions over members of a triple transformTriple :: (x -> a) -> (y -> b) -> (z -> c) -> (x,y,z) -> (a,b,c) transformTriple f g h (x,y,z) = (f x, g y, h z) +-- | Maps four functions over members of a quadtuple +transformQuad :: (x -> a) -> (y -> b) -> (z -> c) -> (z' -> d) -> (x,y,z,z') -> (a,b,c,d) +transformQuad f g h i (x,y,z,z') = (f x, g y, h z, i z') + -- | Pipes a monadic return through a non-monadic transformation function: (>>*) :: Monad m => m a -> (a -> b) -> m b (>>*) v f = v >>= (return . f)