forked from GitHub/gf-core
warnings shown in checkMapRecover
This commit is contained in:
@@ -70,7 +70,10 @@ checkMapRecover f mp = do
|
|||||||
let xs = map (\ (k,v) -> (k,runCheck (f k v))) (Map.toList mp)
|
let xs = map (\ (k,v) -> (k,runCheck (f k v))) (Map.toList mp)
|
||||||
case [s | (_,Bad s) <- xs] of
|
case [s | (_,Bad s) <- xs] of
|
||||||
ss@(_:_) -> checkError (text (unlines ss))
|
ss@(_:_) -> checkError (text (unlines ss))
|
||||||
_ -> return (Map.fromAscList [(k,x) | (k, Ok (x,_)) <- xs])
|
_ -> do
|
||||||
|
let (kx,ss) = unzip [((k,x),s) | (k, Ok (x,s)) <- xs]
|
||||||
|
checkWarn (text (unlines ss))
|
||||||
|
return (Map.fromAscList kx)
|
||||||
|
|
||||||
checkErr :: Err a -> Check a
|
checkErr :: Err a -> Check a
|
||||||
checkErr (Ok x) = return x
|
checkErr (Ok x) = return x
|
||||||
|
|||||||
Reference in New Issue
Block a user