diff options
| author | Chris Wells <chris@mathematicaster.org> | 2025-01-25 14:33:21 -0600 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2025-01-25 14:33:21 -0600 |
| commit | ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb (patch) | |
| tree | babd478f4191655b2fa26f584c872fb909363ef1 /src/Prolog.hs | |
| parent | 39d9569a2561f8ea09170b4371deca130c1ebcf9 (diff) | |
| download | main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar.gz main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar.bz2 main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar.lz main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar.xz main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.tar.zst main-ca1d4d3d4371c8175ea6addb1ca1b09c3b56a7bb.zip | |
Adding templates and cleaning up
Diffstat (limited to 'src/Prolog.hs')
| -rw-r--r-- | src/Prolog.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Prolog.hs b/src/Prolog.hs index a688063..4b3c666 100644 --- a/src/Prolog.hs +++ b/src/Prolog.hs @@ -27,8 +27,8 @@ module Prolog , SomeException (..) , B.StrictByteString , BL.LazyByteString - , T.StrictText - , TL.LazyText + , StrictText + , LazyText -- * Strings , IsString (..) , StringConv (..) @@ -83,6 +83,10 @@ import Text.Blaze.Html.Renderer.Pretty as BS import Text.Blaze.Html.Renderer.Text as BT import Text.Blaze.Html.Renderer.Utf8 as BB import Text.LaTeX.Base qualified as L +import Text.LaTeX.Base.Syntax qualified as L + +type StrictText = T.Text +type LazyText = TL.Text (<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) infixl 4 <<$>> @@ -124,8 +128,8 @@ liftMaybe :: Alternative m => Maybe a -> m a liftMaybe = maybe empty pure {-# INLINE liftMaybe #-} -squashMaybe :: Alternative m => m (Maybe a) -> m a -squashmaybe = (>>= liftMaybe) +squashMaybe :: (Alternative m, Monad m) => m (Maybe a) -> m a +squashMaybe = (>>= liftMaybe) {-# INLINE squashMaybe #-} renderTo :: (StringConv T.Text s, L.Render r) => r -> s @@ -171,10 +175,10 @@ instance StringConv L.LaTeX String where strConv l = strConv l . L.render instance StringConv Html T.Text where - strConv _ = BT.renderHtml + strConv l = strConv l . BT.renderHtml instance StringConv Html TL.Text where - strConv l = strConv l . BT.renderHtml + strConv _ = BT.renderHtml instance StringConv Html String where strConv _ = BS.renderHtml |
