From 1530a4646b5bb7ab2930d1433eda87d5f0936125 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 15 Jan 2022 00:46:30 +0100 Subject: use hpack and clean up modules as annoying as yaml is, cabal's package format is somehow worse, apparently --- lib/Uris.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Uris.hs') diff --git a/lib/Uris.hs b/lib/Uris.hs index 80ee014..00f86a4 100644 --- a/lib/Uris.hs +++ b/lib/Uris.hs @@ -26,8 +26,8 @@ import Network.URI.Encode as URI import Text.Regex.TDFA ((=~)) import Witherable (mapMaybe) -import Network.URI as NativeUri -import Data.String +import Data.String +import Network.URI as NativeUri data Substitution = Prefixed { prefix :: Text, blocked :: [Text], allowed :: [Text], scope :: [String] } @@ -48,7 +48,7 @@ type SchemaSet = [(Text, Substitution)] extractDomain :: Text -> Maybe Text extractDomain url = case parseUri url of - Nothing -> Nothing + Nothing -> Nothing Just (_,domain,_) -> Just domain @@ -60,13 +60,13 @@ parseUri uri = Nothing -> Nothing Just parsedUri -> case uriAuthority parsedUri of Nothing -> Nothing - -- https: + -- https: Just uriAuth -> Just (T.replace (fromString ":") (fromString "") (fromString (uriScheme parsedUri )), - -- //anonymous@ www.haskell.org :42 + -- //anonymous@ www.haskell.org :42 fromString(uriUserInfo uriAuth++uriRegName uriAuth ++ uriPort uriAuth), -- /ghc ?query #frag fromString(uriPath parsedUri ++ uriQuery parsedUri ++ uriFragment parsedUri)) - + data SubstError = SchemaDoesNotExist Text -- cgit v1.2.3