rattletrap-14.1.4: src/lib/Rattletrap/Console/Mode.hs
module Rattletrap.Console.Mode where data Mode = Decode | Encode deriving (Eq, Show) fromString :: String -> Either String Mode fromString string = case string of "decode" -> Right Decode "encode" -> Right Encode _ -> Left $ "invalid mode: " <> show string