diff options
Diffstat (limited to 'tp-bbcode/src')
-rw-r--r-- | tp-bbcode/src/Thermoprint/Printout/BBCode.hs | 2 | ||||
-rw-r--r-- | tp-bbcode/src/Thermoprint/Printout/BBCode/Inverse.hs | 6 |
2 files changed, 4 insertions, 4 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 |