Commit f2efed98 authored by Ryan Scott's avatar Ryan Scott Committed by Herbert Valerio Riedel

GHC 8.8-related batch of patches

* Add patches for `HsYAML`, `bencode`, `inline-c`, `pandoc`,
  `regex-pcre-builtin`, `skylighting-core`, `texmath`, and
  `xml-hamlet`.
* Migrate the `hedgehog` patch to the latest Hackage version.
* Remove the old `shake` patch. The latest version on Hackage now
  builds with GHC 8.8.
* Patch `generic-lens` to work around kcsongor/generic-lens#84.
* The `vinyl` patch is only guarded against GHC 8.9 or later, but
  there is no reason for it not to also apply to GHC 8.8. Indeed,
  `vinyl` fails to build on 8.8 unless this is done.
parent f1902573
commit 12031cb665d5dc365ae3ea7dee6df23badcc740e
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri May 17 13:52:00 2019 -0400
Adapt to base-4.13.0.0
diff --git a/src/Data/YAML.hs b/src/Data/YAML.hs
index 9eb3a66..46ad654 100644
--- a/src/Data/YAML.hs
+++ b/src/Data/YAML.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE Safe #-}
@@ -211,7 +212,9 @@ instance Monad Parser where
return = pure
P m >>= k = P (m >>= unP . k)
(>>) = (*>)
+#if !(MIN_VERSION_base(4,13,0))
fail = Fail.fail
+#endif
-- | @since 0.1.1.0
instance Fail.MonadFail Parser where
diff --git a/src/Data/YAML/Token.hs b/src/Data/YAML/Token.hs
index df3e95e..ff9d0f9 100644
--- a/src/Data/YAML/Token.hs
+++ b/src/Data/YAML/Token.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
@@ -24,6 +25,7 @@ module Data.YAML.Token
, Code(..)
) where
+import qualified Control.Monad.Fail as Fail
import qualified Data.ByteString.Lazy.Char8 as BLC
import qualified Data.DList as D
import Prelude hiding ((*), (+), (-), (/), (^))
@@ -442,6 +444,12 @@ instance Monad Parser where
(>>) = (*>)
+#if !(MIN_VERSION_base(4,13,0))
+ -- @fail message@ does just that - fails with a /message/.
+ fail = Fail.fail
+#endif
+
+instance Fail.MonadFail Parser where
-- @fail message@ does just that - fails with a /message/.
fail message = Parser $ \state -> failReply state message
diff -ru bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs bencode-0.6.0.0/src/Data/BEncode/Parser.hs
--- bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs 2015-05-09 15:56:43.000000000 -0400
+++ bencode-0.6.0.0/src/Data/BEncode/Parser.hs 2019-05-17 14:32:05.074495583 -0400
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : BParser
@@ -26,6 +28,7 @@
import Control.Applicative hiding (optional)
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Data.BEncode
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as Map
@@ -61,6 +64,11 @@
Ok a b' -> runB (f a) b'
Error str -> Error str
return val = BParser $ Ok val
+#if !(MIN_VERSION_base(4,13,0))
+ fail = Fail.fail
+#endif
+
+instance Fail.MonadFail BParser where
fail str = BParser $ \_ -> Error str
instance Functor BParser where
commit 07cfab73b53324a8459148a61b37e92c002e9b37
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri May 17 13:30:53 2019 -0400
Fix https://github.com/kcsongor/generic-lens/issues/84
diff --git a/src/Data/Generics/Product/Any.hs b/src/Data/Generics/Product/Any.hs
index cc90fc0..e78bcf9 100644
--- a/src/Data/Generics/Product/Any.hs
+++ b/src/Data/Generics/Product/Any.hs
@@ -53,7 +53,7 @@ import Data.Generics.Product.Typed
-- human = Human "Tunyasz" 50 "London"
-- :}
-class HasAny (sel :: k) s t a b | s sel k -> a where
+class HasAny sel s t a b | s sel -> a where
-- |A lens that focuses on a part of a product as identified by some
-- selector. Currently supported selectors are field names, positions and
-- unique types. Compatible with the lens package's 'Control.Lens.Lens'
diff --git a/src/Data/Generics/Sum/Any.hs b/src/Data/Generics/Sum/Any.hs
index cefb67a..478ef5b 100644
--- a/src/Data/Generics/Sum/Any.hs
+++ b/src/Data/Generics/Sum/Any.hs
@@ -61,7 +61,7 @@ import Data.Generics.Internal.VL.Prism
-- :}
-- |Sums that have generic prisms.
-class AsAny (sel :: k) a s | s sel k -> a where
+class AsAny sel a s | s sel -> a where
-- |A prism that projects a sum as identified by some selector. Currently
-- supported selectors are constructor names and unique types. Compatible
-- with the lens package's 'Control.Lens.Prism' type.
diff -ru hedgehog-0.6.1.orig/src/Hedgehog/Internal/Property.hs hedgehog-0.6.1/src/Hedgehog/Internal/Property.hs
--- hedgehog-0.6.1.orig/src/Hedgehog/Internal/Property.hs 2018-09-22 03:47:12.000000000 -0400
+++ hedgehog-0.6.1/src/Hedgehog/Internal/Property.hs 2019-03-16 08:21:46.347681765 -0400
@@ -1,5 +1,6 @@
{-# OPTIONS_HADDOCK not-home #-}
{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE FlexibleContexts #-}
@@ -84,6 +85,7 @@
import Control.Monad.Catch (MonadThrow(..), MonadCatch(..))
import Control.Monad.Catch (SomeException(..), displayException)
import Control.Monad.Error.Class (MonadError(..))
+import qualified Control.Monad.Fail as Fail
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Morph (MFunctor(..))
import Control.Monad.Primitive (PrimMonad(..))
@@ -150,6 +152,7 @@
, MonadReader r
, MonadState s
, MonadError e
+ , Fail.MonadFail
)
-- | A test monad allows the assertion of expectations.
@@ -317,6 +320,11 @@
unTest m >>=
unTest . k
+#if !(MIN_VERSION_base(4,13,0))
+ fail = Fail.fail
+#endif
+
+instance Monad m => Fail.MonadFail (TestT m) where
fail err =
TestT . ExceptT . pure . Left $ Failure Nothing err Nothing
version: 0.6.1
x-revision: 3
version: 1.0
x-revision: 1
name:
hedgehog
......@@ -12,14 +12,17 @@ homepage:
bug-reports:
https://github.com/hedgehogqa/haskell-hedgehog/issues
synopsis:
Hedgehog will eat all your bugs.
Release with confidence.
description:
Hedgehog is a modern property-based testing system, in the spirit of
QuickCheck. Hedgehog uses integrated shrinking, so shrinks obey the
invariants of generated values by construction.
<http://hedgehog.qa/ Hedgehog> automatically generates a comprehensive array
of test cases, exercising your software in ways human testers would never
imagine.
.
To get started quickly, see the examples:
<https://github.com/hedgehogqa/haskell-hedgehog/tree/master/hedgehog-example>
Generate hundreds of test cases automatically, exposing even the
most insidious of corner cases. Failures are automatically simplified, giving
developers coherent, intelligible error messages.
.
To get started quickly, see the <https://github.com/hedgehogqa/haskell-hedgehog/tree/master/hedgehog-example examples>.
category:
Testing
license:
......@@ -31,15 +34,10 @@ cabal-version:
build-type:
Simple
tested-with:
GHC == 7.10.2
, GHC == 7.10.3
, GHC == 8.0.1
, GHC == 8.0.2
, GHC == 8.2.1
GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.1
, GHC == 8.4.2
, GHC == 8.4.3
, GHC == 8.4.4
, GHC == 8.6.4
extra-source-files:
README.md
CHANGELOG.md
......@@ -50,7 +48,8 @@ source-repository head
library
build-depends:
base >= 3 && < 5
-- GHC 8.0.1 / base-4.9.0.0 (May 2016)
base >= 4.9 && < 5
, ansi-terminal >= 0.6 && < 0.10
, async >= 2.0 && < 2.3
, bytestring >= 0.10 && < 0.11
......@@ -58,6 +57,7 @@ library
, containers >= 0.4 && < 0.7
, directory >= 1.2 && < 1.4
, exceptions >= 0.7 && < 0.11
, fail >= 4.9 && < 5
, lifted-async >= 0.7 && < 0.11
, mmorph >= 1.0 && < 1.2
, monad-control >= 1.0 && < 1.1
......@@ -66,29 +66,28 @@ library
, primitive >= 0.6 && < 0.7
, random >= 1.1 && < 1.2
, resourcet >= 1.1 && < 1.3
, semigroups >= 0.16 && < 0.19
, semigroups >= 0.16 && < 0.20
, stm >= 2.4 && < 2.6
, template-haskell >= 2.10 && < 2.15
, text >= 1.1 && < 1.3
, th-lift >= 0.7 && < 0.8
, time >= 1.4 && < 1.10
, transformers >= 0.4 && < 0.6
, transformers-base >= 0.4 && < 0.5
, transformers >= 0.5 && < 0.6
, transformers-base >= 0.4.5.1 && < 0.5
, wl-pprint-annotated >= 0.0 && < 0.2
if !os(windows)
build-depends:
unix >= 2.6 && < 2.8
ghc-options:
-Wall
if impl(ghc >= 8.0)
ghc-options: -Wnoncanonical-monad-instances
hs-source-dirs:
src
exposed-modules:
Hedgehog
Hedgehog.Gen
Hedgehog.Main
Hedgehog.Range
Hedgehog.Internal.Config
......@@ -127,14 +126,19 @@ test-suite test
test
other-modules:
Test.Hedgehog.Applicative
Test.Hedgehog.Filter
Test.Hedgehog.Seed
Test.Hedgehog.Text
Test.Hedgehog.Zip
build-depends:
hedgehog
, base >= 3 && < 5
, containers >= 0.4 && < 0.7
, mmorph >= 1.0 && < 1.2
, mtl >= 2.1 && < 2.3
, pretty-show >= 1.6 && < 1.10
, semigroups >= 0.16 && < 0.19
, semigroups >= 0.16 && < 0.20
, text >= 1.1 && < 1.3
, transformers >= 0.3 && < 0.6
diff -ru hedgehog-1.0.orig/src/Hedgehog/Internal/Gen.hs hedgehog-1.0/src/Hedgehog/Internal/Gen.hs
--- hedgehog-1.0.orig/src/Hedgehog/Internal/Gen.hs 2019-05-13 05:52:05.000000000 -0400
+++ hedgehog-1.0/src/Hedgehog/Internal/Gen.hs 2019-05-17 13:26:15.191782408 -0400
@@ -1,5 +1,6 @@
{-# OPTIONS_HADDOCK not-home #-}
{-# LANGUAGE ApplicativeDo #-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
@@ -486,8 +487,10 @@
runGenT size sk . k =<<
runGenT size sm m
+#if !(MIN_VERSION_base(4,13,0))
fail =
Fail.fail
+#endif
instance Monad m => MonadFail (GenT m) where
fail =
diff -ru inline-c-0.7.0.1.orig/src/Language/C/Inline/Internal.hs inline-c-0.7.0.1/src/Language/C/Inline/Internal.hs
--- inline-c-0.7.0.1.orig/src/Language/C/Inline/Internal.hs 2018-12-16 18:08:10.000000000 -0500
+++ inline-c-0.7.0.1/src/Language/C/Inline/Internal.hs 2019-05-17 16:26:24.310528911 -0400
@@ -54,6 +54,7 @@
import Control.Applicative
import Control.Monad (forM, void, msum)
+import qualified Control.Monad.Fail as Fail
import Control.Monad.State (evalStateT, StateT, get, put)
import Control.Monad.Trans.Class (lift)
import Data.Foldable (forM_)
@@ -523,7 +524,7 @@
-- The @m@ is polymorphic because we use this both for the plain
-- parser and the StateT parser we use above. We only need 'fail'.
purgeHaskellIdentifiers
- :: forall n. (Applicative n, Monad n)
+ :: forall n. (Applicative n, Fail.MonadFail n)
=> C.Type HaskellIdentifier -> n (C.Type C.CIdentifier)
purgeHaskellIdentifiers cTy = for cTy $ \hsIdent -> do
let hsIdentS = unHaskellIdentifier hsIdent
@@ -539,9 +540,9 @@
-> TH.QuasiQuoter
quoteCode p = TH.QuasiQuoter
{ TH.quoteExp = p
- , TH.quotePat = fail "inline-c: quotePat not implemented (quoteCode)"
- , TH.quoteType = fail "inline-c: quoteType not implemented (quoteCode)"
- , TH.quoteDec = fail "inline-c: quoteDec not implemented (quoteCode)"
+ , TH.quotePat = \_ -> fail "inline-c: quotePat not implemented (quoteCode)"
+ , TH.quoteType = \_ -> fail "inline-c: quoteType not implemented (quoteCode)"
+ , TH.quoteDec = \_ -> fail "inline-c: quoteDec not implemented (quoteCode)"
}
genericQuote
diff -ru inline-c-0.7.0.1.orig/src/Language/C/Types/Parse.hs inline-c-0.7.0.1/src/Language/C/Types/Parse.hs
--- inline-c-0.7.0.1.orig/src/Language/C/Types/Parse.hs 2018-05-01 05:44:49.000000000 -0400
+++ inline-c-0.7.0.1/src/Language/C/Types/Parse.hs 2019-05-17 16:25:08.465693889 -0400
@@ -88,6 +88,7 @@
import Control.Applicative
import Control.Monad (msum, void, MonadPlus, unless, when)
+import qualified Control.Monad.Fail as Fail
import Control.Monad.Reader (MonadReader, runReaderT, ReaderT, asks, ask)
import Data.Functor.Identity (Identity)
import qualified Data.HashSet as HashSet
@@ -166,7 +167,7 @@
-- referring to Haskell variables, and thus we need to parse Haskell
-- identifiers in certain positions.
type CParser i m =
- ( Monad m
+ ( Fail.MonadFail m
, Functor m
, Applicative m
, MonadPlus m
This diff is collapsed.
commit 628b9f79437644aaad2fe486171c6a8e957099d3
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri May 17 14:15:54 2019 -0400
Adapt to base-4.13.0.0
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index fb3cfa72a..b924d51dc 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -981,7 +981,7 @@ instance PandocMonad PandocPure where
u : us -> do
modifyPureState $ \st -> st { stUniqStore = us }
return u
- _ -> M.fail "uniq store ran out of elements"
+ _ -> error "uniq store ran out of elements"
openURL u = throwError $ PandocResourceNotFound u
readFileLazy fp = do
fps <- getsPureState stFiles
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index c3469b22b..364a6f473 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -260,7 +260,7 @@ yamlBsToMeta bstr = do
nodeToKey :: Monad m => YAML.Node -> m Text
nodeToKey (YAML.Scalar (YAML.SStr t)) = return t
nodeToKey (YAML.Scalar (YAML.SUnknown _ t)) = return t
-nodeToKey _ = fail "Non-string key in YAML mapping"
+nodeToKey _ = error "Non-string key in YAML mapping"
toMetaValue :: PandocMonad m
=> Text -> MarkdownParser m (F MetaValue)
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index a7b9ee621..c38ffc3d5 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -560,7 +560,7 @@ writeDocx opts doc@(Pandoc meta _) = do
settingsEntry <- copyChildren refArchive distArchive settingsPath epochtime settingsList
let entryFromArchive arch path =
- maybe (fail $ path ++ " missing in reference docx")
+ maybe (error $ path ++ " missing in reference docx")
return
(findEntryByPath path arch `mplus` findEntryByPath path distArchive)
docPropsAppEntry <- entryFromArchive refArchive "docProps/app.xml"
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index ae23a4f9b..32244dd94 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -614,7 +614,7 @@ inlineToMuse (Subscript lst) = do
modify $ \st -> st { stUseTags = False }
return $ "<sub>" <> contents <> "</sub>"
inlineToMuse SmallCaps {} =
- fail "SmallCaps should be expanded before normalization"
+ error "SmallCaps should be expanded before normalization"
inlineToMuse (Quoted SingleQuote lst) = do
contents <- inlineListToMuse lst
modify $ \st -> st { stUseTags = False }
@@ -624,7 +624,7 @@ inlineToMuse (Quoted DoubleQuote lst) = do
modify $ \st -> st { stUseTags = False }
return $ "“" <> contents <> "”"
inlineToMuse Cite {} =
- fail "Citations should be expanded before normalization"
+ error "Citations should be expanded before normalization"
inlineToMuse (Code _ str) = do
useTags <- gets stUseTags
modify $ \st -> st { stUseTags = False }
@@ -632,7 +632,7 @@ inlineToMuse (Code _ str) = do
then "<code>" <> text (substitute "</code>" "<</code><code>/code>" str) <> "</code>"
else "=" <> text str <> "="
inlineToMuse Math{} =
- fail "Math should be expanded before normalization"
+ error "Math should be expanded before normalization"
inlineToMuse (RawInline (Format f) str) = do
modify $ \st -> st { stUseTags = False }
return $ "<literal style=\"" <> text f <> "\">" <> text str <> "</literal>"
diff --git a/src/Text/Pandoc/Writers/OOXML.hs b/src/Text/Pandoc/Writers/OOXML.hs
index 3c62a4f79..469fe31ea 100644
--- a/src/Text/Pandoc/Writers/OOXML.hs
+++ b/src/Text/Pandoc/Writers/OOXML.hs
@@ -54,9 +54,9 @@ parseXml :: (PandocMonad m) => Archive -> Archive -> String -> m Element
parseXml refArchive distArchive relpath =
case findEntryByPath relpath refArchive `mplus`
findEntryByPath relpath distArchive of
- Nothing -> fail $ relpath ++ " missing in reference file"
+ Nothing -> error $ relpath ++ " missing in reference file"
Just e -> case parseXMLDoc . UTF8.toStringLazy . fromEntry $ e of
- Nothing -> fail $ relpath ++ " corrupt in reference file"
+ Nothing -> error $ relpath ++ " corrupt in reference file"
Just d -> return d
-- Copied from Util
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
index a45c09bd4..6a0d4a002 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -153,7 +153,7 @@ copyFileToArchive arch fp = do
refArchive <- asks envRefArchive
distArchive <- asks envDistArchive
case findEntryByPath fp refArchive `mplus` findEntryByPath fp distArchive of
- Nothing -> fail $ fp ++ " missing in reference file"
+ Nothing -> error $ fp ++ " missing in reference file"
Just e -> return $ addEntryToArchive e arch
alwaysInheritedPatterns :: [Pattern]
diff -ru regex-pcre-builtin-0.94.4.8.8.35.orig/Text/Regex/PCRE/Wrap.hsc regex-pcre-builtin-0.94.4.8.8.35/Text/Regex/PCRE/Wrap.hsc
--- regex-pcre-builtin-0.94.4.8.8.35.orig/Text/Regex/PCRE/Wrap.hsc 2014-05-12 08:04:05.000000000 -0400
+++ regex-pcre-builtin-0.94.4.8.8.35/Text/Regex/PCRE/Wrap.hsc 2019-05-17 13:43:28.369074601 -0400
@@ -69,6 +69,8 @@
retNoSubstring
) where
+import qualified Control.Monad.Fail as Fail
+
#if defined(HAVE_PCRE_H)
import Control.Monad(when)
import Data.Array(Array,accumArray)
@@ -134,7 +136,7 @@
(=~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target)
=> source1 -> source -> target
-(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m)
+(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m)
=> source1 -> source -> m target
#if defined(HAVE_PCRE_H)
@@ -154,7 +156,7 @@
q = makeRegex r
in match q x
--- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) => source1 -> source -> m target
+-- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) => source1 -> source -> m target
(=~~) x r = do (q :: Regex) <- makeRegexM r
matchM q x
commit 8351e8f2db8655cbe821986f0cebcda119bd0123
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri Apr 19 15:56:05 2019 -0400
Adapt to base-4.13.0.0
diff --git a/src/Development/Shake/Command.hs b/src/Development/Shake/Command.hs
index 84d2465f..aac974f1 100644
--- a/src/Development/Shake/Command.hs
+++ b/src/Development/Shake/Command.hs
@@ -20,6 +20,7 @@ module Development.Shake.Command(
import Data.Tuple.Extra
import Control.Monad.Extra
+import qualified Control.Monad.Fail as Fail
import Control.Monad.IO.Class
import Data.Char
import Data.Either.Extra
@@ -181,7 +182,7 @@ copyFSABinary prog
_ -> return prog
removeOptionFSATrace
- :: MonadTempDir m
+ :: (Fail.MonadFail m, MonadTempDir m)
=> Params -- ^ Given the parameter
-> (Params -> m [Result]) -- ^ Call with the revised params, program name and command line
-> m [Result]
diff -ru skylighting-core-0.7.7.orig/src/Skylighting/Regex.hs skylighting-core-0.7.7/src/Skylighting/Regex.hs
--- skylighting-core-0.7.7.orig/src/Skylighting/Regex.hs 2019-02-28 01:12:37.000000000 -0500
+++ skylighting-core-0.7.7/src/Skylighting/Regex.hs 2019-05-17 14:07:17.266167167 -0400
@@ -12,6 +12,7 @@
, convertOctalEscapes
) where
+import qualified Control.Monad.Fail as Fail
import qualified Control.Exception as E
import Data.Aeson
import Data.Binary (Binary)
@@ -102,5 +103,5 @@
encodeToText :: BS.ByteString -> Text.Text
encodeToText = TE.decodeUtf8 . Base64.encode
-decodeFromText :: (Monad m) => Text.Text -> m BS.ByteString
+decodeFromText :: (Fail.MonadFail m) => Text.Text -> m BS.ByteString
decodeFromText = either fail return . Base64.decode . TE.encodeUtf8
commit 4b33d76001a11970d615f675a7e10b71a74085c2
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri May 17 13:57:34 2019 -0400
Adapt to base-4.13.0.0
diff --git a/src/Text/TeXMath/Writers/TeX.hs b/src/Text/TeXMath/Writers/TeX.hs
index 262ece97..a0e54516 100644
--- a/src/Text/TeXMath/Writers/TeX.hs
+++ b/src/Text/TeXMath/Writers/TeX.hs
@@ -93,7 +93,7 @@ writeBinom cmd x y = do
"\\brack" -> tellGenFrac "[" "]"
"\\brace" -> tellGenFrac "\\{" "\\}"
"\\bangle" -> tellGenFrac "\\langle" "\\rangle"
- _ -> fail "writeBinom: unknown cmd"
+ _ -> error "writeBinom: unknown cmd"
tellGroup $ writeExp x
tellGroup $ writeExp y
else tellGroup $ do
......@@ -12,7 +12,7 @@ index d4cf0b1..7080c7c 100644
rpointMethod _ = RNil
{-# INLINE rpointMethod #-}
+#if __GLASGOW_HASKELL__ >= 809
+#if __GLASGOW_HASKELL__ >= 808
+# define KVS(kvs) kvs
+#else
+# define KVS(kvs)
......@@ -74,7 +74,7 @@ index 35e5944..f2524e3 100644
lens sa sbt afb s = fmap (sbt s) $ afb (sa s)
{-# INLINE lens #-}
+#if __GLASGOW_HASKELL__ >= 809
+#if __GLASGOW_HASKELL__ >= 808
+# define KVS(kvs) kvs
+#else
+# define KVS(kvs)
......@@ -136,7 +136,7 @@ index b813e47..f359ef1 100644
RNil -> RNil
(x :& xs) -> Compose (Dict x) :& reifyConstraint prx xs
+#if __GLASGOW_HASKELL__ >= 809
+#if __GLASGOW_HASKELL__ >= 808
+# define KVS(kvs) kvs
+#else
+# define KVS(kvs)
......@@ -165,7 +165,7 @@ index 6f850c8..68c6893 100644
withForeignPtr dst $ \dst' ->
dst <$ copyBytes dst' src' n
+#if __GLASGOW_HASKELL__ >= 809
+#if __GLASGOW_HASKELL__ >= 808
+# define KVS(kvs) kvs
+#else
+# define KVS(kvs)
......@@ -203,7 +203,7 @@ index f84d54b..d48cf3c 100644
instance ToJSON (f a) => ToJSON ((((,) Text) :. f) a) where
toJSON (Compose (name, x)) = object [(name, toJSON x)]
+#if __GLASGOW_HASKELL__ >= 809
+#if __GLASGOW_HASKELL__ >= 808
+# define KVS(kvs) kvs
+#else
+# define KVS(kvs)
......
diff -ru xml-hamlet-0.5.0.orig/Text/Hamlet/XMLParse.hs xml-hamlet-0.5.0/Text/Hamlet/XMLParse.hs
--- xml-hamlet-0.5.0.orig/Text/Hamlet/XMLParse.hs 2017-01-16 07:55:00.000000000 -0500
+++ xml-hamlet-0.5.0/Text/Hamlet/XMLParse.hs 2019-05-17 14:34:44.015911657 -0400
@@ -15,6 +15,7 @@
import Text.Shakespeare.Base
import Control.Applicative ((<$>), Applicative (..))
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Data.Char (isUpper)
import Data.Data
import Text.ParserCombinators.Parsec hiding (Line)
@@ -25,6 +26,10 @@
return = Ok
Error s >>= _ = Error s
Ok v >>= f = f v
+#if !(MIN_VERSION_base(4,13,0))
+ fail = Fail.fail
+#endif
+instance Fail.MonadFail Result where
fail = Error
instance Functor Result where
fmap = liftM
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment