module Sound.Sox.Private.Option where
import qualified Sound.Sox.Private.Arguments as Args
import qualified Data.Map as Map
import Data.Monoid (Monoid(..), )
newtype T = Cons {decons :: Map.Map String [String]}
instance Monoid T where
mempty = Cons mempty
mappend (Cons x) (Cons y) = Cons (Map.union x y)
toArguments :: T -> Args.T
toArguments =
Args.Cons .
concatMap (\(name,values) -> name:values) . Map.toList .
decons
single :: String -> [String] -> T
single name values =
Cons (Map.singleton name values)