diff options
| author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-17 19:21:56 +0200 |
|---|---|---|
| committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-17 19:21:56 +0200 |
| commit | 2b9ceaead3f3cd80e973cccecb9a3eebc51154f7 (patch) | |
| tree | df2378943480647606b6a06f62c0f4b8b2ab406d /tp-bbcode | |
| parent | ac4cf4a0a494eafe55364f816569c517684fdf32 (diff) | |
| download | thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.gz thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.bz2 thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.tar.xz thermoprint-2b9ceaead3f3cd80e973cccecb9a3eebc51154f7.zip | |
Fixes for GHC 8.0.1
Diffstat (limited to 'tp-bbcode')
| -rw-r--r-- | tp-bbcode/src/Thermoprint/Printout/BBCode.hs | 2 | ||||
| -rw-r--r-- | tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs | 6 | ||||
| -rw-r--r-- | tp-bbcode/test/Thermoprint/Printout/BBCodeSpec.hs | 2 | ||||
| -rw-r--r-- | tp-bbcode/thermoprint-bbcode.cabal | 8 |
4 files changed, 9 insertions, 9 deletions
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 | |||
| 104 | -- ^ Parse a list of paragraphs | 104 | -- ^ Parse a list of paragraphs |
| 105 | -- | 105 | -- |
| 106 | -- Since we permit only cooked input via 'Raw' 'Paragraph' is identical to 'Block' | 106 | -- Since we permit only cooked input via 'Raw' 'Paragraph' is identical to 'Block' |
| 107 | morph = fmap Seq.fromList . mapM (\t -> Seq.singleton . Cooked <$> parse BlockCtx t) | 107 | morph = fmap (Printout . Seq.fromList) . mapM (\t -> Paragraph . Seq.singleton . Cooked <$> parse BlockCtx t) |
| 108 | 108 | ||
| 109 | parseDom :: DomTree -> ParseResult | 109 | parseDom :: DomTree -> ParseResult |
| 110 | -- ^ Invoke 'asLine' and 'asBlock' to parse a single 'DomTree' | 110 | -- ^ 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 | |||
| 24 | import Thermoprint.Printout | 24 | import Thermoprint.Printout |
| 25 | 25 | ||
| 26 | cobbcode :: Printout -> Either UnicodeException Text | 26 | cobbcode :: Printout -> Either UnicodeException Text |
| 27 | cobbcode (toList -> ps) = mconcat . intersperse "\n\n" <$> mapM handlePar ps | 27 | cobbcode (toList . getParagraphs -> ps) = mconcat . intersperse "\n\n" <$> mapM handlePar ps |
| 28 | 28 | ||
| 29 | handlePar :: Seq Chunk -> Either UnicodeException Text | 29 | handlePar :: Paragraph -> Either UnicodeException Text |
| 30 | handlePar (toList -> cs) = mconcat <$> mapM handleChunk cs | 30 | handlePar (toList . getChunks -> cs) = mconcat <$> mapM handleChunk cs |
| 31 | 31 | ||
| 32 | handleChunk :: Chunk -> Either UnicodeException Text | 32 | handleChunk :: Chunk -> Either UnicodeException Text |
| 33 | handleChunk (Cooked b) = Right $ handleBlock b | 33 | 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 ()) | |||
| 53 | join' _ = Left () | 53 | join' _ = Left () |
| 54 | 54 | ||
| 55 | pOut :: Seq Block -> Printout | 55 | pOut :: Seq Block -> Printout |
| 56 | pOut = fmap (pure . Cooked) | 56 | pOut = Printout . fmap (Paragraph . pure . Cooked) |
| 57 | 57 | ||
| 58 | examples :: [(Text, Either BBCodeError (Seq Block))] | 58 | examples :: [(Text, Either BBCodeError (Seq Block))] |
| 59 | examples = [ ("Hello World!" | 59 | 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 @@ | |||
| 2 | -- documentation, see http://haskell.org/cabal/users-guide/ | 2 | -- documentation, see http://haskell.org/cabal/users-guide/ |
| 3 | 3 | ||
| 4 | name: thermoprint-bbcode | 4 | name: thermoprint-bbcode |
| 5 | version: 1.0.0 | 5 | version: 2.0.0 |
| 6 | synopsis: Parse bbcode for use in thermoprint | 6 | synopsis: Parse bbcode for use in thermoprint |
| 7 | -- description: | 7 | -- description: |
| 8 | homepage: http://dirty-haskell.org/tags/thermoprint.html | 8 | homepage: http://dirty-haskell.org/tags/thermoprint.html |
| @@ -24,8 +24,8 @@ library | |||
| 24 | , OverloadedLists | 24 | , OverloadedLists |
| 25 | -- other-extensions: | 25 | -- other-extensions: |
| 26 | build-depends: base >=4.8.1 && <5 | 26 | build-depends: base >=4.8.1 && <5 |
| 27 | , thermoprint-spec ==3.0.* | 27 | , thermoprint-spec ==4.0.* |
| 28 | , bbcode >=3.0 && <4 | 28 | , bbcode >=3.1.1 && <4 |
| 29 | , containers -any | 29 | , containers -any |
| 30 | , text -any | 30 | , text -any |
| 31 | , case-insensitive -any | 31 | , case-insensitive -any |
| @@ -44,7 +44,7 @@ Test-Suite tests | |||
| 44 | , OverloadedLists | 44 | , OverloadedLists |
| 45 | build-depends: base >=4.8.1 && <5 | 45 | build-depends: base >=4.8.1 && <5 |
| 46 | , thermoprint-bbcode -any | 46 | , thermoprint-bbcode -any |
| 47 | , thermoprint-spec ==3.0.* | 47 | , thermoprint-spec ==4.0.* |
| 48 | , hspec >=2.2.1 && <3 | 48 | , hspec >=2.2.1 && <3 |
| 49 | , QuickCheck >=2.8.1 && <3 | 49 | , QuickCheck >=2.8.1 && <3 |
| 50 | , quickcheck-instances >=0.3.11 && <4 | 50 | , quickcheck-instances >=0.3.11 && <4 |
