Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump LTS tp 19.6 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ main = do
haddockHoogle = Flag True,
haddockHtml = Flag True,
haddockProgramArgs = [("-q",["aliased"])], -- does not seam to do anything
haddockExecutables = Flag True,
haddockHscolour = Flag True
haddockExecutables = Flag True
}
}

12 changes: 6 additions & 6 deletions src/Text/BlazeT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module Text.BlazeT
(
-- * DO NOT READ THIS. READ "Text.BlazeT.Internal" INSTEAD
-- * DO NOT READ THIS. READ "Text.BlazeT.Internal" INSTEAD
-- $descr

-- * DO NOT READ THIS
-- -- * Important types.
Markup
Expand Down Expand Up @@ -72,7 +72,7 @@ module Text.BlazeT
) where

import qualified Text.Blaze
import Text.BlazeT.Internal as Text.BlazeT.Internal
import Text.BlazeT.Internal as Text.BlazeT.Internal

class ToMarkup a where
toMarkup :: a -> Markup
Expand All @@ -82,14 +82,14 @@ class ToMarkup a where
-- test = toMarkup

instance Text.Blaze.ToMarkup a => ToMarkup a where
toMarkup = wrapMarkup . Text.Blaze.toMarkup
toMarkup a = wrapMarkup $ Text.Blaze.toMarkup a
{-# INLINE toMarkup #-}
preEscapedToMarkup = wrapMarkup . Text.Blaze.preEscapedToMarkup
preEscapedToMarkup a = wrapMarkup $ Text.Blaze.preEscapedToMarkup a
{-# INLINE preEscapedToMarkup #-}


-- $descr
--
--
-- Due due a Haddock bug, this documentation is misleading. Please
-- read "Text.BlazeT.Internal" instead.
--
Expand Down
56 changes: 31 additions & 25 deletions src/Text/BlazeT/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ module Text.BlazeT.Internal
,wrapMarkup
,wrapMarkup2
,

-- * Entities exported also by "Text.Blaze.Internal"
-- $descr1

-- ** Important types.
Text.Blaze.ChoiceString (..)
, Text.Blaze.StaticString (..)
Expand Down Expand Up @@ -147,9 +147,9 @@ runMarkupT = runWriterT . fromMarkupT
-- computation and the blaze markup rendered with a blaze renderer
-- like 'Text.BlazeT.Renderer.Text.renderHtml'
runWith :: Monad m => (MarkupI () -> c) -> MarkupT m a -> m (a, c)
runWith renderer = liftM (second $ renderer . wrapMarkup) . runMarkupT
runWith renderer = liftM (\(a, m) -> (a, renderer $ wrapMarkup m)) . runMarkupT
{-# INLINE runWith #-}

execMarkupT :: Monad m => MarkupT m a -> m Text.Blaze.Markup
execMarkupT = liftM snd . runMarkupT
{-# INLINE execMarkupT #-}
Expand All @@ -173,7 +173,7 @@ wrapMarkupT = tell
{-# INLINE wrapMarkupT #-}

wrapMarkup :: Text.Blaze.Markup -> Markup
wrapMarkup = wrapMarkupT
wrapMarkup m = wrapMarkupT m
{-# INLINE wrapMarkup #-}


Expand All @@ -185,9 +185,15 @@ wrapMarkupT2 = censor
{-# INLINE wrapMarkupT2 #-}

wrapMarkup2 :: (Text.Blaze.Markup -> Text.Blaze.Markup) -> Markup2
wrapMarkup2 = wrapMarkupT2
wrapMarkup2 f = wrapMarkupT2 f
{-# INLINE wrapMarkup2 #-}

instance (Monad m, Semigroup a) => Semigroup (MarkupT m a) where
a <> b = do
a' <- a
b' <- b
pure $ a' <> b'
{-# INLINE (<>) #-}

instance (Monad m,Monoid a) => Monoid (MarkupT m a) where
mempty = return mempty
Expand All @@ -205,19 +211,19 @@ instance Monad m => Text.Blaze.Attributable (a -> MarkupT m b) where
{-# INLINE (!) #-}

instance Monad m => IsString (MarkupT m ()) where
fromString = wrapMarkup . fromString
fromString s = wrapMarkup $ fromString s
{-# INLINE fromString #-}

unsafeByteString :: BS.ByteString -> Markup
unsafeByteString = wrapMarkup . Text.Blaze.unsafeByteString
unsafeByteString bs = wrapMarkup $ Text.Blaze.unsafeByteString bs
{-# INLINE unsafeByteString #-}

-- | Insert a lazy 'BL.ByteString'. See 'unsafeByteString' for reasons why this
-- is an unsafe operation.
--
unsafeLazyByteString :: BL.ByteString -- ^ Value to insert
-> Markup -- ^ Resulting HTML fragment
unsafeLazyByteString = wrapMarkup . Text.Blaze.unsafeLazyByteString
unsafeLazyByteString bs = wrapMarkup $ Text.Blaze.unsafeLazyByteString bs
{-# INLINE unsafeLazyByteString #-}

external :: Monad m => MarkupT m a -> MarkupT m a
Expand All @@ -229,27 +235,27 @@ contents = wrapMarkupT2 Text.Blaze.contents
{-# INLINE contents #-}

customParent ::Text.Blaze.Tag -> Markup2
customParent = wrapMarkup2 . Text.Blaze.customParent
customParent t = wrapMarkup2 $ Text.Blaze.customParent t
{-# INLINE customParent #-}

customLeaf :: Text.Blaze.Tag -> Bool -> Markup
customLeaf = fmap wrapMarkup . Text.Blaze.customLeaf
customLeaf t close = wrapMarkup $ Text.Blaze.customLeaf t close
{-# INLINE customLeaf #-}

preEscapedText :: T.Text -> Markup
preEscapedText = wrapMarkup . Text.Blaze.preEscapedText
preEscapedText t = wrapMarkup $ Text.Blaze.preEscapedText t
{-# INLINE preEscapedText #-}

preEscapedLazyText :: LT.Text -> Markup
preEscapedLazyText = wrapMarkup . Text.Blaze.preEscapedLazyText
preEscapedLazyText lt = wrapMarkup $ Text.Blaze.preEscapedLazyText lt
{-# INLINE preEscapedLazyText #-}

preEscapedTextBuilder :: LTB.Builder -> Markup
textBuilder :: LTB.Builder -> Markup

#ifdef PRE_BUILDER
preEscapedTextBuilder = wrapMarkup . Text.Blaze.preEscapedTextBuilder
textBuilder = wrapMarkup . Text.Blaze.textBuilder
preEscapedTextBuilder b = wrapMarkup $ Text.Blaze.preEscapedTextBuilder b
textBuilder b = wrapMarkup $ Text.Blaze.textBuilder b
{-# INLINE preEscapedTextBuilder #-}
{-# INLINE textBuilder #-}
#else
Expand All @@ -258,41 +264,41 @@ textBuilder = error "This function needs blaze-markup 0.7.1.0"
#endif

preEscapedString :: String -> Markup
preEscapedString = wrapMarkup . Text.Blaze.preEscapedString
preEscapedString s = wrapMarkup $ Text.Blaze.preEscapedString s
{-# INLINE preEscapedString #-}

string :: String -> Markup
string = wrapMarkup . Text.Blaze.string
string s = wrapMarkup $ Text.Blaze.string s
{-# INLINE string #-}

text :: T.Text -> Markup
text = wrapMarkup . Text.Blaze.text
text t = wrapMarkup $ Text.Blaze.text t
{-# INLINE text #-}

lazyText :: LT.Text -> Markup
lazyText = wrapMarkup . Text.Blaze.lazyText
lazyText lt = wrapMarkup $ Text.Blaze.lazyText lt
{-# INLINE lazyText #-}


textComment :: T.Text -> Markup
textComment = wrapMarkup . Text.Blaze.textComment
textComment t = wrapMarkup $ Text.Blaze.textComment t

lazyTextComment :: LT.Text -> Markup
lazyTextComment = wrapMarkup . Text.Blaze.lazyTextComment
lazyTextComment lt = wrapMarkup $ Text.Blaze.lazyTextComment lt

stringComment :: String -> Markup
stringComment = wrapMarkup . Text.Blaze.stringComment
stringComment s = wrapMarkup $ Text.Blaze.stringComment s

unsafeByteStringComment :: BS.ByteString -> Markup
unsafeByteStringComment = wrapMarkup . Text.Blaze.unsafeByteStringComment
unsafeByteStringComment bs = wrapMarkup $ Text.Blaze.unsafeByteStringComment bs

unsafeLazyByteStringComment :: BL.ByteString -> Markup
unsafeLazyByteStringComment = wrapMarkup . Text.Blaze.unsafeLazyByteStringComment
unsafeLazyByteStringComment bs = wrapMarkup $ Text.Blaze.unsafeLazyByteStringComment bs

-- $descr1
-- The following is an adaptation of all "Text.Blaze.Internal" exports to
-- @blazeT@ types.
--
--
-- Entities that are reexported from "Text.Blaze.Internal" have the original
-- documentation attached to them.
--
Expand Down
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: lts-7.15
resolver: lts-19.6

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand Down Expand Up @@ -63,4 +63,4 @@ extra-package-dbs: []
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
# compiler-check: newer-minor