mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-03 14:50:25 +01:00
Handler.Package: fix the empty warning correctly (thanks zudov)
This commit is contained in:
parent
89c8cdb1be
commit
60dcfba8de
@ -16,7 +16,7 @@ import qualified Data.Text.Lazy as LT
|
|||||||
import Distribution.Package.ModuleForest
|
import Distribution.Package.ModuleForest
|
||||||
import Graphics.Badge.Barrier
|
import Graphics.Badge.Barrier
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Import hiding (empty)
|
import Import
|
||||||
import qualified Text.Blaze.Html.Renderer.Text as LT
|
import qualified Text.Blaze.Html.Renderer.Text as LT
|
||||||
import Text.Email.Validate
|
import Text.Email.Validate
|
||||||
import Stackage.Database
|
import Stackage.Database
|
||||||
@ -161,13 +161,13 @@ data Identifier
|
|||||||
--
|
--
|
||||||
parseIdentitiesLiberally :: Text -> [Identifier]
|
parseIdentitiesLiberally :: Text -> [Identifier]
|
||||||
parseIdentitiesLiberally =
|
parseIdentitiesLiberally =
|
||||||
filter (not . empty) .
|
filter (not . emptyPlainText) .
|
||||||
map strip .
|
map strip .
|
||||||
concatPlains .
|
concatPlains .
|
||||||
map parseChunk .
|
map parseChunk .
|
||||||
T.split (== ',')
|
T.split (== ',')
|
||||||
where empty (PlainText e) = T.null e
|
where emptyPlainText (PlainText e) = T.null e
|
||||||
empty _ = False
|
emptyPlainText _ = False
|
||||||
strip (PlainText t) = PlainText (T.strip t)
|
strip (PlainText t) = PlainText (T.strip t)
|
||||||
strip x = x
|
strip x = x
|
||||||
concatPlains = go
|
concatPlains = go
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user