From f2665335b3d8ee791959964e4e97daa88ccd853a Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Sat, 29 Sep 2018 21:35:50 +0300 Subject: [PATCH] Remove preceding equals --- src/API.hs | 14 +++++++------- src/Server/IPFS.hs | 10 ++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/API.hs b/src/API.hs index 65e64d1..35e1d5e 100644 --- a/src/API.hs +++ b/src/API.hs @@ -5,16 +5,16 @@ {-# Language OverloadedStrings #-} module API where -import Servant.API -import ClassyPrelude +import Servant.API +import ClassyPrelude import qualified API.IPFS as IPFS -import Text.Pandoc.Readers.Markdown (readMarkdown) -import Text.Pandoc.Writers.HTML (writeHtml5String) -import Text.Pandoc.Class (runPure, PandocMonad) -import Text.Pandoc.Options (def) -import Network.HTTP.Media ((//), (/:)) +import Network.HTTP.Media ((//), (/:)) +import Text.Pandoc.Class (runPure) +import Text.Pandoc.Options (def) +import Text.Pandoc.Readers.Markdown (readMarkdown) +import Text.Pandoc.Writers.HTML (writeHtml5String) data HTML diff --git a/src/Server/IPFS.hs b/src/Server/IPFS.hs index a96711b..bb57b21 100644 --- a/src/Server/IPFS.hs +++ b/src/Server/IPFS.hs @@ -5,12 +5,10 @@ module Server.IPFS where import API.IPFS -import Servant -import ClassyPrelude - -import Network.DNS - +import ClassyPrelude hiding (hash) import Control.Lens (over, _Left) +import Network.DNS +import Servant handler :: Server API handler = liftIO getHash >>= either (const (throwError err500)) return @@ -23,6 +21,6 @@ handler = liftIO getHash >>= either (const (throwError err500)) return -- This is terrible return (eTxt >>= maybe (Left "Could not find dnslink") Right . hash) hash [x] = case x of - (stripPrefix "dnslink" -> Just h) -> Just . VersionHash . decodeUtf8 $ h + (stripPrefix "dnslink=" -> Just h) -> Just . VersionHash . decodeUtf8 $ h _ -> Nothing hash _ = Nothing