Commit 9bde7d86 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up Base.

parent 772ea960
......@@ -10,7 +10,6 @@ module Base (
Stage (..),
Arg, ArgList,
ShowArg (..), ShowArgs (..),
filterOut,
productArgs, concatArgs
) where
......@@ -56,21 +55,9 @@ class ShowArgs a where
instance ShowArgs [String] where
showArgs = return
instance ShowArgs [Arg] where
showArgs = sequence
instance ShowArgs [ArgList] where
showArgs = mconcat
instance ShowArgs a => ShowArgs (Action a) where
showArgs = (showArgs =<<)
-- Filter out given arg(s) from a collection
filterOut :: ShowArgs a => ArgList -> a -> ArgList
filterOut as exclude = do
exclude' <- showArgs exclude
filter (`notElem` exclude') <$> as
-- Generate a cross product collection of two argument collections
-- Example: productArgs ["-a", "-b"] "c" = args ["-a", "c", "-b", "c"]
productArgs :: (ShowArgs a, ShowArgs b) => a -> b -> ArgList
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment