Shorten two lines of code to one
This commit is contained in:
parent
93a4378475
commit
edab8835ad
1 changed files with 1 additions and 2 deletions
|
@ -45,8 +45,7 @@ serverT = handleLanguages :<|> handleEval
|
||||||
handleEval :: EvalRequest -> MyriadT m EvalResponse
|
handleEval :: EvalRequest -> MyriadT m EvalResponse
|
||||||
handleEval EvalRequest { language, code } = do
|
handleEval EvalRequest { language, code } = do
|
||||||
logInfoN $ mconcat ["POST /eval"]
|
logInfoN $ mconcat ["POST /eval"]
|
||||||
env <- ask
|
MyriadConfig { languages } <- asks config
|
||||||
let MyriadConfig { languages } = config env
|
|
||||||
case find (\x -> name x == language) languages of
|
case find (\x -> name x == language) languages of
|
||||||
Nothing -> throwError $ err404 { errBody = "Language " <> cvs language <> " was not found" }
|
Nothing -> throwError $ err404 { errBody = "Language " <> cvs language <> " was not found" }
|
||||||
Just cfg -> do
|
Just cfg -> do
|
||||||
|
|
Loading…
Reference in a new issue