setBackend :: String -> OptParser Opts
setBackend b = case map toUpper b of
  "HASKELL"     -> success (\o -> o { backend = HaskellBackend })
  "IVORY"       -> success (\o -> o { backend = IvoryBackend })
  "TOWER"       -> success (\o -> o { backend = TowerBackend })
  "HASKELL-RPC" -> success (\o -> o { backend = RpcBackend })
  "ELM"         -> success (\o -> o { backend = ElmBackend })
  _             -> invalid e
  where e = "\"" ++ b ++ "\" is not a valid backend.\n"
          ++ "Supported backends: haskell, ivory, tower, haskell-rpc"
setBackend :: String -> OptParser Opts
setBackend b = case map toUpper b of
  "HASKELL"     -> success (\o -> o { backend = HaskellBackend })
  "IVORY"       -> success (\o -> o { backend = IvoryBackend })
  "TOWER"       -> success (\o -> o { backend = TowerBackend })
  "HASKELL-RPC" -> success (\o -> o { backend = RpcBackend })
  "ELM"         -> success (\o -> o { backend = ElmBackend })
  _             -> invalid e
  where e = "\"" ++ b ++ "\" is not a valid backend.\n"
          ++ "Supported backends: haskell, ivory, tower, haskell-rpc"
setBackend b = case map toUpper b of
  "HASKELL"     -> success (\o -> o { backend = HaskellBackend })
  "IVORY"       -> success (\o -> o { backend = IvoryBackend })
  "TOWER"       -> success (\o -> o { backend = TowerBackend })
  "HASKELL-RPC" -> success (\o -> o { backend = RpcBackend })
  "ELM"         -> success (\o -> o { backend = ElmBackend })
  _             -> invalid e
  where e = "\"" ++ b ++ "\" is not a valid backend.\n"
          ++ "Supported backends: haskell, ivory, tower, haskell-rpc"