on master help sign in
fix monad usage in Import.TutorialD
commit17e822b9937fb2ac5f1fe8abcf21099218bc89f4 authorAgentM <agentm@themactionfaction.com> dateFri 2 Apr 2021, 16:16 (6 years ago) parent5b6d3f1
1 file changed+5−6
src/bin/TutorialD/Interpreter/Import/TutorialD.hs+5−6
src/bin/TutorialD/Interpreter/Import/TutorialD.hs+5−6
@@ -78,10 +78,9 @@ tutdImportP = do
7878 uri <- quoted URI.parser
7979 spaceConsumer
8080 mhash <- optional (quoted hex)
81− let handler =
82− case URI.unRText <$> URI.uriScheme uri of
83− Nothing -> fail "URI scheme missing"
84− Just "file" -> importTutorialDFromFile
85− Just scheme | scheme `elem` ["http", "https"] -> importTutorialDViaHTTP
86− | otherwise -> fail ("unsupported URI scheme: " <> show scheme)
81+ handler <- case URI.unRText <$> URI.uriScheme uri of
82+ Nothing -> fail "URI scheme missing"
83+ Just "file" -> pure importTutorialDFromFile
84+ Just scheme | scheme `elem` ["http", "https"] -> pure importTutorialDViaHTTP
85+ | otherwise -> fail ( "unsupported URI scheme: " <> show scheme)
8786 pure $ DatabaseContextDataImportOperator uri mhash handler