mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-17 07:02:51 -06:00
some dead code elimination in UseIO and ReadFiles
This commit is contained in:
@@ -21,7 +21,7 @@ module GF.Data.Operations (-- * misc functions
|
||||
Err(..), err, maybeErr, testErr, errVal, errIn,
|
||||
lookupErr,
|
||||
mapPairListM, mapPairsM, pairM,
|
||||
(!?), singleton, mapsErr, mapsErrTree,
|
||||
singleton, mapsErr, mapsErrTree,
|
||||
|
||||
-- ** checking
|
||||
checkUnique,
|
||||
@@ -77,7 +77,6 @@ infixr 5 +++
|
||||
infixr 5 ++-
|
||||
infixr 5 ++++
|
||||
infixr 5 +++++
|
||||
infixl 9 !?
|
||||
|
||||
ifNull :: b -> ([a] -> b) -> [a] -> b
|
||||
ifNull b f xs = if null xs then b else f xs
|
||||
@@ -118,10 +117,6 @@ mapPairsM f xys = mapM (\ (x,y) -> liftM ((,) x) (f y)) xys
|
||||
pairM :: Monad a => (b -> a c) -> (b,b) -> a (c,c)
|
||||
pairM op (t1,t2) = liftM2 (,) (op t1) (op t2)
|
||||
|
||||
-- @!!@ with the error monad
|
||||
(!?) :: [a] -> Int -> Err a
|
||||
xs !? i = foldr (const . return) (Bad "too few elements in list") $ drop i xs
|
||||
|
||||
singleton :: a -> [a]
|
||||
singleton = (:[])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user