forked from GitHub/gf-core
Some changed/new utility functions
GF.Data.Utilities: Rename mapFst to apFst, mapSnd to apSnd. Add apBoth, mapFst, mapSnd, mapBoth. GF.Data.Operations: Remove onSnd (same as apSnd)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
module GF.Data.Operations (-- * misc functions
|
||||
ifNull, onSnd,
|
||||
ifNull,
|
||||
|
||||
-- * the Error monad
|
||||
Err(..), err, maybeErr, testErr, errVal, errIn,
|
||||
@@ -76,9 +76,6 @@ infixr 5 +++++
|
||||
ifNull :: b -> ([a] -> b) -> [a] -> b
|
||||
ifNull b f xs = if null xs then b else f xs
|
||||
|
||||
onSnd :: (a -> b) -> (c,a) -> (c,b)
|
||||
onSnd f (x, y) = (x, f y)
|
||||
|
||||
-- the Error monad
|
||||
|
||||
-- | analogue of @maybe@
|
||||
|
||||
Reference in New Issue
Block a user