Moved showMaybe to the Utils module and added a similar showListCustom function
This commit is contained in:
parent
05e2678cf6
commit
d3fca1d610
|
@ -265,3 +265,10 @@ zipMap f xs ys = Map.fromList $ mapMaybe f' (Set.elems allKeys)
|
|||
allKeys = Map.keysSet xs `Set.union` Map.keysSet ys
|
||||
|
||||
f' k = transformMaybe ((,) k) $ f (Map.lookup k xs) (Map.lookup k ys)
|
||||
|
||||
showMaybe :: (a -> String) -> Maybe a -> String
|
||||
showMaybe showFunc (Just x) = "Just " ++ showFunc x
|
||||
showMaybe _ Nothing = "Nothing"
|
||||
|
||||
showListCustom :: (a -> String) -> [a] -> String
|
||||
showListCustom showFunc list = "[" ++ concat (intersperse "," (map showFunc list)) ++ "]"
|
||||
|
|
|
@ -226,10 +226,6 @@ check s (ind, eq, ineq) =
|
|||
++ "(VM after pruning was: " ++ showMaybe showTestAnswers (transformMaybe fst sapped) ++
|
||||
", ineqs: " ++ showMaybe showInequalities (transformMaybe snd sapped) ++ ")"
|
||||
|
||||
showMaybe :: (a -> String) -> Maybe a -> String
|
||||
showMaybe f (Just x) = f x
|
||||
showMaybe _ Nothing = "Nothing"
|
||||
|
||||
testMakeEquations :: Test
|
||||
testMakeEquations = TestList
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue
Block a user