From 2b9ceaead3f3cd80e973cccecb9a3eebc51154f7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 17 Jul 2016 19:21:56 +0200 Subject: Fixes for GHC 8.0.1 --- tp-bbcode/src/Thermoprint/Printout/BBCode.hs | 2 +- tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs | 6 +++--- tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs | 2 +- tp-bbcode/thermoprint-bbcode.cabal | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tp-bbcode') diff --git a/tp-bbcode/src/Thermoprint/Printout/BBCode.hs b/tp-bbcode/src/Thermoprint/Printout/BBCode.hs index cbe2618..dd5edb0 100644 --- a/tp-bbcode/src/Thermoprint/Printout/BBCode.hs +++ b/tp-bbcode/src/Thermoprint/Printout/BBCode.hs @@ -104,7 +104,7 @@ morph :: DomForest -> Either SemanticError Printout -- ^ Parse a list of paragraphs -- -- Since we permit only cooked input via 'Raw' 'Paragraph' is identical to 'Block' -morph = fmap Seq.fromList . mapM (\t -> Seq.singleton . Cooked <$> parse BlockCtx t) +morph = fmap (Printout . Seq.fromList) . mapM (\t -> Paragraph . Seq.singleton . Cooked <$> parse BlockCtx t) parseDom :: DomTree -> ParseResult -- ^ Invoke 'asLine' and 'asBlock' to parse a single 'DomTree' diff --git a/tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs b/tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs index edd4c5a..8e15417 100644 --- a/tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs +++ b/tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs @@ -24,10 +24,10 @@ import Data.Monoid import Thermoprint.Printout cobbcode :: Printout -> Either UnicodeException Text -cobbcode (toList -> ps) = mconcat . intersperse "\n\n" <$> mapM handlePar ps +cobbcode (toList . getParagraphs -> ps) = mconcat . intersperse "\n\n" <$> mapM handlePar ps -handlePar :: Seq Chunk -> Either UnicodeException Text -handlePar (toList -> cs) = mconcat <$> mapM handleChunk cs +handlePar :: Paragraph -> Either UnicodeException Text +handlePar (toList . getChunks -> cs) = mconcat <$> mapM handleChunk cs handleChunk :: Chunk -> Either UnicodeException Text handleChunk (Cooked b) = Right $ handleBlock b diff --git a/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs b/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs index 09b3147..7909360 100644 --- a/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs +++ b/tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs @@ -53,7 +53,7 @@ normalize = (!! 3) . iterate normalize' . first (const ()) join' _ = Left () pOut :: Seq Block -> Printout -pOut = fmap (pure . Cooked) +pOut = Printout . fmap (Paragraph . pure . Cooked) examples :: [(Text, Either BBCodeError (Seq Block))] examples = [ ("Hello World!" diff --git a/tp-bbcode/thermoprint-bbcode.cabal b/tp-bbcode/thermoprint-bbcode.cabal index 8773b89..29855e2 100644 --- a/tp-bbcode/thermoprint-bbcode.cabal +++ b/tp-bbcode/thermoprint-bbcode.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: thermoprint-bbcode -version: 1.0.0 +version: 2.0.0 synopsis: Parse bbcode for use in thermoprint -- description: homepage: http://dirty-haskell.org/tags/thermoprint.html @@ -24,8 +24,8 @@ library , OverloadedLists -- other-extensions: build-depends: base >=4.8.1 && <5 - , thermoprint-spec ==3.0.* - , bbcode >=3.0 && <4 + , thermoprint-spec ==4.0.* + , bbcode >=3.1.1 && <4 , containers -any , text -any , case-insensitive -any @@ -44,7 +44,7 @@ Test-Suite tests , OverloadedLists build-depends: base >=4.8.1 && <5 , thermoprint-bbcode -any - , thermoprint-spec ==3.0.* + , thermoprint-spec ==4.0.* , hspec >=2.2.1 && <3 , QuickCheck >=2.8.1 && <3 , quickcheck-instances >=0.3.11 && <4 -- cgit v1.2.3