summaryrefslogtreecommitdiff
path: root/lib/Uris.hs
diff options
context:
space:
mode:
authorstuebinm2022-01-15 00:46:30 +0100
committerstuebinm2022-03-19 19:25:49 +0100
commit1530a4646b5bb7ab2930d1433eda87d5f0936125 (patch)
tree0eb4e3f0ada2743539cefbb27925ece37fabe6de /lib/Uris.hs
parent6e929b4b1eb9b0b6a4707ed3d9f181544ed27a73 (diff)
use hpack and clean up modules
as annoying as yaml is, cabal's package format is somehow worse, apparently
Diffstat (limited to 'lib/Uris.hs')
-rw-r--r--lib/Uris.hs12
1 files changed, 6 insertions, 6 deletions
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