├── .travis.yml ├── README.md ├── all-cabal-hashes.nix ├── default.nix ├── ghc-from-source.nix ├── ghc-prerelease.nix ├── http-api-data.nix ├── patches ├── Cabal-2.4.1.0.patch ├── EdisonAPI-1.3.1.patch ├── EdisonCore-1.3.2.1.patch ├── FPretty-1.1.patch ├── FontyFruity-0.5.3.4.patch ├── HTTP-4000.3.13.patch ├── HsYAML-0.1.1.3.patch ├── JuicyPixels-3.3.3.cabal ├── JuicyPixels-3.3.3.patch ├── QuickCheck-2.13.1.patch ├── STMonadTrans-0.4.3.cabal ├── STMonadTrans-0.4.3.patch ├── Unixutils-1.54.1.patch ├── Yampa-0.13.patch ├── aeson-1.4.3.0.patch ├── asn1-encoding-0.9.5.patch ├── attoparsec-0.13.2.2.cabal ├── attoparsec-0.13.2.2.patch ├── basement-0.0.10.cabal ├── basement-0.0.10.patch ├── bencode-0.6.0.0.patch ├── bytes-0.15.5.patch ├── bytestring-mmap-0.2.2.patch ├── cabal-doctest-1.0.6.patch ├── cassava-0.5.1.0.cabal ├── cassava-0.5.1.0.patch ├── cborg-0.2.1.0.patch ├── cereal-0.5.8.0.patch ├── cheapskate-0.1.1.1.cabal ├── cheapskate-0.1.1.1.patch ├── control-monad-omega-0.3.1.patch ├── cql-4.0.1.patch ├── critbit-0.2.0.0.patch ├── crypto-random-0.0.9.patch ├── data-dword-0.3.1.2.patch ├── diagrams-lib-1.4.2.3.cabal ├── diagrams-lib-1.4.2.3.patch ├── diagrams-svg-1.4.2.cabal ├── diagrams-svg-1.4.2.patch ├── dlist-0.8.0.6.patch ├── equivalence-0.3.4.patch ├── filelock-0.1.1.3.patch ├── fmlist-0.9.2.patch ├── foundation-0.0.23.cabal ├── foundation-0.0.23.patch ├── generic-lens-1.1.0.0.patch ├── ghc-paths-0.1.0.9.patch ├── hackage-security-0.5.3.0.cabal ├── hackage-security-0.5.3.0.patch ├── happy-1.19.11.patch ├── haskell-src-exts-1.21.0.patch ├── hedgehog-1.0.cabal ├── hedgehog-1.0.patch ├── hpack-0.31.2.patch ├── hsc2hs-0.68.4.cabal ├── hsc2hs-0.68.4.patch ├── hxt-9.3.1.16.patch ├── inline-c-0.7.0.1.patch ├── io-choice-0.0.7.patch ├── kind-generics-th-0.1.1.0.patch ├── language-c-0.8.2.cabal ├── language-c-0.8.2.patch ├── lens-4.17.1.cabal ├── lens-4.17.1.patch ├── memory-0.14.18.cabal ├── memory-0.14.18.patch ├── microlens-0.4.10.patch ├── monadplus-1.4.2.patch ├── optparse-applicative-0.14.3.0.patch ├── packman-0.5.0.patch ├── pandoc-2.7.2.cabal ├── pandoc-2.7.2.patch ├── persistent-2.10.0.patch ├── persistent-template-2.7.1.patch ├── pipes-4.3.9.cabal ├── pipes-4.3.9.patch ├── polyparse-1.12.1.patch ├── prettyprinter-1.2.1.patch ├── primitive-0.6.4.0.cabal ├── primitive-0.6.4.0.patch ├── regex-base-0.93.2.patch ├── regex-pcre-builtin-0.94.4.8.8.35.patch ├── regex-posix-0.95.2.patch ├── regex-tdfa-1.2.3.2.patch ├── safecopy-0.9.4.3.patch ├── shakespeare-2.0.20.patch ├── shelly-1.8.1.cabal ├── shelly-1.8.1.patch ├── singleton-bool-0.1.4.cabal ├── singleton-bool-0.1.4.patch ├── singleton-nats-0.4.2.patch ├── singletons-2.5.1.patch ├── skylighting-core-0.7.7.patch ├── snap-core-1.0.4.0.patch ├── socks-0.6.0.patch ├── store-0.5.1.0.cabal ├── store-0.5.1.0.patch ├── store-core-0.4.4.patch ├── streaming-0.2.2.0.patch ├── tar-0.5.1.0.cabal ├── tar-0.5.1.0.patch ├── texmath-0.11.2.2.patch ├── th-data-compat-0.0.2.7.patch ├── th-desugar-1.9.patch ├── th-utilities-0.2.3.0.patch ├── tls-1.4.1.cabal ├── tls-1.4.1.patch ├── trifecta-2.cabal ├── trifecta-2.patch ├── true-name-0.1.0.3.patch ├── turtle-1.5.14.patch ├── vector-th-unbox-0.2.1.6.patch ├── vinyl-0.11.0.patch ├── vty-5.25.1.patch ├── xml-hamlet-0.5.0.patch ├── yaml-0.11.0.0.patch ├── yesod-core-1.6.14.patch └── zlib-0.6.2.patch └── scripts ├── README.md ├── generate-nix-overrides.hs ├── head.hackage.sh ├── make-patch.sh ├── overrides.nix ├── patch-tool └── travis.sh /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | before_install: 4 | - echo "$TRAVIS_COMMIT_RANGE" 5 | - echo "$TRAVIS_EVENT_TYPE" 6 | 7 | install: 8 | - "true" 9 | 10 | script: 11 | - scripts/travis.sh 12 | -------------------------------------------------------------------------------- /all-cabal-hashes.nix: -------------------------------------------------------------------------------- 1 | let rev = "e8e76bc26a994aee313e571dc4e6701398d17a42"; 2 | in 3 | { 4 | url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/${rev}.tar.gz"; 5 | sha256 = "16rnyxqmr93ahml0fjfa6hmjpmx8sbpfdr52krd2sd6ic9n5p5ix"; 6 | } 7 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | # Build head.hackage packages 2 | # 3 | # Usage: 4 | # Build using nixpkgs' ghcHEAD: 5 | # nix build -f ./. 6 | # 7 | # Build using GHC built from source tree $GHC_TREE: 8 | # nix build -f --arg ghc "(import build.nix {ghc-path=$GHC_TREE;})" 9 | # 10 | let 11 | rev = "f2632f5c60f574d787fc5490efb3f43f9e6209b7"; 12 | baseNixpkgs = 13 | builtins.fetchTarball { 14 | url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; 15 | sha256 = "1c36p7w36i38gng3yp1nd5vz0p2dwrax5szjkvnmdxfklggs7knf"; 16 | }; 17 | in 18 | 19 | # ghc: path to a GHC source tree 20 | { ghc ? import ./ghc-prerelease.nix }: 21 | 22 | let 23 | jailbreakOverrides = self: super: { 24 | mkDerivation = drv: super.mkDerivation (drv // { jailbreak = true; doCheck = false; }); 25 | }; 26 | 27 | overrides = self: super: rec { 28 | all-cabal-hashes = self.fetchurl (import ./all-cabal-hashes.nix); 29 | 30 | # Should this be self? 31 | ghcHEAD = ghc super; 32 | 33 | haskellPackages = 34 | let patchesOverrides = self.callPackage patches {}; 35 | patches = self.callPackage (import ./scripts/overrides.nix) { patches = ./patches; }; 36 | overrides = self.lib.composeExtensions patchesOverrides jailbreakOverrides; 37 | 38 | baseHaskellPackages = self.callPackage "${baseNixpkgs}/pkgs/development/haskell-modules" { 39 | haskellLib = import "${baseNixpkgs}/pkgs/development/haskell-modules/lib.nix" { 40 | inherit (self) lib; 41 | pkgs = self; 42 | }; 43 | buildHaskellPackages = haskellPackages; #self.buildPackages.haskell.packages.ghc843; 44 | ghc = ghcHEAD; 45 | compilerConfig = self1: super1: { 46 | # Packages included in GHC's global package database 47 | Cabal = null; 48 | array = null; 49 | base = null; 50 | binary = null; 51 | bytestring = null; 52 | containers = null; 53 | deepseq = null; 54 | directory = null; 55 | filepath = null; 56 | ghc-boot = null; 57 | ghc-boot-th = null; 58 | ghc-compact = null; 59 | ghc-prim = null; 60 | ghci = null; 61 | haskeline = null; 62 | hpc = null; 63 | integer-gmp = null; 64 | integer-simple = null; 65 | mtl = null; 66 | parsec = null; 67 | pretty = null; 68 | process = null; 69 | rts = null; 70 | stm = null; 71 | template-haskell = null; 72 | text = null; 73 | time = null; 74 | transformers = null; 75 | unix = null; 76 | 77 | doctest = haskellPackages.callHackage "doctest" "0.16.0" {}; 78 | http-api-data = haskellPackages.callPackage ./http-api-data.nix {}; 79 | tagged = self1.callHackage "tagged" "0.8.6" {}; 80 | 81 | jailbreak-cabal = self.haskell.packages.ghc802.jailbreak-cabal; 82 | cabal2nix = self.haskell.packages.ghc843.cabal2nix; 83 | }; 84 | }; 85 | in baseHaskellPackages.extend overrides; 86 | 87 | headHackageScripts = self.stdenv.mkDerivation { 88 | name = "head-hackage-scripts"; 89 | nativeBuildInputs = [ self.makeWrapper ]; 90 | buildCommand = '' 91 | mkdir -p $out/bin 92 | makeWrapper ${scripts/patch-tool} $out/bin/patch-tool \ 93 | --prefix PATH : ${super.haskellPackages.cabal-install}/bin \ 94 | --prefix PATH : ${self.jq}/bin \ 95 | --prefix PATH : ${self.curl}/bin 96 | 97 | makeWrapper ${scripts/head.hackage.sh} $out/bin/head.hackage.sh \ 98 | --set CABAL ${super.haskellPackages.cabal-install}/bin/cabal 99 | ''; 100 | }; 101 | }; 102 | in import baseNixpkgs { overlays = [ overrides ]; } 103 | -------------------------------------------------------------------------------- /ghc-from-source.nix: -------------------------------------------------------------------------------- 1 | # Build a compiler from a GHC source tree. 2 | # 3 | 4 | # ghcTree: path to a GHC source tree 5 | { ghcTree }: pkgs: 6 | 7 | let 8 | base = pkgs.callPackage "${pkgs.path}/pkgs/development/compilers/ghc/head.nix" rec { 9 | bootPkgs = pkgs.haskell.packages.ghc843; 10 | inherit (bootPkgs) alex happy hscolour; 11 | buildLlvmPackages = pkgs.buildPackages.llvmPackages_6; 12 | llvmPackages = pkgs.llvmPackages_6; 13 | version = "8.6.0"; 14 | }; 15 | in base.overrideAttrs (oldAttrs: { 16 | src = with pkgs.lib; cleanSourceWith { 17 | src = ghcTree; 18 | filter = name: type: cleanSourceFilter name type 19 | && ! hasSuffix "are-validating.mk" name 20 | && ! hasSuffix "_build" name; 21 | }; 22 | }) 23 | -------------------------------------------------------------------------------- /ghc-prerelease.nix: -------------------------------------------------------------------------------- 1 | # Specify the precise commit of GHC that we are going to use by default 2 | nixpkgs: 3 | let spec = 4 | { 5 | version = "8.6.1.20180716"; 6 | src = 7 | nixpkgs.fetchgit { 8 | url = "git://git.haskell.org/ghc.git"; 9 | rev = "ghc-8.6.1-alpha2"; 10 | sha256 = "03y824yfy1xh2cznq5q75sql8pb0lxyw9ry82jgms9jampky98x6"; 11 | }; 12 | }; 13 | in 14 | 15 | (nixpkgs.haskell.compiler.ghcHEAD.override 16 | { version = spec.version 17 | ; bootPkgs = nixpkgs.haskell.packages.ghc822; }).overrideAttrs(oldAttrs: 18 | { src = spec.src; }) 19 | 20 | -------------------------------------------------------------------------------- /http-api-data.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, attoparsec, attoparsec-iso8601, base, bytestring 2 | , Cabal, cabal-doctest, containers, directory, doctest, filepath 3 | , hashable, hspec, hspec-discover, http-types, HUnit, QuickCheck 4 | , quickcheck-instances, stdenv, text, time, time-locale-compat 5 | , unordered-containers, uri-bytestring, uuid-types 6 | }: 7 | mkDerivation { 8 | pname = "http-api-data"; 9 | version = "0.3.8.1"; 10 | sha256 = "6eeaba4b29a00407cb20b865825b17b8d884c26b09c5bbe7b6e673b4522106b3"; 11 | setupHaskellDepends = [ base Cabal cabal-doctest ]; 12 | libraryHaskellDepends = [ 13 | attoparsec attoparsec-iso8601 base bytestring containers hashable 14 | http-types text time time-locale-compat unordered-containers 15 | uri-bytestring uuid-types 16 | ]; 17 | testHaskellDepends = [ 18 | base bytestring directory doctest filepath hspec HUnit QuickCheck 19 | quickcheck-instances text time unordered-containers uuid-types 20 | ]; 21 | testToolDepends = [ hspec-discover ]; 22 | homepage = "http://github.com/fizruk/http-api-data"; 23 | description = "Converting to/from HTTP API data like URL pieces, headers and query parameters"; 24 | license = stdenv.lib.licenses.bsd3; 25 | } 26 | -------------------------------------------------------------------------------- /patches/Cabal-2.4.1.0.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Distribution/Simple/PreProcess.hs b/Distribution/Simple/PreProcess.hs 2 | index 4933028..2af2316 100644 3 | --- a/Distribution/Simple/PreProcess.hs 4 | +++ b/Distribution/Simple/PreProcess.hs 5 | @@ -122,6 +122,12 @@ data PreProcessor = PreProcessor { 6 | -- preprocessor's output name format. 7 | type PreProcessorExtras = FilePath -> IO [FilePath] 8 | 9 | +-- | A newtype around 'PreProcessorExtras', useful for storing 10 | +-- 'PreProcessorExtras' inside of another type constructor (e.g., a list) 11 | +-- without impredicativity (recall that the 'IO' type, which is contained in 12 | +-- 'PreProcessorExtras', is a synonym for @'HasCallStack' => Prelude.IO@, which 13 | +-- is a polymorphic type). 14 | +newtype WrappedPreProcessorExtras = WrapPPE { unWrapPPE :: PreProcessorExtras } 15 | 16 | mkSimplePreProcessor :: (FilePath -> FilePath -> Verbosity -> IO ()) 17 | -> (FilePath, FilePath) 18 | @@ -694,8 +700,8 @@ knownSuffixHandlers = 19 | ] 20 | 21 | -- |Standard preprocessors with possible extra C sources: c2hs, hsc2hs. 22 | -knownExtrasHandlers :: [ PreProcessorExtras ] 23 | -knownExtrasHandlers = [ ppC2hsExtras, ppHsc2hsExtras ] 24 | +knownExtrasHandlers :: [ WrappedPreProcessorExtras ] 25 | +knownExtrasHandlers = [ WrapPPE ppC2hsExtras, WrapPPE ppHsc2hsExtras ] 26 | 27 | -- | Find any extra C sources generated by preprocessing that need to 28 | -- be added to the component (addresses issue #238). 29 | @@ -732,7 +738,7 @@ preprocessExtras verbosity comp lbi = case comp of 30 | pp :: FilePath -> IO [FilePath] 31 | pp dir = (map (dir ) . filter not_sub . concat) 32 | <$> for knownExtrasHandlers 33 | - (withLexicalCallStack (\f -> f dir)) 34 | + (withLexicalCallStack (\f -> f dir) . unWrapPPE) 35 | -- TODO: This is a terrible hack to work around #3545 while we don't 36 | -- reorganize the directory layout. Basically, for the main 37 | -- library, we might accidentally pick up autogenerated sources for 38 | -------------------------------------------------------------------------------- /patches/EdisonAPI-1.3.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru EdisonAPI-1.3.1.orig/src/Data/Edison/Seq/ListSeq.hs EdisonAPI-1.3.1/src/Data/Edison/Seq/ListSeq.hs 2 | --- EdisonAPI-1.3.1.orig/src/Data/Edison/Seq/ListSeq.hs 2016-06-03 00:49:51.000000000 -0400 3 | +++ EdisonAPI-1.3.1/src/Data/Edison/Seq/ListSeq.hs 2019-04-19 13:54:07.461113622 -0400 4 | @@ -131,25 +131,25 @@ 5 | rcons x s = s ++ [x] 6 | append = (++) 7 | 8 | -lview [] = fail "ListSeq.lview: empty sequence" 9 | +lview [] = error "ListSeq.lview: empty sequence" 10 | lview (x:xs) = return (x, xs) 11 | 12 | -lheadM [] = fail "ListSeq.lheadM: empty sequence" 13 | +lheadM [] = error "ListSeq.lheadM: empty sequence" 14 | lheadM (x:xs) = return x 15 | 16 | lhead [] = error "ListSeq.lhead: empty sequence" 17 | lhead (x:xs) = x 18 | 19 | -ltailM [] = fail "ListSeq.ltailM: empty sequence" 20 | +ltailM [] = error "ListSeq.ltailM: empty sequence" 21 | ltailM (x:xs) = return xs 22 | 23 | ltail [] = error "ListSeq.ltail: empty sequence" 24 | ltail (x:xs) = xs 25 | 26 | -rview [] = fail "ListSeq.rview: empty sequence" 27 | +rview [] = error "ListSeq.rview: empty sequence" 28 | rview xs = return (rhead xs, rtail xs) 29 | 30 | -rheadM [] = fail "ListSeq.rheadM: empty sequence" 31 | +rheadM [] = error "ListSeq.rheadM: empty sequence" 32 | rheadM (x:xs) = rh x xs 33 | where rh y [] = return y 34 | rh y (x:xs) = rh x xs 35 | @@ -159,7 +159,7 @@ 36 | where rh y [] = y 37 | rh y (x:xs) = rh x xs 38 | 39 | -rtailM [] = fail "ListSeq.rtailM: empty sequence" 40 | +rtailM [] = error "ListSeq.rtailM: empty sequence" 41 | rtailM (x:xs) = return (rt x xs) 42 | where rt y [] = [] 43 | rt y (x:xs) = y : rt x xs 44 | @@ -255,9 +255,9 @@ 45 | lookup i xs = ID.runIdentity (lookupM i xs) 46 | 47 | lookupM i xs 48 | - | i < 0 = fail "ListSeq.lookup: not found" 49 | + | i < 0 = error "ListSeq.lookup: not found" 50 | | otherwise = case drop i xs of 51 | - [] -> fail "ListSeq.lookup: not found" 52 | + [] -> error "ListSeq.lookup: not found" 53 | (x:_) -> return x 54 | 55 | lookupWithDefault d i xs 56 | -------------------------------------------------------------------------------- /patches/FPretty-1.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru FPretty-1.1.orig/Text/PrettyPrint/FPretty.hs FPretty-1.1/Text/PrettyPrint/FPretty.hs 2 | --- FPretty-1.1.orig/Text/PrettyPrint/FPretty.hs 2015-11-16 08:34:29.000000000 -0500 3 | +++ FPretty-1.1/Text/PrettyPrint/FPretty.hs 2018-01-16 18:12:17.694618006 -0500 4 | @@ -112,7 +112,11 @@ 5 | 6 | #if __GLASGOW_HASKELL__ >= 710 7 | -- The base libraries from GHC 7.10 onwards export <$> as synonym for fmap. 8 | -import Prelude hiding ((<$>)) 9 | +import Prelude hiding ( (<$>) 10 | +# if MIN_VERSION_base(4,11,0) 11 | + , (<>) 12 | +# endif 13 | + ) 14 | #endif 15 | 16 | import Data.Maybe (fromJust) 17 | -------------------------------------------------------------------------------- /patches/FontyFruity-0.5.3.4.patch: -------------------------------------------------------------------------------- 1 | diff -ru FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/CharacterMap.hs FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/CharacterMap.hs 2 | --- FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/CharacterMap.hs 2015-04-25 05:01:06.000000000 -0400 3 | +++ FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/CharacterMap.hs 2019-03-16 06:48:06.693682922 -0400 4 | @@ -102,7 +102,7 @@ 5 | rnf (CharacterMaps maps) = rnf maps `seq` () 6 | 7 | instance Binary CharacterMaps where 8 | - put _ = fail "Unimplemented" 9 | + put _ = error "Unimplemented" 10 | get = do 11 | startIndex <- bytesRead 12 | versionNumber <- getWord16be 13 | @@ -192,7 +192,7 @@ 14 | compare _ _ = GT 15 | 16 | instance Binary CharacterTable where 17 | - put _ = fail "Binary.put CharacterTable - Unimplemented" 18 | + put _ = error "Binary.put CharacterTable - Unimplemented" 19 | get = do 20 | format <- getWord16be 21 | case format of 22 | @@ -305,7 +305,7 @@ 23 | langIdOfCharMap = _format0Language 24 | 25 | instance Binary Format0 where 26 | - put _ = fail "Binary.Format0.put - unimplemented" 27 | + put _ = error "Binary.Format0.put - unimplemented" 28 | get = do 29 | tableSize <- getWord16be 30 | when (tableSize /= 262) $ 31 | @@ -347,7 +347,7 @@ 32 | 33 | 34 | instance Binary Format2 where 35 | - put _ = fail "Format2.put - unimplemented" 36 | + put _ = error "Format2.put - unimplemented" 37 | get = do 38 | _tableSize <- getWord16be 39 | lang <- getWord16be 40 | @@ -376,7 +376,7 @@ 41 | langIdOfCharMap = _format6Language 42 | 43 | instance Binary Format6 where 44 | - put _ = fail "Format6.put - unimplemented" 45 | + put _ = error "Format6.put - unimplemented" 46 | get = do 47 | _length <- getWord16be 48 | language <- getWord16be 49 | diff -ru FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Glyph.hs FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Glyph.hs 50 | --- FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Glyph.hs 2017-06-29 17:15:33.000000000 -0400 51 | +++ FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Glyph.hs 2019-03-16 06:47:22.845370697 -0400 52 | @@ -313,7 +313,7 @@ 53 | where breaker array ix = VU.splitAt (fromIntegral ix + 1) array 54 | 55 | instance Binary Glyph where 56 | - put _ = fail "Glyph.put - unimplemented" 57 | + put _ = error "Glyph.put - unimplemented" 58 | get = do 59 | hdr <- get 60 | case _glfNumberOfContours hdr of 61 | diff -ru FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Header.hs FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Header.hs 62 | --- FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Header.hs 2016-01-05 16:09:02.000000000 -0500 63 | +++ FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Header.hs 2019-03-16 06:48:33.605875180 -0400 64 | @@ -100,7 +100,7 @@ 65 | rnf (FontHeader {}) = () 66 | 67 | instance Binary FontHeader where 68 | - put _ = fail "Unimplemented" 69 | + put _ = error "Unimplemented" 70 | get = 71 | FontHeader <$> get <*> get <*> g32 <*> g32 <*> get 72 | <*> g16 <*> g64 <*> g64 <*> get <*> get 73 | diff -ru FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/MaxpTable.hs FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/MaxpTable.hs 74 | --- FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/MaxpTable.hs 2015-04-25 05:01:06.000000000 -0400 75 | +++ FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/MaxpTable.hs 2019-03-16 06:48:26.633825328 -0400 76 | @@ -50,7 +50,7 @@ 77 | rnf (MaxpTable {}) = () 78 | 79 | instance Binary MaxpTable where 80 | - put _ = fail "Unimplemented" 81 | + put _ = error "Unimplemented" 82 | get = MaxpTable 83 | <$> get <*> g16 <*> g16 <*> g16 <*> g16 <*> g16 84 | <*> g16 <*> g16 <*> g16 <*> g16 <*> g16 <*> g16 85 | diff -ru FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Name.hs FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Name.hs 86 | --- FontyFruity-0.5.3.4.orig/src/Graphics/Text/TrueType/Name.hs 2015-04-25 05:01:06.000000000 -0400 87 | +++ FontyFruity-0.5.3.4/src/Graphics/Text/TrueType/Name.hs 2019-03-16 06:48:14.853741168 -0400 88 | @@ -35,7 +35,7 @@ 89 | rnf (NameTable {}) = () 90 | 91 | instance Binary NameTable where 92 | - put _ = fail "Binary.put NameTable - unimplemented" 93 | + put _ = error "Binary.put NameTable - unimplemented" 94 | get = do 95 | nameFormatId <- getWord16be 96 | when (nameFormatId /= 0) $ 97 | -------------------------------------------------------------------------------- /patches/HTTP-4000.3.13.patch: -------------------------------------------------------------------------------- 1 | diff -ru HTTP-4000.3.13.orig/Network/Browser.hs HTTP-4000.3.13/Network/Browser.hs 2 | --- HTTP-4000.3.13.orig/Network/Browser.hs 2019-03-17 07:46:06.000000000 -0400 3 | +++ HTTP-4000.3.13/Network/Browser.hs 2019-03-23 09:56:07.221275392 -0400 4 | @@ -143,6 +143,7 @@ 5 | #else 6 | import Control.Monad (filterM, forM_, when) 7 | #endif 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.State (StateT (..), MonadIO (..), modify, gets, withStateT, evalStateT, MonadState (..)) 10 | 11 | import qualified System.IO 12 | @@ -416,13 +417,13 @@ 13 | newtype BrowserAction conn a 14 | = BA { unBA :: StateT (BrowserState conn) IO a } 15 | #ifdef MTL1 16 | - deriving (Functor, Monad, MonadIO, MonadState (BrowserState conn)) 17 | + deriving (Functor, Monad, MonadIO, MonadState (BrowserState conn), Fail.MonadFail) 18 | 19 | instance Applicative (BrowserAction conn) where 20 | pure = return 21 | (<*>) = ap 22 | #else 23 | - deriving (Functor, Applicative, Monad, MonadIO, MonadState (BrowserState conn)) 24 | + deriving (Functor, Applicative, Monad, MonadIO, MonadState (BrowserState conn), Fail.MonadFail) 25 | #endif 26 | 27 | runBA :: BrowserState conn -> BrowserAction conn a -> IO a 28 | diff -ru HTTP-4000.3.13.orig/Network/HTTP/Base.hs HTTP-4000.3.13/Network/HTTP/Base.hs 29 | --- HTTP-4000.3.13.orig/Network/HTTP/Base.hs 2019-03-17 07:46:06.000000000 -0400 30 | +++ HTTP-4000.3.13/Network/HTTP/Base.hs 2019-03-23 09:55:00.736769582 -0400 31 | @@ -108,6 +108,7 @@ 32 | 33 | import Control.Monad ( guard ) 34 | import Control.Monad.Error.Class () 35 | +import qualified Control.Monad.Fail as Fail 36 | import Data.Bits ( (.&.), (.|.), shiftL, shiftR ) 37 | import Data.Word ( Word8 ) 38 | import Data.Char ( digitToInt, intToDigit, toLower, isDigit, 39 | @@ -209,7 +210,7 @@ 40 | default_http = 80 41 | default_https = 443 42 | 43 | -failHTTPS :: Monad m => URI -> m () 44 | +failHTTPS :: Fail.MonadFail m => URI -> m () 45 | failHTTPS uri 46 | | map toLower (uriScheme uri) == "https:" = fail "https not supported" 47 | | otherwise = return () 48 | @@ -713,7 +714,7 @@ 49 | 50 | -- | @getAuth req@ fishes out the authority portion of the URL in a request's @Host@ 51 | -- header. 52 | -getAuth :: Monad m => Request ty -> m URIAuthority 53 | +getAuth :: Fail.MonadFail m => Request ty -> m URIAuthority 54 | getAuth r = 55 | -- ToDo: verify that Network.URI functionality doesn't take care of this (now.) 56 | case parseURIAuthority auth of 57 | -------------------------------------------------------------------------------- /patches/HsYAML-0.1.1.3.patch: -------------------------------------------------------------------------------- 1 | commit 12031cb665d5dc365ae3ea7dee6df23badcc740e 2 | Author: Ryan Scott 3 | Date: Fri May 17 13:52:00 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Data/YAML.hs b/src/Data/YAML.hs 8 | index 9eb3a66..46ad654 100644 9 | --- a/src/Data/YAML.hs 10 | +++ b/src/Data/YAML.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | {-# LANGUAGE OverloadedStrings #-} 14 | {-# LANGUAGE RecordWildCards #-} 15 | {-# LANGUAGE Safe #-} 16 | @@ -211,7 +212,9 @@ instance Monad Parser where 17 | return = pure 18 | P m >>= k = P (m >>= unP . k) 19 | (>>) = (*>) 20 | +#if !(MIN_VERSION_base(4,13,0)) 21 | fail = Fail.fail 22 | +#endif 23 | 24 | -- | @since 0.1.1.0 25 | instance Fail.MonadFail Parser where 26 | diff --git a/src/Data/YAML/Token.hs b/src/Data/YAML/Token.hs 27 | index df3e95e..ff9d0f9 100644 28 | --- a/src/Data/YAML/Token.hs 29 | +++ b/src/Data/YAML/Token.hs 30 | @@ -1,3 +1,4 @@ 31 | +{-# LANGUAGE CPP #-} 32 | {-# LANGUAGE FlexibleContexts #-} 33 | {-# LANGUAGE FlexibleInstances #-} 34 | {-# LANGUAGE FunctionalDependencies #-} 35 | @@ -24,6 +25,7 @@ module Data.YAML.Token 36 | , Code(..) 37 | ) where 38 | 39 | +import qualified Control.Monad.Fail as Fail 40 | import qualified Data.ByteString.Lazy.Char8 as BLC 41 | import qualified Data.DList as D 42 | import Prelude hiding ((*), (+), (-), (/), (^)) 43 | @@ -442,6 +444,12 @@ instance Monad Parser where 44 | 45 | (>>) = (*>) 46 | 47 | +#if !(MIN_VERSION_base(4,13,0)) 48 | + -- @fail message@ does just that - fails with a /message/. 49 | + fail = Fail.fail 50 | +#endif 51 | + 52 | +instance Fail.MonadFail Parser where 53 | -- @fail message@ does just that - fails with a /message/. 54 | fail message = Parser $ \state -> failReply state message 55 | 56 | -------------------------------------------------------------------------------- /patches/JuicyPixels-3.3.3.cabal: -------------------------------------------------------------------------------- 1 | Name: JuicyPixels 2 | Version: 3.3.3 3 | x-revision: 1 4 | Synopsis: Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance) 5 | Description: 6 | <> 7 | . 8 | This library can load and store images in PNG,Bitmap, Jpeg, Radiance, Tiff and Gif images. 9 | 10 | homepage: https://github.com/Twinside/Juicy.Pixels 11 | License: BSD3 12 | License-file: LICENSE 13 | Author: Vincent Berthoux 14 | Maintainer: vincent.berthoux@gmail.com 15 | Category: Codec, Graphics, Image 16 | Stability: Stable 17 | Build-type: Simple 18 | 19 | -- Constraint on the version of Cabal needed to build this package. 20 | Cabal-version: >= 1.18 21 | 22 | extra-source-files: changelog, docimages/*.png, docimages/*.svg, README.md 23 | extra-doc-files: docimages/*.png, docimages/*.svg 24 | 25 | Source-Repository head 26 | Type: git 27 | Location: git://github.com/Twinside/Juicy.Pixels.git 28 | 29 | Source-Repository this 30 | Type: git 31 | Location: git://github.com/Twinside/Juicy.Pixels.git 32 | Tag: v3.3.3 33 | 34 | Flag Mmap 35 | Description: Enable the file loading via mmap (memory map) 36 | Default: False 37 | 38 | Library 39 | hs-source-dirs: src 40 | Default-Language: Haskell2010 41 | Exposed-modules: Codec.Picture, 42 | Codec.Picture.Bitmap, 43 | Codec.Picture.Gif, 44 | Codec.Picture.Png, 45 | Codec.Picture.Jpg, 46 | Codec.Picture.HDR, 47 | Codec.Picture.Tga, 48 | Codec.Picture.Tiff, 49 | Codec.Picture.Metadata, 50 | Codec.Picture.Metadata.Exif, 51 | Codec.Picture.Saving, 52 | Codec.Picture.Types, 53 | Codec.Picture.ColorQuant, 54 | Codec.Picture.Jpg.Internal.DefaultTable, 55 | Codec.Picture.Jpg.Internal.Metadata, 56 | Codec.Picture.Jpg.Internal.FastIdct, 57 | Codec.Picture.Jpg.Internal.FastDct, 58 | Codec.Picture.Jpg.Internal.Types, 59 | Codec.Picture.Jpg.Internal.Common, 60 | Codec.Picture.Jpg.Internal.Progressive, 61 | Codec.Picture.Gif.Internal.LZW, 62 | Codec.Picture.Gif.Internal.LZWEncoding, 63 | Codec.Picture.Png.Internal.Export, 64 | Codec.Picture.Png.Internal.Type, 65 | Codec.Picture.Png.Internal.Metadata, 66 | Codec.Picture.Tiff.Internal.Metadata, 67 | Codec.Picture.Tiff.Internal.Types 68 | 69 | Ghc-options: -O3 -Wall 70 | Build-depends: base >= 4.11 && < 5, 71 | bytestring >= 0.9 && < 0.11, 72 | mtl >= 1.1 && < 2.3, 73 | binary >= 0.5 && < 0.9, 74 | zlib >= 0.5.3.1 && < 0.7, 75 | transformers >= 0.2, 76 | vector >= 0.10 && < 0.13, 77 | primitive >= 0.4 && < 0.7, 78 | deepseq >= 1.1 && < 1.5, 79 | containers >= 0.4.2 && < 0.7 80 | 81 | -- Modules not exported by this package. 82 | Other-modules: Codec.Picture.BitWriter, 83 | Codec.Picture.InternalHelper, 84 | Codec.Picture.VectorByteConversion 85 | 86 | Install-Includes: src/Codec/Picture/ConvGraph.hs 87 | Include-Dirs: src/Codec/Picture 88 | 89 | -------------------------------------------------------------------------------- /patches/JuicyPixels-3.3.3.patch: -------------------------------------------------------------------------------- 1 | diff -ru JuicyPixels-3.3.3.orig/src/Codec/Picture/Bitmap.hs JuicyPixels-3.3.3/src/Codec/Picture/Bitmap.hs 2 | --- JuicyPixels-3.3.3.orig/src/Codec/Picture/Bitmap.hs 2018-12-16 16:36:06.000000000 -0500 3 | +++ JuicyPixels-3.3.3/src/Codec/Picture/Bitmap.hs 2019-03-16 08:05:10.530793764 -0400 4 | @@ -26,6 +26,7 @@ 5 | 6 | import Control.Arrow( first ) 7 | import Control.Monad( replicateM, when, foldM_, forM_, void ) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.ST ( ST, runST ) 10 | import Data.Maybe( fromMaybe ) 11 | import qualified Data.Vector.Storable as VS 12 | @@ -884,7 +885,7 @@ 13 | a -> fail $ "Can't handle BMP file " ++ show a 14 | 15 | -- | Decode a bitfield. Will fail if the bitfield is empty. 16 | -getBitfield :: (FiniteBits t, Integral t, Num t, Monad m) => t -> m (Bitfield t) 17 | +getBitfield :: (FiniteBits t, Integral t, Num t, Fail.MonadFail m) => t -> m (Bitfield t) 18 | getBitfield 0 = fail $ 19 | "Codec.Picture.Bitmap.getBitfield: bitfield cannot be 0" 20 | getBitfield w = return (makeBitfield w) 21 | diff -ru JuicyPixels-3.3.3.orig/src/Codec/Picture/Jpg.hs JuicyPixels-3.3.3/src/Codec/Picture/Jpg.hs 22 | --- JuicyPixels-3.3.3.orig/src/Codec/Picture/Jpg.hs 2018-12-16 16:36:06.000000000 -0500 23 | +++ JuicyPixels-3.3.3/src/Codec/Picture/Jpg.hs 2019-03-16 08:05:34.710988437 -0400 24 | @@ -309,7 +309,7 @@ 25 | scanSpecifier scanCount scanSpec = do 26 | compMapping <- gets componentIndexMapping 27 | comp <- case lookup (componentSelector scanSpec) compMapping of 28 | - Nothing -> fail "Jpg decoding error - bad component selector in blob." 29 | + Nothing -> error "Jpg decoding error - bad component selector in blob." 30 | Just v -> return v 31 | let maximumHuffmanTable = 4 32 | dcIndex = min (maximumHuffmanTable - 1) 33 | @@ -326,7 +326,7 @@ 34 | frameInfo <- gets currentFrame 35 | blobId <- gets seenBlobs 36 | case frameInfo of 37 | - Nothing -> fail "Jpg decoding error - no previous frame" 38 | + Nothing -> error "Jpg decoding error - no previous frame" 39 | Just v -> do 40 | let compDesc = jpgComponents v !! comp 41 | compCount = length $ jpgComponents v 42 | -------------------------------------------------------------------------------- /patches/QuickCheck-2.13.1.patch: -------------------------------------------------------------------------------- 1 | commit d8126acd23b70c225c591d40a18a1d6b7833bbab 2 | Author: Ryan Scott 3 | Date: Fri Mar 29 06:46:04 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Test/QuickCheck/Monadic.hs b/Test/QuickCheck/Monadic.hs 8 | index a8f3043..23153f2 100644 9 | --- a/Test/QuickCheck/Monadic.hs 10 | +++ b/Test/QuickCheck/Monadic.hs 11 | @@ -123,7 +123,9 @@ instance Applicative (PropertyM m) where 12 | instance Monad m => Monad (PropertyM m) where 13 | return = pure 14 | (>>=) = bind 15 | +#if !defined(NO_MONADFAIL) && !(MIN_VERSION_base(4,13,0)) 16 | fail = fail_ 17 | +#endif 18 | 19 | #ifndef NO_MONADFAIL 20 | instance Monad m => Fail.MonadFail (PropertyM m) where 21 | -------------------------------------------------------------------------------- /patches/STMonadTrans-0.4.3.cabal: -------------------------------------------------------------------------------- 1 | name: STMonadTrans 2 | version: 0.4.3 3 | x-revision: 1 4 | cabal-version: >= 1.8 5 | license: BSD3 6 | license-file: LICENSE 7 | author: Josef Svenningsson 8 | maintainer: josef.svenningsson@gmail.com 9 | category: Monads 10 | build-type: Simple 11 | synopsis: A monad transformer version of the ST monad 12 | description: 13 | A monad transformer version of the ST monad 14 | 15 | Warning! This monad transformer should not be used with monads that 16 | can contain multiple answers, like the list monad. The reason is that 17 | the state token will be duplicated across the different answers and 18 | this causes Bad Things to happen (such as loss of referential 19 | transparency). Safe monads include the monads State, Reader, Writer, 20 | Maybe and combinations of their corresponding monad transformers. 21 | 22 | extra-source-files: 23 | changelog.md 24 | 25 | source-repository head 26 | type: git 27 | location: https://github.com/josefs/STMonadTrans 28 | 29 | flag splitBase 30 | description: Choose the new smaller, split-up base package. 31 | 32 | library 33 | build-depends: base >= 4.6 34 | 35 | if flag(splitBase) 36 | build-depends: base >= 3, base < 5, mtl, array 37 | else 38 | build-depends: base < 3 39 | 40 | exposed-modules: 41 | Control.Monad.ST.Trans, 42 | Control.Monad.ST.Trans.Internal 43 | extensions: CPP, MagicHash, UnboxedTuples, Rank2Types, FlexibleInstances, 44 | MultiParamTypeClasses, UndecidableInstances 45 | 46 | Test-Suite foo 47 | type: detailed-0.9 48 | hs-source-dirs: test 49 | test-module: Test 50 | build-depends: STMonadTrans, base, mtl, array, Cabal 51 | -------------------------------------------------------------------------------- /patches/STMonadTrans-0.4.3.patch: -------------------------------------------------------------------------------- 1 | diff -ru STMonadTrans-0.4.3.orig/Control/Monad/ST/Trans/Internal.hs STMonadTrans-0.4.3/Control/Monad/ST/Trans/Internal.hs 2 | --- STMonadTrans-0.4.3.orig/Control/Monad/ST/Trans/Internal.hs 2017-02-09 08:18:16.000000000 -0500 3 | +++ STMonadTrans-0.4.3/Control/Monad/ST/Trans/Internal.hs 2019-04-19 13:40:49.646093718 -0400 4 | @@ -1,5 +1,5 @@ 5 | {-# LANGUAGE MagicHash, UnboxedTuples, Rank2Types, FlexibleInstances, 6 | - MultiParamTypeClasses, UndecidableInstances, RecursiveDo #-} 7 | + MultiParamTypeClasses, UndecidableInstances, RecursiveDo, CPP #-} 8 | {- | 9 | Module : Control.Monad.ST.Trans 10 | Copyright : Josef Svenningsson 2008-2010 11 | @@ -26,6 +26,7 @@ 12 | import GHC.Base 13 | import GHC.ST hiding (liftST) 14 | 15 | +import qualified Control.Monad.Fail as Fail 16 | import Control.Monad.Fix 17 | import Control.Monad.Trans 18 | import Control.Monad.Error.Class 19 | @@ -69,7 +70,12 @@ 20 | case ret of 21 | STTRet new_st a -> 22 | unSTT (k a) new_st 23 | +#if !(MIN_VERSION_base(4,13,0)) 24 | fail msg = lift (fail msg) 25 | +#endif 26 | + 27 | +instance Fail.MonadFail m => Fail.MonadFail (STT s m) where 28 | + fail msg = lift (Fail.fail msg) 29 | 30 | instance MonadTrans (STT s) where 31 | lift m = STT $ \st -> 32 | -------------------------------------------------------------------------------- /patches/Unixutils-1.54.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru Unixutils-1.54.1.orig/System/Unix/Chroot.hs Unixutils-1.54.1/System/Unix/Chroot.hs 2 | --- Unixutils-1.54.1.orig/System/Unix/Chroot.hs 2015-08-11 16:02:44.000000000 -0400 3 | +++ Unixutils-1.54.1/System/Unix/Chroot.hs 2018-07-04 21:18:53.544302297 -0400 4 | @@ -1,4 +1,4 @@ 5 | -{-# LANGUAGE ForeignFunctionInterface #-} 6 | +{-# LANGUAGE CPP, ForeignFunctionInterface #-} 7 | -- | This module, except for useEnv, is copied from the build-env package. 8 | module System.Unix.Chroot 9 | ( fchroot 10 | @@ -45,7 +45,11 @@ 11 | fchroot :: (MonadIO m, MonadMask m) => FilePath -> m a -> m a 12 | fchroot path action = 13 | do origWd <- liftIO $ getWorkingDirectory 14 | - rootFd <- liftIO $ openFd "/" ReadOnly Nothing defaultFileFlags 15 | + rootFd <- liftIO $ openFd "/" ReadOnly 16 | +#if !(MIN_VERSION_unix(2,8,0)) 17 | + Nothing 18 | +#endif 19 | + defaultFileFlags 20 | liftIO $ chroot path 21 | liftIO $ changeWorkingDirectory "/" 22 | action `finally` (liftIO $ breakFree origWd rootFd) 23 | -------------------------------------------------------------------------------- /patches/Yampa-0.13.patch: -------------------------------------------------------------------------------- 1 | commit e1fd4b583d8a09d54e089fe2b89e921d3b854182 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 18:49:39 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/FRP/Yampa/Event.hs b/src/FRP/Yampa/Event.hs 8 | index 804fe46..0639f3f 100644 9 | --- a/src/FRP/Yampa/Event.hs 10 | +++ b/src/FRP/Yampa/Event.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} 14 | ----------------------------------------------------------------------------------------- 15 | -- | 16 | @@ -90,6 +91,7 @@ module FRP.Yampa.Event where 17 | 18 | import Control.Applicative 19 | import Control.DeepSeq (NFData(..)) 20 | +import qualified Control.Monad.Fail as Fail 21 | 22 | import FRP.Yampa.Diagnostics 23 | 24 | @@ -175,9 +177,14 @@ instance Monad Event where 25 | 26 | -- | See 'pure'. 27 | return = pure 28 | +#if !(MIN_VERSION_base(4,13,0)) 29 | -- | Fail with 'NoEvent'. 30 | - fail _ = NoEvent 31 | + fail = Fail.fail 32 | +#endif 33 | 34 | +instance Fail.MonadFail Event where 35 | + -- | Fail with 'NoEvent'. 36 | + fail _ = NoEvent 37 | 38 | -- | Alternative instance 39 | instance Alternative Event where 40 | -------------------------------------------------------------------------------- /patches/aeson-1.4.3.0.patch: -------------------------------------------------------------------------------- 1 | commit 194eaa0d3dbafd593eeb12deb57374476a1adf4f 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 18:27:52 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Data/Aeson/Types/Internal.hs b/Data/Aeson/Types/Internal.hs 8 | index abe5afc..319225c 100644 9 | --- a/Data/Aeson/Types/Internal.hs 10 | +++ b/Data/Aeson/Types/Internal.hs 11 | @@ -157,8 +157,10 @@ instance Monad IResult where 12 | IError path err >>= _ = IError path err 13 | {-# INLINE (>>=) #-} 14 | 15 | +#if !(MIN_VERSION_base(4,13,0)) 16 | fail = Fail.fail 17 | {-# INLINE fail #-} 18 | +#endif 19 | 20 | instance Fail.MonadFail IResult where 21 | fail err = IError [] err 22 | @@ -172,8 +174,10 @@ instance Monad Result where 23 | Error err >>= _ = Error err 24 | {-# INLINE (>>=) #-} 25 | 26 | +#if !(MIN_VERSION_base(4,13,0)) 27 | fail = Fail.fail 28 | {-# INLINE fail #-} 29 | +#endif 30 | 31 | instance Fail.MonadFail Result where 32 | fail err = Error err 33 | @@ -287,8 +291,10 @@ instance Monad Parser where 34 | {-# INLINE (>>=) #-} 35 | return = pure 36 | {-# INLINE return #-} 37 | +#if !(MIN_VERSION_base(4,13,0)) 38 | fail = Fail.fail 39 | {-# INLINE fail #-} 40 | +#endif 41 | 42 | instance Fail.MonadFail Parser where 43 | fail msg = Parser $ \path kf _ks -> kf (reverse path) msg 44 | -------------------------------------------------------------------------------- /patches/asn1-encoding-0.9.5.patch: -------------------------------------------------------------------------------- 1 | diff -ru asn1-encoding-0.9.5.orig/Data/ASN1/Get.hs asn1-encoding-0.9.5/Data/ASN1/Get.hs 2 | --- asn1-encoding-0.9.5.orig/Data/ASN1/Get.hs 2016-06-07 00:53:07.000000000 -0400 3 | +++ asn1-encoding-0.9.5/Data/ASN1/Get.hs 2019-03-16 09:34:51.248651835 -0400 4 | @@ -15,6 +15,7 @@ 5 | -- The original code has been tailored and reduced to only cover the useful 6 | -- case for asn1 and augmented by a position. 7 | -- 8 | +{-# LANGUAGE CPP #-} 9 | {-# LANGUAGE Rank2Types #-} 10 | module Data.ASN1.Get 11 | ( Result(..) 12 | @@ -29,6 +30,7 @@ 13 | 14 | import Control.Applicative (Applicative(..),Alternative(..)) 15 | import Control.Monad (ap,MonadPlus(..)) 16 | +import qualified Control.Monad.Fail as Fail 17 | import Data.Maybe (fromMaybe) 18 | import Foreign 19 | 20 | @@ -103,6 +105,11 @@ 21 | let ks' s1 b1 m1 p1 a = unGet (g a) s1 b1 m1 p1 kf ks 22 | in unGet m s0 b0 m0 p0 kf ks' 23 | 24 | +#if !(MIN_VERSION_base(4,13,0)) 25 | + fail = Fail.fail 26 | +#endif 27 | + 28 | +instance Fail.MonadFail Get where 29 | fail = failDesc 30 | 31 | instance MonadPlus Get where 32 | -------------------------------------------------------------------------------- /patches/attoparsec-0.13.2.2.patch: -------------------------------------------------------------------------------- 1 | commit de0cf2890b9602021d6e18a2523ccdf39816d599 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 18:18:54 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Data/Attoparsec/Internal/Types.hs b/Data/Attoparsec/Internal/Types.hs 8 | index 7560f22..b848345 100644 9 | --- a/Data/Attoparsec/Internal/Types.hs 10 | +++ b/Data/Attoparsec/Internal/Types.hs 11 | @@ -1,4 +1,4 @@ 12 | -{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, OverloadedStrings, 13 | +{-# LANGUAGE CPP, BangPatterns, GeneralizedNewtypeDeriving, OverloadedStrings, 14 | Rank2Types, RecordWildCards, TypeFamilies #-} 15 | -- | 16 | -- Module : Data.Attoparsec.Internal.Types 17 | @@ -136,8 +136,10 @@ instance Mon.Monoid More where 18 | mempty = Incomplete 19 | 20 | instance Monad (Parser i) where 21 | +#if !(MIN_VERSION_base(4,13,0)) 22 | fail = Fail.fail 23 | {-# INLINE fail #-} 24 | +#endif 25 | 26 | return = App.pure 27 | {-# INLINE return #-} 28 | diff --git a/Data/Attoparsec/Zepto.hs b/Data/Attoparsec/Zepto.hs 29 | index 5af5bb6..da2c244 100644 30 | --- a/Data/Attoparsec/Zepto.hs 31 | +++ b/Data/Attoparsec/Zepto.hs 32 | @@ -92,8 +92,10 @@ instance Monad m => Monad (ZeptoT m) where 33 | Fail err -> return (Fail err) 34 | {-# INLINE (>>=) #-} 35 | 36 | +#if !(MIN_VERSION_base(4,13,0)) 37 | fail = Fail.fail 38 | {-# INLINE fail #-} 39 | +#endif 40 | 41 | instance Monad m => Fail.MonadFail (ZeptoT m) where 42 | fail msg = Parser $ \_ -> return (Fail msg) 43 | -------------------------------------------------------------------------------- /patches/basement-0.0.10.patch: -------------------------------------------------------------------------------- 1 | diff -ru basement-0.0.10.orig/Basement/Compat/Base.hs basement-0.0.10/Basement/Compat/Base.hs 2 | --- basement-0.0.10.orig/Basement/Compat/Base.hs 2019-01-09 06:14:46.000000000 -0500 3 | +++ basement-0.0.10/Basement/Compat/Base.hs 2019-03-16 08:58:05.439886586 -0400 4 | @@ -1,3 +1,4 @@ 5 | +{-# LANGUAGE CPP #-} 6 | -- | 7 | -- Module : Basement.Compat.Base 8 | -- License : BSD-style 9 | @@ -34,6 +35,9 @@ 10 | , Prelude.Functor (..) 11 | , Control.Applicative.Applicative (..) 12 | , Prelude.Monad (..) 13 | +#if MIN_VERSION_base(4,13,0) 14 | + , Prelude.MonadFail (..) 15 | +#endif 16 | , Control.Monad.when 17 | , Control.Monad.unless 18 | , Prelude.Maybe (..) 19 | -------------------------------------------------------------------------------- /patches/bencode-0.6.0.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs bencode-0.6.0.0/src/Data/BEncode/Parser.hs 2 | --- bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs 2015-05-09 15:56:43.000000000 -0400 3 | +++ bencode-0.6.0.0/src/Data/BEncode/Parser.hs 2019-05-17 14:32:05.074495583 -0400 4 | @@ -1,3 +1,5 @@ 5 | +{-# LANGUAGE CPP #-} 6 | + 7 | ----------------------------------------------------------------------------- 8 | -- | 9 | -- Module : BParser 10 | @@ -26,6 +28,7 @@ 11 | 12 | import Control.Applicative hiding (optional) 13 | import Control.Monad 14 | +import qualified Control.Monad.Fail as Fail 15 | import Data.BEncode 16 | import qualified Data.ByteString.Lazy.Char8 as L 17 | import qualified Data.Map as Map 18 | @@ -61,6 +64,11 @@ 19 | Ok a b' -> runB (f a) b' 20 | Error str -> Error str 21 | return val = BParser $ Ok val 22 | +#if !(MIN_VERSION_base(4,13,0)) 23 | + fail = Fail.fail 24 | +#endif 25 | + 26 | +instance Fail.MonadFail BParser where 27 | fail str = BParser $ \_ -> Error str 28 | 29 | instance Functor BParser where 30 | -------------------------------------------------------------------------------- /patches/bytes-0.15.5.patch: -------------------------------------------------------------------------------- 1 | commit 3bbc80a8a708886f593c9591197d43191e7f31ba 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 14:09:31 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Data/Bytes/Get.hs b/src/Data/Bytes/Get.hs 8 | index 6ab1a04..fd5e26b 100644 9 | --- a/src/Data/Bytes/Get.hs 10 | +++ b/src/Data/Bytes/Get.hs 11 | @@ -28,6 +28,7 @@ module Data.Bytes.Get 12 | #if __GLASGOW_HASKELL__ < 710 13 | import Control.Applicative 14 | #endif 15 | +import qualified Control.Monad.Fail as Fail 16 | import Control.Monad.Reader 17 | import Control.Monad.Trans.Except as Except 18 | import Control.Monad.RWS.Lazy as Lazy 19 | @@ -43,7 +44,7 @@ import Data.Int 20 | import qualified Data.Serialize.Get as S 21 | import Data.Word 22 | 23 | -class (Integral (Remaining m), Monad m, Applicative m) => MonadGet m where 24 | +class (Integral (Remaining m), Fail.MonadFail m, Applicative m) => MonadGet m where 25 | -- | An 'Integral' number type used for unchecked skips and counting. 26 | type Remaining m :: * 27 | 28 | diff --git a/src/Data/Bytes/Serial.hs b/src/Data/Bytes/Serial.hs 29 | index a669f15..b032665 100644 30 | --- a/src/Data/Bytes/Serial.hs 31 | +++ b/src/Data/Bytes/Serial.hs 32 | @@ -594,7 +594,7 @@ instance GSerial U1 where 33 | gdeserialize = return U1 34 | 35 | instance GSerial V1 where 36 | - gserialize _ = fail "I looked into the void." 37 | + gserialize _ = error "I looked into the void." 38 | gdeserialize = fail "I looked into the void." 39 | 40 | instance (GSerial f, GSerial g) => GSerial (f :*: g) where 41 | @@ -772,7 +772,7 @@ instance GSerial1 U1 where 42 | gdeserializeWith _ = return U1 43 | 44 | instance GSerial1 V1 where 45 | - gserializeWith _ = fail "I looked into the void." 46 | + gserializeWith _ = error "I looked into the void." 47 | gdeserializeWith _ = fail "I looked into the void." 48 | 49 | instance (GSerial1 f, GSerial1 g) => GSerial1 (f :*: g) where 50 | -------------------------------------------------------------------------------- /patches/bytestring-mmap-0.2.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap/Lazy.hs bytestring-mmap-0.2.2/System/IO/Posix/MMap/Lazy.hs 2 | --- bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap/Lazy.hs 2011-04-29 15:58:05.000000000 -0400 3 | +++ bytestring-mmap-0.2.2/System/IO/Posix/MMap/Lazy.hs 2018-05-20 14:44:47.123915525 -0400 4 | @@ -91,7 +91,11 @@ 5 | -- 6 | unsafeMMapFile :: FilePath -> IO ByteString 7 | unsafeMMapFile path = do 8 | - fd <- openFd path ReadOnly Nothing defaultFileFlags 9 | + fd <- openFd path ReadOnly 10 | +#if !(MIN_VERSION_unix(2,8,0)) 11 | + Nothing 12 | +#endif 13 | + defaultFileFlags 14 | always (closeFd fd) $ do 15 | stat <- getFdStatus fd 16 | let size = fromIntegral (fileSize stat) 17 | diff -ru bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap.hs bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs 18 | --- bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap.hs 2011-04-29 15:58:05.000000000 -0400 19 | +++ bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs 2018-05-20 14:44:17.671914783 -0400 20 | @@ -1,4 +1,4 @@ 21 | -{-# LANGUAGE ForeignFunctionInterface #-} 22 | +{-# LANGUAGE CPP, ForeignFunctionInterface #-} 23 | -------------------------------------------------------------------- 24 | -- | 25 | -- Module : System.IO.Posix.MMap 26 | @@ -98,7 +98,11 @@ 27 | -- 28 | unsafeMMapFile :: FilePath -> IO ByteString 29 | unsafeMMapFile f = do 30 | - fd <- openFd f ReadOnly Nothing defaultFileFlags 31 | + fd <- openFd f ReadOnly 32 | +#if !(MIN_VERSION_unix(2,8,0)) 33 | + Nothing 34 | +#endif 35 | + defaultFileFlags 36 | always (closeFd fd) $ do 37 | stat <- getFdStatus fd 38 | let size = fromIntegral (fileSize stat) 39 | -------------------------------------------------------------------------------- /patches/cabal-doctest-1.0.6.patch: -------------------------------------------------------------------------------- 1 | commit 79490be79c4ad2e07fc8e43a9887fc21f1907f76 2 | Author: Ryan Scott 3 | Date: Wed Jun 12 18:52:03 2019 -0400 4 | 5 | Allow building with Cabal-3.0.* 6 | 7 | diff --git a/src/Distribution/Extra/Doctest.hs b/src/Distribution/Extra/Doctest.hs 8 | index 1beb9d2..94ca62b 100644 9 | --- a/src/Distribution/Extra/Doctest.hs 10 | +++ b/src/Distribution/Extra/Doctest.hs 11 | @@ -69,8 +69,10 @@ import Distribution.PackageDescription 12 | PackageDescription (), TestSuite (..)) 13 | import Distribution.Simple 14 | (UserHooks (..), autoconfUserHooks, defaultMainWithHooks, simpleUserHooks) 15 | +#if !(MIN_VERSION_Cabal(3,0,0)) 16 | import Distribution.Simple.BuildPaths 17 | (autogenModulesDir) 18 | +#endif 19 | import Distribution.Simple.Compiler 20 | (PackageDB (..), showCompilerId) 21 | import Distribution.Simple.LocalBuildInfo 22 | @@ -79,7 +81,11 @@ import Distribution.Simple.LocalBuildInfo 23 | import Distribution.Simple.Setup 24 | (BuildFlags (buildDistPref, buildVerbosity), HaddockFlags (haddockDistPref, haddockVerbosity), fromFlag, emptyBuildFlags) 25 | import Distribution.Simple.Utils 26 | - (createDirectoryIfMissingVerbose, findFile, rewriteFile) 27 | + (createDirectoryIfMissingVerbose, findFile) 28 | +#if !(MIN_VERSION_Cabal(3,0,0)) 29 | +import Distribution.Simple.Utils 30 | + (rewriteFile) 31 | +#endif 32 | import Distribution.Text 33 | (display, simpleParse) 34 | import System.FilePath 35 | @@ -103,6 +109,9 @@ import Distribution.Types.GenericPackageDescription 36 | import Distribution.PackageDescription 37 | (CondTree (..)) 38 | #endif 39 | +#if MIN_VERSION_Cabal(2,5,0) 40 | +import Distribution.Types.LibraryName (libraryNameString) 41 | +#endif 42 | 43 | #if MIN_VERSION_directory(1,2,2) 44 | import System.Directory 45 | @@ -432,7 +441,9 @@ generateBuildModule testSuiteName flags pkg lbi = do 46 | isSpecific _ = False 47 | 48 | mbLibraryName :: Library -> Name 49 | -#if MIN_VERSION_Cabal(2,0,0) 50 | +#if MIN_VERSION_Cabal(2,5,0) 51 | + mbLibraryName = NameLib . fmap unUnqualComponentName . libraryNameString . libName 52 | +#elif MIN_VERSION_Cabal(2,0,0) 53 | -- Cabal-2.0 introduced internal libraries, which are named. 54 | mbLibraryName = NameLib . fmap unUnqualComponentName . libName 55 | #else 56 | -------------------------------------------------------------------------------- /patches/cassava-0.5.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru cassava-0.5.1.0.orig/Data/Csv/Conversion.hs cassava-0.5.1.0/Data/Csv/Conversion.hs 2 | --- cassava-0.5.1.0.orig/Data/Csv/Conversion.hs 2017-08-12 12:05:04.000000000 -0400 3 | +++ cassava-0.5.1.0/Data/Csv/Conversion.hs 2019-03-15 19:00:40.945760943 -0400 4 | @@ -1188,8 +1188,10 @@ 5 | {-# INLINE (>>) #-} 6 | return = pure 7 | {-# INLINE return #-} 8 | +#if !(MIN_VERSION_base(4,13,0)) 9 | fail = Fail.fail 10 | {-# INLINE fail #-} 11 | +#endif 12 | 13 | -- | @since 0.5.0.0 14 | instance Fail.MonadFail Parser where 15 | -------------------------------------------------------------------------------- /patches/cborg-0.2.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru cborg-0.2.1.0.orig/src/Codec/CBOR/Decoding.hs cborg-0.2.1.0/src/Codec/CBOR/Decoding.hs 2 | --- cborg-0.2.1.0.orig/src/Codec/CBOR/Decoding.hs 2018-10-11 17:10:04.000000000 -0400 3 | +++ cborg-0.2.1.0/src/Codec/CBOR/Decoding.hs 2019-03-16 07:38:16.792667620 -0400 4 | @@ -282,7 +282,9 @@ 5 | {-# INLINE (>>) #-} 6 | (>>) = (*>) 7 | 8 | +#if !(MIN_VERSION_base(4,13,0)) 9 | fail = Fail.fail 10 | +#endif 11 | 12 | -- | @since 0.2.0.0 13 | instance Fail.MonadFail (Decoder s) where 14 | @@ -828,14 +830,14 @@ 15 | decodeListLenCanonicalOf = decodeListLenOfHelper decodeListLenCanonical 16 | {-# INLINE decodeListLenCanonicalOf #-} 17 | 18 | -decodeListLenOfHelper :: (Show a, Eq a, Monad m) => m a -> a -> m () 19 | +decodeListLenOfHelper :: (Show a, Eq a, Fail.MonadFail m) => m a -> a -> m () 20 | decodeListLenOfHelper decodeFun = \len -> do 21 | len' <- decodeFun 22 | if len == len' then return () 23 | else fail $ "expected list of length " ++ show len 24 | {-# INLINE decodeListLenOfHelper #-} 25 | 26 | -decodeWordOfHelper :: (Show a, Eq a, Monad m) => m a -> a -> m () 27 | +decodeWordOfHelper :: (Show a, Eq a, Fail.MonadFail m) => m a -> a -> m () 28 | decodeWordOfHelper decodeFun = \n -> do 29 | n' <- decodeFun 30 | if n == n' then return () 31 | diff -ru cborg-0.2.1.0.orig/src/Codec/CBOR/Pretty.hs cborg-0.2.1.0/src/Codec/CBOR/Pretty.hs 32 | --- cborg-0.2.1.0.orig/src/Codec/CBOR/Pretty.hs 2018-10-11 17:10:04.000000000 -0400 33 | +++ cborg-0.2.1.0/src/Codec/CBOR/Pretty.hs 2019-03-16 07:38:42.156935413 -0400 34 | @@ -103,7 +103,9 @@ 35 | Right (toks', ind', ss', x) -> let PP g' = g x 36 | in g' toks' ind' ss' 37 | return = pure 38 | +#if !(MIN_VERSION_base(4,13,0)) 39 | fail = Fail.fail 40 | +#endif 41 | 42 | instance Fail.MonadFail PP where 43 | fail s = PP $ \_ _ _ -> Left s 44 | -------------------------------------------------------------------------------- /patches/cereal-0.5.8.0.patch: -------------------------------------------------------------------------------- 1 | commit ca728de89116448b59f7baa9082ea2e9c9a5cedb 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 08:45:34 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Data/Serialize/Get.hs b/src/Data/Serialize/Get.hs 8 | index a18a28b..fcda52d 100644 9 | --- a/src/Data/Serialize/Get.hs 10 | +++ b/src/Data/Serialize/Get.hs 11 | @@ -226,8 +226,10 @@ instance Monad Get where 12 | (>>) = (A.*>) 13 | {-# INLINE (>>) #-} 14 | 15 | +#if !(MIN_VERSION_base(4,13,0)) 16 | fail = Fail.fail 17 | {-# INLINE fail #-} 18 | +#endif 19 | 20 | instance Fail.MonadFail Get where 21 | fail = failDesc 22 | -------------------------------------------------------------------------------- /patches/cheapskate-0.1.1.1.cabal: -------------------------------------------------------------------------------- 1 | name: cheapskate 2 | version: 0.1.1.1 3 | x-revision: 1 4 | synopsis: Experimental markdown processor. 5 | description: This is an experimental Markdown processor in pure 6 | Haskell. It aims to process Markdown efficiently and in 7 | the most forgiving possible way. It is designed to deal 8 | with any input, including garbage, with linear 9 | performance. Output is sanitized by default for 10 | protection against XSS attacks. 11 | . 12 | Several markdown extensions are implemented, including 13 | fenced code blocks, significant list start numbers, and 14 | autolinked URLs. See README.markdown for details. 15 | homepage: http://github.com/jgm/cheapskate 16 | license: BSD3 17 | license-file: LICENSE 18 | author: John MacFarlane 19 | maintainer: jgm@berkeley.edu 20 | copyright: (C) 2012-2013 John MacFarlane 21 | category: Text 22 | build-type: Simple 23 | extra-source-files: README.markdown 24 | changelog 25 | man/man1/cheapskate.1 26 | cabal-version: >=1.10 27 | Source-repository head 28 | type: git 29 | location: git://github.com/jgm/cheapskate.git 30 | 31 | Flag dingus 32 | Description: Build cheapskate-dingus cgi script. 33 | Default: False 34 | 35 | library 36 | hs-source-dirs: . 37 | exposed-modules: Cheapskate 38 | Cheapskate.Parse 39 | Cheapskate.Types 40 | Cheapskate.Html 41 | other-modules: Cheapskate.Util 42 | Cheapskate.Inlines 43 | Cheapskate.ParserCombinators 44 | Paths_cheapskate 45 | build-depends: base >=4.6 && <5, 46 | containers >=0.4 && <0.7, 47 | mtl >=2.1 && <2.3, 48 | text >= 0.9 && < 1.3, 49 | blaze-html >=0.6 && < 0.10, 50 | xss-sanitize >= 0.3 && < 0.4, 51 | data-default >= 0.5 && < 0.8, 52 | syb, 53 | uniplate >= 1.6 && < 1.7, 54 | deepseq 55 | default-language: Haskell2010 56 | ghc-options: -Wall -fno-warn-unused-do-bind 57 | 58 | executable cheapskate 59 | main-is: main.hs 60 | hs-source-dirs: bin 61 | build-depends: base >=4.4 && <5, 62 | cheapskate, 63 | bytestring, 64 | blaze-html >=0.6 && < 0.10, 65 | text >= 0.9 && < 1.3 66 | default-language: Haskell2010 67 | ghc-options: -Wall -fno-warn-unused-do-bind 68 | 69 | executable cheapskate-dingus 70 | main-is: cheapskate-dingus.hs 71 | hs-source-dirs: bin 72 | if flag(dingus) 73 | build-depends: base, aeson, cheapskate, blaze-html, 74 | text, wai-extra, wai >= 0.3, http-types 75 | default-language: Haskell2010 76 | if flag(dingus) 77 | Buildable: True 78 | else 79 | Buildable: False 80 | ghc-options: -Wall -fno-warn-unused-do-bind 81 | -------------------------------------------------------------------------------- /patches/cheapskate-0.1.1.1.patch: -------------------------------------------------------------------------------- 1 | commit e0686e310c948fbcbde9e64421563c91a42dc0b3 2 | Author: Ryan Scott 3 | Date: Fri Apr 19 09:25:00 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Cheapskate/ParserCombinators.hs b/Cheapskate/ParserCombinators.hs 8 | index d60699d..77efb09 100644 9 | --- a/Cheapskate/ParserCombinators.hs 10 | +++ b/Cheapskate/ParserCombinators.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | module Cheapskate.ParserCombinators ( 14 | Position(..) 15 | , Parser 16 | @@ -35,6 +36,7 @@ import Prelude hiding (takeWhile) 17 | import Data.Text (Text) 18 | import qualified Data.Text as T 19 | import Control.Monad 20 | +import qualified Control.Monad.Fail as Fail 21 | import Control.Applicative 22 | import qualified Data.Set as Set 23 | 24 | @@ -109,7 +111,9 @@ instance Alternative Parser where 25 | 26 | instance Monad Parser where 27 | return x = Parser $ \st -> Right (st, x) 28 | - fail e = Parser $ \st -> Left $ ParseError (position st) e 29 | +#if !(MIN_VERSION_base(4,13,0)) 30 | + fail = Fail.fail 31 | +#endif 32 | p >>= g = Parser $ \st -> 33 | case evalParser p st of 34 | Left e -> Left e 35 | @@ -117,6 +121,9 @@ instance Monad Parser where 36 | {-# INLINE return #-} 37 | {-# INLINE (>>=) #-} 38 | 39 | +instance Fail.MonadFail Parser where 40 | + fail e = Parser $ \st -> Left $ ParseError (position st) e 41 | + 42 | instance MonadPlus Parser where 43 | mzero = Parser $ \st -> Left $ ParseError (position st) "(mzero)" 44 | mplus p1 p2 = Parser $ \st -> 45 | -------------------------------------------------------------------------------- /patches/control-monad-omega-0.3.1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Control/Monad/Omega.hs b/Control/Monad/Omega.hs 2 | index a9e14e4..ec16ba8 100644 3 | --- a/Control/Monad/Omega.hs 4 | +++ b/Control/Monad/Omega.hs 5 | @@ -1,3 +1,4 @@ 6 | +{-# LANGUAGE CPP #-} 7 | ---------------------------------------------- 8 | -- | 9 | -- Module : Control.Monad.Omega 10 | @@ -45,6 +46,8 @@ import qualified Control.Applicative as Applicative 11 | import qualified Data.Foldable as Foldable 12 | import qualified Data.Traversable as Traversable 13 | 14 | +import qualified Control.Monad.Fail as Fail 15 | + 16 | -- | This is the hinge algorithm of the Omega monad, 17 | -- exposed because it can be useful on its own. Joins 18 | -- a list of lists with the property that for every i j 19 | @@ -72,6 +75,12 @@ instance Functor Omega where 20 | instance Monad Omega where 21 | return x = Omega [x] 22 | Omega m >>= f = Omega $ diagonal $ map (runOmega . f) m 23 | + 24 | +#if !(MIN_VERSION_base(4,13,0)) 25 | + fail = Fail.fail 26 | +#endif 27 | + 28 | +instance Fail.MonadFail Omega where 29 | fail _ = Omega [] 30 | 31 | instance Monad.MonadPlus Omega where 32 | diff --git a/control-monad-omega.cabal b/control-monad-omega.cabal 33 | index a04ab5f..65e56cf 100644 34 | --- a/control-monad-omega.cabal 35 | +++ b/control-monad-omega.cabal 36 | @@ -1,3 +1,4 @@ 37 | +cabal-version: 1.12 38 | Name: control-monad-omega 39 | Description: 40 | A monad for enumerating sets: like the list 41 | @@ -11,5 +12,25 @@ Homepage: http://github.com/luqui/control-monad-omega 42 | Author: Luke Palmer 43 | Maintainer: lrpalmer@gmail.com 44 | Build-Type: Simple 45 | -Build-Depends: base <= 5 46 | -Exposed-Modules: Control.Monad.Omega 47 | +Tested-With: 48 | + GHC ==7.0.4 49 | + || ==7.2.2 50 | + || ==7.4.2 51 | + || ==7.6.3 52 | + || ==7.8.4 53 | + || ==7.10.3 54 | + || ==8.0.2 55 | + || ==8.2.2 56 | + || ==8.4.4 57 | + || ==8.6.5 58 | + || ==8.8.1 59 | + 60 | +library 61 | + Default-Language: Haskell2010 62 | + Build-Depends: base >=4.3 && <5 63 | + Exposed-Modules: Control.Monad.Omega 64 | + Other-Extensions: CPP 65 | + 66 | + if !impl(ghc >= 8.0) 67 | + build-depends: 68 | + fail >= 4.9.0.0 && <5 69 | -------------------------------------------------------------------------------- /patches/cql-4.0.1.patch: -------------------------------------------------------------------------------- 1 | commit 1138d062235185f05d76d3ce701662c0d22ab345 2 | Author: Ryan Scott 3 | Date: Sat Dec 29 22:22:52 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/src/Database/CQL/Protocol/Record.hs b/src/Database/CQL/Protocol/Record.hs 8 | index c69e454..d4ad7f2 100644 9 | --- a/src/Database/CQL/Protocol/Record.hs 10 | +++ b/src/Database/CQL/Protocol/Record.hs 11 | @@ -13,8 +13,10 @@ import Language.Haskell.TH 12 | typeSynDecl :: Name -> [Type] -> Type -> Dec 13 | #if __GLASGOW_HASKELL__ < 708 14 | typeSynDecl = TySynInstD 15 | -#else 16 | +#elif __GLASGOW_HASKELL__ < 807 17 | typeSynDecl x y z = TySynInstD x (TySynEqn y z) 18 | +#else 19 | +typeSynDecl x y z = TySynInstD (TySynEqn Nothing (foldl AppT (ConT x) y) z) 20 | #endif 21 | 22 | type family TupleType a 23 | -------------------------------------------------------------------------------- /patches/critbit-0.2.0.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru critbit-0.2.0.0.orig/Data/CritBit/Set.hs critbit-0.2.0.0/Data/CritBit/Set.hs 2 | --- critbit-0.2.0.0.orig/Data/CritBit/Set.hs 2014-07-04 01:40:10.000000000 -0400 3 | +++ critbit-0.2.0.0/Data/CritBit/Set.hs 2018-01-07 18:44:32.747084107 -0500 4 | @@ -1,3 +1,4 @@ 5 | +{-# LANGUAGE CPP #-} 6 | {-# OPTIONS_GHC -fno-warn-orphans #-} 7 | 8 | -- | 9 | @@ -90,6 +91,9 @@ 10 | import Data.Foldable (Foldable, foldMap) 11 | import Data.Maybe (isJust) 12 | import Data.Monoid (Monoid(..)) 13 | +#if MIN_VERSION_base(4,9,0) 14 | +import Data.Semigroup (Semigroup(..)) 15 | +#endif 16 | import Prelude hiding (null, filter, map, foldl, foldr) 17 | import qualified Data.CritBit.Tree as T 18 | import qualified Data.List as List 19 | @@ -97,9 +101,16 @@ 20 | instance (Show a) => Show (Set a) where 21 | show s = "fromList " ++ show (toList s) 22 | 23 | +#if MIN_VERSION_base(4,9,0) 24 | +instance CritBitKey k => Semigroup (Set k) where 25 | + (<>) = union 26 | +#endif 27 | + 28 | instance CritBitKey k => Monoid (Set k) where 29 | mempty = empty 30 | +#if !(MIN_VERSION_base(4,11,0)) 31 | mappend = union 32 | +#endif 33 | mconcat = unions 34 | 35 | instance Foldable Set where 36 | diff -ru critbit-0.2.0.0.orig/Data/CritBit/Tree.hs critbit-0.2.0.0/Data/CritBit/Tree.hs 37 | --- critbit-0.2.0.0.orig/Data/CritBit/Tree.hs 2014-07-04 01:40:10.000000000 -0400 38 | +++ critbit-0.2.0.0/Data/CritBit/Tree.hs 2018-01-07 18:43:26.219082431 -0500 39 | @@ -1,4 +1,4 @@ 40 | -{-# LANGUAGE BangPatterns, RecordWildCards, ScopedTypeVariables #-} 41 | +{-# LANGUAGE CPP, BangPatterns, RecordWildCards, ScopedTypeVariables #-} 42 | {-# OPTIONS_GHC -fno-warn-orphans #-} 43 | 44 | -- | 45 | @@ -153,21 +153,31 @@ 46 | import Data.CritBit.Types.Internal 47 | import Data.Maybe (fromMaybe) 48 | import Data.Monoid (Monoid(..)) 49 | +#if MIN_VERSION_base(4,9,0) 50 | +import Data.Semigroup (Semigroup(..)) 51 | +#endif 52 | import Data.Traversable (Traversable(traverse)) 53 | import Prelude hiding (foldl, foldr, lookup, null, map, filter) 54 | import qualified Data.Array as A 55 | import qualified Data.Foldable as Foldable 56 | import qualified Data.List as List 57 | 58 | +#if MIN_VERSION_base(4,9,0) 59 | +instance CritBitKey k => Semigroup (CritBit k v) where 60 | + (<>) = union 61 | +#endif 62 | + 63 | instance CritBitKey k => Monoid (CritBit k v) where 64 | mempty = empty 65 | +#if !(MIN_VERSION_base(4,11,0)) 66 | mappend = union 67 | +#endif 68 | mconcat = unions 69 | 70 | instance CritBitKey k => Traversable (CritBit k) where 71 | traverse f m = traverseWithKey (\_ v -> f v) m 72 | 73 | -infixl 9 !, \\ 74 | +infixl 9 !, \\ -- Comment needed here to avoid CPP bug 75 | 76 | -- | /O(k)/. Find the value at a key. 77 | -- Calls 'error' when the element can not be found. 78 | @@ -1248,8 +1258,7 @@ 79 | -- > deleteFindMin Error: can not return the minimal element of an empty map 80 | deleteFindMin :: CritBit k v -> ((k, v), CritBit k v) 81 | deleteFindMin = fromMaybe (error msg) . minViewWithKey 82 | - where msg = "CritBit.deleteFindMin: cannot return the minimal \ 83 | - \element of an empty map" 84 | + where msg = "CritBit.deleteFindMin: cannot return the minimal element of an empty map" 85 | {-# INLINABLE deleteFindMin #-} 86 | 87 | -- | /O(k)/. Delete and find the maximal element. 88 | @@ -1258,8 +1267,7 @@ 89 | -- > deleteFindMax Error: can not return the maximal element of an empty map 90 | deleteFindMax :: CritBit k v -> ((k, v), CritBit k v) 91 | deleteFindMax = fromMaybe (error msg) . maxViewWithKey 92 | - where msg = "CritBit.deleteFindMax: cannot return the minimal \ 93 | - \element of an empty map" 94 | + where msg = "CritBit.deleteFindMax: cannot return the minimal element of an empty map" 95 | {-# INLINABLE deleteFindMax #-} 96 | 97 | -- | /O(k')/. Retrieves the value associated with minimal key of the 98 | -------------------------------------------------------------------------------- /patches/crypto-random-0.0.9.patch: -------------------------------------------------------------------------------- 1 | diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0.0.9/Crypto/Random/Entropy/Unix.hs 2 | --- crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs 2015-03-18 09:42:48.000000000 -0400 3 | +++ crypto-random-0.0.9/Crypto/Random/Entropy/Unix.hs 2018-05-07 10:10:49.039215536 -0400 4 | @@ -5,6 +5,7 @@ 5 | -- Stability : experimental 6 | -- Portability : Good 7 | -- 8 | +{-# LANGUAGE CPP #-} 9 | {-# LANGUAGE ScopedTypeVariables #-} 10 | module Crypto.Random.Entropy.Unix 11 | ( DevRandom 12 | @@ -22,10 +23,10 @@ 13 | type H = Fd 14 | type DeviceName = String 15 | 16 | --- | Entropy device /dev/random on unix system 17 | +-- | Entropy device /dev/random on unix system 18 | newtype DevRandom = DevRandom DeviceName 19 | 20 | --- | Entropy device /dev/urandom on unix system 21 | +-- | Entropy device /dev/urandom on unix system 22 | newtype DevURandom = DevURandom DeviceName 23 | 24 | instance EntropySource DevRandom where 25 | @@ -48,7 +49,11 @@ 26 | Just h -> closeDev h >> return (Just filepath) 27 | 28 | openDev :: String -> IO (Maybe H) 29 | -openDev filepath = (Just `fmap` openFd filepath ReadOnly Nothing fileFlags) 30 | +openDev filepath = (Just `fmap` openFd filepath ReadOnly 31 | +#if !(MIN_VERSION_unix(2,8,0)) 32 | + Nothing 33 | +#endif 34 | + fileFlags) 35 | `E.catch` \(_ :: IOException) -> return Nothing 36 | where fileFlags = defaultFileFlags { nonBlock = True } 37 | 38 | -------------------------------------------------------------------------------- /patches/diagrams-lib-1.4.2.3.patch: -------------------------------------------------------------------------------- 1 | commit f0e35c783b2d29604a7c5fd8687087dab05d78ca 2 | Author: Ryan Scott 3 | Date: Sat Mar 16 08:12:15 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Diagrams/Backend/CmdLine.hs b/src/Diagrams/Backend/CmdLine.hs 8 | index 1b57a26..230785f 100644 9 | --- a/src/Diagrams/Backend/CmdLine.hs 10 | +++ b/src/Diagrams/Backend/CmdLine.hs 11 | @@ -83,6 +83,7 @@ import Options.Applicative 12 | import Options.Applicative.Types (readerAsk) 13 | 14 | import Control.Monad (forM_, forever, unless, when) 15 | +import qualified Control.Monad.Fail as Fail 16 | 17 | import Data.Active hiding (interval) 18 | import Data.Char (isDigit) 19 | @@ -304,7 +305,7 @@ instance Parseable (AlphaColour Double) where 20 | -- example, @\"0xfc4\"@ is the same as @\"0xffcc44\"@. When eight or six 21 | -- digits are given each pair of digits is a color or alpha channel with the 22 | -- order being red, green, blue, alpha. 23 | -readHexColor :: (Applicative m, Monad m) => String -> m (AlphaColour Double) 24 | +readHexColor :: (Applicative m, Fail.MonadFail m) => String -> m (AlphaColour Double) 25 | readHexColor cs = case cs of 26 | ('0':'x':hs) -> handle hs 27 | ('#':hs) -> handle hs 28 | -------------------------------------------------------------------------------- /patches/diagrams-svg-1.4.2.cabal: -------------------------------------------------------------------------------- 1 | Name: diagrams-svg 2 | Version: 1.4.2 3 | x-revision: 2 4 | Synopsis: SVG backend for diagrams drawing EDSL. 5 | Homepage: http://projects.haskell.org/diagrams/ 6 | License: BSD3 7 | License-file: LICENSE 8 | Extra-source-files: README.md, CHANGELOG.md 9 | Author: Felipe Lessa, Deepak Jois 10 | Maintainer: diagrams-discuss@googlegroups.com 11 | Bug-reports: http://github.com/diagrams/diagrams-svg/issues 12 | Stability: Experimental 13 | Category: Graphics 14 | Build-type: Simple 15 | Cabal-version: >=1.10 16 | Tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1 17 | Description: This package provides a modular backend for rendering 18 | diagrams created with the diagrams EDSL to SVG 19 | files. It uses @lucid-svg@ to be a native 20 | Haskell backend, making it suitable for use on 21 | any platform. 22 | . 23 | The package provides the following modules: 24 | . 25 | * "Diagrams.Backend.SVG.CmdLine" - if you're 26 | just getting started with diagrams, begin here. 27 | . 28 | * "Diagrams.Backend.SVG" - look at this next. 29 | The general API for the SVG backend. 30 | . 31 | Additional documentation can be found in the 32 | README file distributed with the source tarball or 33 | viewable on GitHub: 34 | . 35 | Source-repository head 36 | type: git 37 | location: http://github.com/diagrams/diagrams-svg 38 | 39 | Library 40 | Exposed-modules: Diagrams.Backend.SVG 41 | Diagrams.Backend.SVG.CmdLine 42 | Other-modules: Graphics.Rendering.SVG 43 | Hs-source-dirs: src 44 | Build-depends: base >= 4.3 && < 4.13 45 | , filepath 46 | , mtl >= 1 && < 2.3 47 | , bytestring >= 0.9 && < 1.0 48 | , base64-bytestring >= 1 && < 1.1 49 | , colour 50 | , diagrams-core >= 1.4 && < 1.5 51 | , diagrams-lib >= 1.4 && < 1.5 52 | , monoid-extras >= 0.3 && < 0.6 53 | , svg-builder >= 0.1 && < 0.2 54 | , text >= 0.11 && < 1.3 55 | , JuicyPixels >= 3.1.5 && < 3.4 56 | , split >= 0.1.2 && < 0.3 57 | , containers >= 0.3 && < 0.7 58 | , lens >= 4.0 && < 4.18 59 | , hashable >= 1.1 && < 1.3 60 | , optparse-applicative >= 0.13 && < 0.15 61 | , semigroups >= 0.13 && < 0.19 62 | if impl(ghc < 7.6) 63 | build-depends: ghc-prim 64 | 65 | Ghc-options: -Wall 66 | 67 | Default-language: Haskell2010 68 | -------------------------------------------------------------------------------- /patches/diagrams-svg-1.4.2.patch: -------------------------------------------------------------------------------- 1 | commit 4e55e467d7785067f6eab6db76d03b6ee44e9da0 2 | Author: Ryan Scott 3 | Date: Sat Mar 16 08:15:29 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Diagrams/Backend/SVG.hs b/src/Diagrams/Backend/SVG.hs 8 | index 96d292c..66c7f54 100644 9 | --- a/src/Diagrams/Backend/SVG.hs 10 | +++ b/src/Diagrams/Backend/SVG.hs 11 | @@ -397,7 +397,7 @@ instance SVGFloat n => Renderable (DImage n (Native Img)) SVG where 12 | mime <- case t of 13 | 'J' -> return "image/jpeg" 14 | 'P' -> return "image/png" 15 | - _ -> fail "Unknown mime type while rendering image" 16 | + _ -> error "Unknown mime type while rendering image" 17 | return $ R.renderDImage di $ R.dataUri mime d 18 | 19 | instance Hashable n => Hashable (Options SVG V2 n) where 20 | -------------------------------------------------------------------------------- /patches/dlist-0.8.0.6.patch: -------------------------------------------------------------------------------- 1 | commit 7942c5ca3e28d2a546e5d351ded87f454655a58c 2 | Author: Ryan Scott 3 | Date: Fri Mar 29 13:57:16 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Data/DList.hs b/Data/DList.hs 8 | index 06f1ce8..27a016e 100644 9 | --- a/Data/DList.hs 10 | +++ b/Data/DList.hs 11 | @@ -65,6 +65,7 @@ import Prelude hiding (concat, foldr, map, head, tail, replicate) 12 | import qualified Data.List as List 13 | import Control.DeepSeq (NFData(..)) 14 | import Control.Monad as M 15 | +import qualified Control.Monad.Fail as Fail 16 | import Data.Function (on) 17 | import Data.String (IsString(..)) 18 | 19 | @@ -278,6 +279,12 @@ instance Monad DList where 20 | return = pure 21 | {-# INLINE return #-} 22 | 23 | +#if !(MIN_VERSION_base(4,13,0)) 24 | + fail = Fail.fail 25 | + {-# INLINE fail #-} 26 | +#endif 27 | + 28 | +instance Fail.MonadFail DList where 29 | fail _ = empty 30 | {-# INLINE fail #-} 31 | 32 | -------------------------------------------------------------------------------- /patches/equivalence-0.3.4.patch: -------------------------------------------------------------------------------- 1 | commit 779b484beeeba9e6c7229da672da9be5d618dc5d 2 | Author: Ryan Scott 3 | Date: Fri Apr 19 15:31:27 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Data/Equivalence/STT.hs b/src/Data/Equivalence/STT.hs 8 | index 77cb9c2..c3a41c7 100644 9 | --- a/src/Data/Equivalence/STT.hs 10 | +++ b/src/Data/Equivalence/STT.hs 11 | @@ -264,7 +264,7 @@ equateEntry Equiv {combDesc = mkDesc} repx@(Entry rx) repy@(Entry ry) = 12 | writeSTRef ry dy{entryWeight = wx + wy, entryDesc = mkDesc chx chy} 13 | return repy 14 | 15 | - _ -> fail "error on `equateEntry`" 16 | + _ -> error "error on `equateEntry`" 17 | else return repx 18 | 19 | combineEntries :: (Monad m, Applicative m, Ord a) 20 | -------------------------------------------------------------------------------- /patches/filelock-0.1.1.3.patch: -------------------------------------------------------------------------------- 1 | diff -ru filelock-0.1.1.3.orig/System/FileLock/Internal/Flock.hsc filelock-0.1.1.3/System/FileLock/Internal/Flock.hsc 2 | --- filelock-0.1.1.3.orig/System/FileLock/Internal/Flock.hsc 2001-09-08 21:46:40.000000000 -0400 3 | +++ filelock-0.1.1.3/System/FileLock/Internal/Flock.hsc 2019-05-11 09:09:15.690243173 -0400 4 | @@ -12,7 +12,11 @@ 5 | import Foreign.C.Error 6 | import Foreign.C.Types 7 | import System.Posix.Files 8 | -import System.Posix.IO (openFd, closeFd, defaultFileFlags, OpenMode(..), setFdOption, FdOption(..)) 9 | +import System.Posix.IO ( openFd, closeFd, defaultFileFlags, OpenMode(..), setFdOption, FdOption(..) 10 | +#if MIN_VERSION_unix(2,8,0) 11 | + , creat 12 | +#endif 13 | + ) 14 | import System.Posix.Types 15 | import Prelude 16 | 17 | @@ -39,7 +43,12 @@ 18 | 19 | open :: FilePath -> IO Fd 20 | open path = do 21 | - fd <- openFd path WriteOnly (Just stdFileMode) defaultFileFlags 22 | + fd <- openFd path WriteOnly 23 | +#if MIN_VERSION_unix(2,8,0) 24 | + (defaultFileFlags {creat = Just stdFileMode}) 25 | +#else 26 | + (Just stdFileMode) defaultFileFlags 27 | +#endif 28 | -- Ideally, we would open the file descriptor with CLOEXEC enabled, but since 29 | -- unix 2.8 hasn't been released yet and we want backwards compatibility with 30 | -- older releases, we set CLOEXEC after opening the file descriptor. This 31 | -------------------------------------------------------------------------------- /patches/fmlist-0.9.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru fmlist-0.9.2.orig/Data/FMList.hs fmlist-0.9.2/Data/FMList.hs 2 | --- fmlist-0.9.2.orig/Data/FMList.hs 2018-01-07 07:28:57.000000000 -0500 3 | +++ fmlist-0.9.2/Data/FMList.hs 2019-03-15 14:43:52.225024755 -0400 4 | @@ -97,6 +97,7 @@ 5 | import Data.Foldable (Foldable, foldMap, foldr, toList) 6 | import Data.Traversable (Traversable, traverse) 7 | import Control.Monad 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Applicative 10 | 11 | -- | 'FMList' is a 'foldMap' function wrapped up in a newtype. 12 | @@ -293,6 +294,11 @@ 13 | return = one 14 | m >>= g = transform (\f -> foldMap f . g) m 15 | m >> k = transform (\f -> const (foldMap f k)) m 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | + fail = Fail.fail 18 | +#endif 19 | + 20 | +instance Fail.MonadFail FMList where 21 | fail _ = nil 22 | 23 | instance Applicative FMList where 24 | -------------------------------------------------------------------------------- /patches/foundation-0.0.23.patch: -------------------------------------------------------------------------------- 1 | diff -ru foundation-0.0.23.orig/Foundation/Check/Main.hs foundation-0.0.23/Foundation/Check/Main.hs 2 | --- foundation-0.0.23.orig/Foundation/Check/Main.hs 2019-01-09 06:14:46.000000000 -0500 3 | +++ foundation-0.0.23/Foundation/Check/Main.hs 2019-03-16 09:27:57.337439071 -0400 4 | @@ -5,6 +5,7 @@ 5 | -- 6 | -- An application to check that integrate with the .cabal test-suite 7 | -- 8 | +{-# LANGUAGE CPP #-} 9 | {-# LANGUAGE ExistentialQuantification #-} 10 | {-# LANGUAGE Rank2Types #-} 11 | {-# LANGUAGE GADTs #-} 12 | @@ -179,11 +180,14 @@ 13 | test (CheckPlan name plan) = do 14 | testCheckPlan name plan 15 | test (Property name prop) = do 16 | - r'@(PropertyResult _ nb r) <- testProperty name (property prop) 17 | - case r of 18 | - PropertySuccess -> whenVerbose $ displayPropertySucceed name nb 19 | - PropertyFailed w -> whenErrorOnly $ displayPropertyFailed name nb w 20 | - return r' 21 | + r' <- testProperty name (property prop) 22 | + case r' of 23 | + PropertyResult _ nb r -> do 24 | + case r of 25 | + PropertySuccess -> whenVerbose $ displayPropertySucceed name nb 26 | + PropertyFailed w -> whenErrorOnly $ displayPropertyFailed name nb w 27 | + return r' 28 | + _ -> error "Not a PropertyResult" 29 | 30 | displayCurrent :: String -> CheckMain () 31 | displayCurrent name = do 32 | diff -ru foundation-0.0.23.orig/Foundation/Monad/Except.hs foundation-0.0.23/Foundation/Monad/Except.hs 33 | --- foundation-0.0.23.orig/Foundation/Monad/Except.hs 2019-01-09 06:14:46.000000000 -0500 34 | +++ foundation-0.0.23/Foundation/Monad/Except.hs 2019-03-16 09:24:14.275704819 -0400 35 | @@ -1,3 +1,4 @@ 36 | +{-# LANGUAGE CPP #-} 37 | {-# LANGUAGE TypeFamilies #-} 38 | {-# LANGUAGE ConstraintKinds #-} 39 | {-# LANGUAGE OverloadedStrings #-} 40 | @@ -38,7 +39,9 @@ 41 | case a of 42 | Left e -> return (Left e) 43 | Right x -> runExceptT (k x) 44 | +#if !(MIN_VERSION_base(4,13,0)) 45 | fail = ExceptT . fail 46 | +#endif 47 | 48 | instance (AMPMonad m, MonadFix m) => MonadFix (ExceptT e m) where 49 | mfix f = ExceptT (mfix (runExceptT . f . fromEither)) 50 | diff -ru foundation-0.0.23.orig/Foundation/Network/IPv6.hs foundation-0.0.23/Foundation/Network/IPv6.hs 51 | --- foundation-0.0.23.orig/Foundation/Network/IPv6.hs 2019-01-09 06:14:46.000000000 -0500 52 | +++ foundation-0.0.23/Foundation/Network/IPv6.hs 2019-03-16 09:32:07.559381867 -0400 53 | @@ -207,15 +207,18 @@ 54 | let (CountOf lenBs1) = length bs1 55 | bs2 <- repeat (Between $ 0 `And` (fromIntegral $ 6 - lenBs1)) $ takeAWord16 <* skipColon 56 | _ <- optional skipColon 57 | - [i1,i2,i3,i4,i5,i6] <- format 6 bs1 bs2 58 | - m1 <- takeAWord8 <* skipDot 59 | - m2 <- takeAWord8 <* skipDot 60 | - m3 <- takeAWord8 <* skipDot 61 | - m4 <- takeAWord8 62 | - return $ fromTuple ( i1,i2,i3,i4,i5,i6 63 | - , m1 `shiftL` 8 .|. m2 64 | - , m3 `shiftL` 8 .|. m4 65 | - ) 66 | + r <- format 6 bs1 bs2 67 | + case r of 68 | + [i1,i2,i3,i4,i5,i6] -> do 69 | + m1 <- takeAWord8 <* skipDot 70 | + m2 <- takeAWord8 <* skipDot 71 | + m3 <- takeAWord8 <* skipDot 72 | + m4 <- takeAWord8 73 | + return $ fromTuple ( i1,i2,i3,i4,i5,i6 74 | + , m1 `shiftL` 8 .|. m2 75 | + , m3 `shiftL` 8 .|. m4 76 | + ) 77 | + _ -> error "Not a six-element list" 78 | 79 | -- | IPv6 parser as described in RFC4291 section 2.2.2 80 | -- 81 | @@ -236,12 +239,15 @@ 82 | let (CountOf bs1Len) = length bs1 83 | bs2 <- repeat (Between $ 0 `And` fromIntegral (8 - bs1Len)) $ 84 | skipColon *> takeAWord16 85 | - [i1,i2,i3,i4,i5,i6,i7,i8] <- format 8 bs1 bs2 86 | - return $ fromTuple (i1,i2,i3,i4,i5,i6,i7,i8) 87 | + r <- format 8 bs1 bs2 88 | + case r of 89 | + [i1,i2,i3,i4,i5,i6,i7,i8] -> 90 | + return $ fromTuple (i1,i2,i3,i4,i5,i6,i7,i8) 91 | + _ -> error "Not an eight-element list" 92 | 93 | format :: (Integral a, Monad m) => CountOf a -> [a] -> [a] -> m [a] 94 | format sz bs1 bs2 95 | - | sz <= (length bs1 + length bs2) = fail "invalid compressed IPv6 addressed" 96 | + | sz <= (length bs1 + length bs2) = error "invalid compressed IPv6 addressed" 97 | | otherwise = do 98 | let len = sz `sizeSub` (length bs1 + length bs2) 99 | return $ bs1 <> replicate len 0 <> bs2 100 | @@ -262,4 +268,4 @@ 101 | let lhs = readHex l 102 | in case lhs of 103 | [(w, [])] -> return w 104 | - _ -> fail "can't fall here" 105 | + _ -> error "can't fall here" 106 | -------------------------------------------------------------------------------- /patches/generic-lens-1.1.0.0.patch: -------------------------------------------------------------------------------- 1 | commit 07cfab73b53324a8459148a61b37e92c002e9b37 2 | Author: Ryan Scott 3 | Date: Fri May 17 13:30:53 2019 -0400 4 | 5 | Fix https://github.com/kcsongor/generic-lens/issues/84 6 | 7 | diff --git a/src/Data/Generics/Product/Any.hs b/src/Data/Generics/Product/Any.hs 8 | index cc90fc0..e78bcf9 100644 9 | --- a/src/Data/Generics/Product/Any.hs 10 | +++ b/src/Data/Generics/Product/Any.hs 11 | @@ -53,7 +53,7 @@ import Data.Generics.Product.Typed 12 | -- human = Human "Tunyasz" 50 "London" 13 | -- :} 14 | 15 | -class HasAny (sel :: k) s t a b | s sel k -> a where 16 | +class HasAny sel s t a b | s sel -> a where 17 | -- |A lens that focuses on a part of a product as identified by some 18 | -- selector. Currently supported selectors are field names, positions and 19 | -- unique types. Compatible with the lens package's 'Control.Lens.Lens' 20 | diff --git a/src/Data/Generics/Sum/Any.hs b/src/Data/Generics/Sum/Any.hs 21 | index cefb67a..478ef5b 100644 22 | --- a/src/Data/Generics/Sum/Any.hs 23 | +++ b/src/Data/Generics/Sum/Any.hs 24 | @@ -61,7 +61,7 @@ import Data.Generics.Internal.VL.Prism 25 | -- :} 26 | 27 | -- |Sums that have generic prisms. 28 | -class AsAny (sel :: k) a s | s sel k -> a where 29 | +class AsAny sel a s | s sel -> a where 30 | -- |A prism that projects a sum as identified by some selector. Currently 31 | -- supported selectors are constructor names and unique types. Compatible 32 | -- with the lens package's 'Control.Lens.Prism' type. 33 | -------------------------------------------------------------------------------- /patches/ghc-paths-0.1.0.9.patch: -------------------------------------------------------------------------------- 1 | Only in ghc-paths-0.1.0.9/: ghc-paths.buildinfo 2 | diff -ru ghc-paths-0.1.0.9.orig/Setup.hs ghc-paths-0.1.0.9/Setup.hs 3 | --- ghc-paths-0.1.0.9.orig/Setup.hs 2012-12-03 07:00:02.000000000 -0500 4 | +++ ghc-paths-0.1.0.9/Setup.hs 2019-06-26 10:55:50.814321566 -0400 5 | @@ -26,7 +26,7 @@ 6 | where 7 | defaultPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () 8 | defaultPostConf args flags pkgdescr lbi = do 9 | - libdir_ <- rawSystemProgramStdoutConf (fromFlag (configVerbosity flags)) 10 | + libdir_ <- getDbProgramOutput (fromFlag (configVerbosity flags)) 11 | ghcProgram (withPrograms lbi) ["--print-libdir"] 12 | let libdir = reverse $ dropWhile isSpace $ reverse libdir_ 13 | 14 | -------------------------------------------------------------------------------- /patches/hackage-security-0.5.3.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru hackage-security-0.5.3.0.orig/src/Hackage/Security/TUF/FileMap.hs hackage-security-0.5.3.0/src/Hackage/Security/TUF/FileMap.hs 2 | --- hackage-security-0.5.3.0.orig/src/Hackage/Security/TUF/FileMap.hs 2018-03-25 19:39:07.000000000 -0400 3 | +++ hackage-security-0.5.3.0/src/Hackage/Security/TUF/FileMap.hs 2019-03-16 08:29:08.347456951 -0400 4 | @@ -78,7 +78,7 @@ 5 | lookupM :: Monad m => FileMap -> TargetPath -> m FileInfo 6 | lookupM m fp = 7 | case lookup fp m of 8 | - Nothing -> fail $ "No entry for " ++ pretty fp ++ " in filemap" 9 | + Nothing -> error $ "No entry for " ++ pretty fp ++ " in filemap" 10 | Just nfo -> return nfo 11 | 12 | {------------------------------------------------------------------------------- 13 | -------------------------------------------------------------------------------- /patches/happy-1.19.11.patch: -------------------------------------------------------------------------------- 1 | diff -ru happy-1.19.11.orig/Setup.lhs happy-1.19.11/Setup.lhs 2 | --- happy-1.19.11.orig/Setup.lhs 2019-06-06 03:20:45.000000000 -0400 3 | +++ happy-1.19.11/Setup.lhs 2019-06-13 07:19:11.018577108 -0400 4 | @@ -45,7 +45,7 @@ 5 | _ -> [] 6 | 7 | myPostBuild _ flags _ lbi = do 8 | - let runProgram p = rawSystemProgramConf (fromFlagOrDefault normal (buildVerbosity flags)) 9 | + let runProgram p = runDbProgram (fromFlagOrDefault normal (buildVerbosity flags)) 10 | p 11 | (withPrograms lbi) 12 | cpp_template src dst opts = do 13 | -------------------------------------------------------------------------------- /patches/haskell-src-exts-1.21.0.patch: -------------------------------------------------------------------------------- 1 | commit 5479772132ee206696b8ae2fc67e5bd8587dd0ba 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 14:55:28 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Language/Haskell/Exts/ExactPrint.hs b/src/Language/Haskell/Exts/ExactPrint.hs 8 | index 394b858..0d1666a 100644 9 | --- a/src/Language/Haskell/Exts/ExactPrint.hs 10 | +++ b/src/Language/Haskell/Exts/ExactPrint.hs 11 | @@ -129,7 +129,7 @@ printStringAt :: Pos -> String -> EP () 12 | printStringAt p str = printWhitespace p >> printString str 13 | 14 | errorEP :: String -> EP a 15 | -errorEP = fail 16 | +errorEP = error 17 | 18 | ------------------------------------------------------------------------------ 19 | -- Printing of source elements 20 | diff --git a/src/Language/Haskell/Exts/Fixity.hs b/src/Language/Haskell/Exts/Fixity.hs 21 | index 56be8bf..332625d 100644 22 | --- a/src/Language/Haskell/Exts/Fixity.hs 23 | +++ b/src/Language/Haskell/Exts/Fixity.hs 24 | @@ -39,6 +39,7 @@ import Language.Haskell.Exts.Syntax 25 | import Language.Haskell.Exts.SrcLoc 26 | 27 | import Control.Monad (when, (<=<), liftM, liftM2, liftM3, liftM4) 28 | +import qualified Control.Monad.Fail as Fail 29 | import Data.Traversable (mapM) 30 | import Data.Maybe (fromMaybe) 31 | import Data.Typeable 32 | @@ -59,7 +60,7 @@ class AppFixity ast where 33 | -- | Tweak any expressions in the element to account for the 34 | -- fixities given. Assumes that all operator expressions are 35 | -- fully left associative chains to begin with. 36 | - applyFixities :: Monad m => [Fixity] -- ^ The fixities to account for. 37 | + applyFixities :: Fail.MonadFail m => [Fixity] -- ^ The fixities to account for. 38 | -> ast SrcSpanInfo -- ^ The element to tweak. 39 | -> m (ast SrcSpanInfo) -- ^ The same element, but with operator expressions updated, or a failure. 40 | 41 | @@ -241,7 +242,7 @@ instance AppFixity PatternSynDirection where 42 | _ -> return dir 43 | where fix x = applyFixities fixs x 44 | 45 | -appFixDecls :: Monad m => Maybe (ModuleName SrcSpanInfo) -> [Fixity] -> [Decl SrcSpanInfo] -> m [Decl SrcSpanInfo] 46 | +appFixDecls :: Fail.MonadFail m => Maybe (ModuleName SrcSpanInfo) -> [Fixity] -> [Decl SrcSpanInfo] -> m [Decl SrcSpanInfo] 47 | appFixDecls mmdl fixs decls = 48 | let extraFixs = getFixities mmdl decls 49 | in mapM (applyFixities (fixs++extraFixs)) decls 50 | @@ -379,7 +380,7 @@ instance AppFixity XAttr where 51 | -- Recursively fixes the "leaves" of the infix chains, 52 | -- without yet touching the chain itself. We assume all chains are 53 | -- left-associate to begin with. 54 | -leafFix :: Monad m => [Fixity] -> Exp SrcSpanInfo -> m (Exp SrcSpanInfo) 55 | +leafFix :: Fail.MonadFail m => [Fixity] -> Exp SrcSpanInfo -> m (Exp SrcSpanInfo) 56 | leafFix fixs e' = case e' of 57 | InfixApp l e1 op e2 -> liftM2 (flip (InfixApp l) op) (leafFix fixs e1) (fix e2) 58 | App l e1 e2 -> liftM2 (App l) (fix e1) (fix e2) 59 | @@ -427,7 +428,7 @@ leafFix fixs e' = case e' of 60 | where 61 | fix x = applyFixities fixs x 62 | 63 | -leafFixP :: Monad m => [Fixity] -> Pat SrcSpanInfo -> m (Pat SrcSpanInfo) 64 | +leafFixP :: Fail.MonadFail m => [Fixity] -> Pat SrcSpanInfo -> m (Pat SrcSpanInfo) 65 | leafFixP fixs p' = case p' of 66 | PInfixApp l p1 op p2 -> liftM2 (flip (PInfixApp l) op) (leafFixP fixs p1) (fix p2) 67 | PApp l n ps -> liftM (PApp l n) $ mapM fix ps 68 | diff --git a/src/Language/Haskell/Exts/ParseMonad.hs b/src/Language/Haskell/Exts/ParseMonad.hs 69 | index 09a55c0..da95ea6 100644 70 | --- a/src/Language/Haskell/Exts/ParseMonad.hs 71 | +++ b/src/Language/Haskell/Exts/ParseMonad.hs 72 | @@ -1,3 +1,4 @@ 73 | +{-# LANGUAGE CPP #-} 74 | {-# OPTIONS_HADDOCK hide #-} 75 | ----------------------------------------------------------------------------- 76 | -- | 77 | @@ -96,7 +97,9 @@ instance Applicative ParseResult where 78 | 79 | instance Monad ParseResult where 80 | return = ParseOk 81 | +#if !(MIN_VERSION_base(4,13,0)) 82 | fail = Fail.fail 83 | +#endif 84 | ParseOk x >>= f = f x 85 | ParseFailed loc msg >>= _ = ParseFailed loc msg 86 | instance Fail.MonadFail ParseResult where 87 | @@ -246,7 +249,9 @@ instance Monad P where 88 | case m i x y l ch s mode of 89 | Failed loc msg -> Failed loc msg 90 | Ok s' a -> runP (k a) i x y l ch s' mode 91 | +#if !(MIN_VERSION_base(4,13,0)) 92 | fail = Fail.fail 93 | +#endif 94 | 95 | instance Fail.MonadFail P where 96 | fail s = P $ \_r _col _line loc _ _stk _m -> Failed loc s 97 | @@ -354,7 +359,9 @@ instance Monad (Lex r) where 98 | return a = Lex $ \k -> k a 99 | Lex v >>= f = Lex $ \k -> v (\a -> runL (f a) k) 100 | Lex v >> Lex w = Lex $ \k -> v (\_ -> w k) 101 | +#if !(MIN_VERSION_base(4,13,0)) 102 | fail = Fail.fail 103 | +#endif 104 | 105 | instance Fail.MonadFail (Lex r) where 106 | fail s = Lex $ \_ -> fail s 107 | -------------------------------------------------------------------------------- /patches/hedgehog-1.0.cabal: -------------------------------------------------------------------------------- 1 | version: 1.0 2 | x-revision: 1 3 | 4 | name: 5 | hedgehog 6 | author: 7 | Jacob Stanley 8 | maintainer: 9 | Jacob Stanley 10 | homepage: 11 | https://hedgehog.qa 12 | bug-reports: 13 | https://github.com/hedgehogqa/haskell-hedgehog/issues 14 | synopsis: 15 | Release with confidence. 16 | description: 17 | automatically generates a comprehensive array 18 | of test cases, exercising your software in ways human testers would never 19 | imagine. 20 | . 21 | Generate hundreds of test cases automatically, exposing even the 22 | most insidious of corner cases. Failures are automatically simplified, giving 23 | developers coherent, intelligible error messages. 24 | . 25 | To get started quickly, see the . 26 | category: 27 | Testing 28 | license: 29 | BSD3 30 | license-file: 31 | LICENSE 32 | cabal-version: 33 | >= 1.8 34 | build-type: 35 | Simple 36 | tested-with: 37 | GHC == 8.0.2 38 | , GHC == 8.2.2 39 | , GHC == 8.4.4 40 | , GHC == 8.6.4 41 | extra-source-files: 42 | README.md 43 | CHANGELOG.md 44 | 45 | source-repository head 46 | type: git 47 | location: git://github.com/hedgehogqa/haskell-hedgehog.git 48 | 49 | library 50 | build-depends: 51 | -- GHC 8.0.1 / base-4.9.0.0 (May 2016) 52 | base >= 4.9 && < 5 53 | , ansi-terminal >= 0.6 && < 0.10 54 | , async >= 2.0 && < 2.3 55 | , bytestring >= 0.10 && < 0.11 56 | , concurrent-output >= 1.7 && < 1.11 57 | , containers >= 0.4 && < 0.7 58 | , directory >= 1.2 && < 1.4 59 | , exceptions >= 0.7 && < 0.11 60 | , fail >= 4.9 && < 5 61 | , lifted-async >= 0.7 && < 0.11 62 | , mmorph >= 1.0 && < 1.2 63 | , monad-control >= 1.0 && < 1.1 64 | , mtl >= 2.1 && < 2.3 65 | , pretty-show >= 1.6 && < 1.10 66 | , primitive >= 0.6 && < 0.7 67 | , random >= 1.1 && < 1.2 68 | , resourcet >= 1.1 && < 1.3 69 | , semigroups >= 0.16 && < 0.20 70 | , stm >= 2.4 && < 2.6 71 | , template-haskell >= 2.10 && < 2.15 72 | , text >= 1.1 && < 1.3 73 | , time >= 1.4 && < 1.10 74 | , transformers >= 0.5 && < 0.6 75 | , transformers-base >= 0.4.5.1 && < 0.5 76 | , wl-pprint-annotated >= 0.0 && < 0.2 77 | 78 | ghc-options: 79 | -Wall 80 | 81 | if impl(ghc >= 8.0) 82 | ghc-options: -Wnoncanonical-monad-instances 83 | 84 | hs-source-dirs: 85 | src 86 | 87 | exposed-modules: 88 | Hedgehog 89 | Hedgehog.Gen 90 | Hedgehog.Main 91 | Hedgehog.Range 92 | 93 | Hedgehog.Internal.Config 94 | Hedgehog.Internal.Discovery 95 | Hedgehog.Internal.Distributive 96 | Hedgehog.Internal.Exception 97 | Hedgehog.Internal.Gen 98 | Hedgehog.Internal.HTraversable 99 | Hedgehog.Internal.Opaque 100 | Hedgehog.Internal.Property 101 | Hedgehog.Internal.Queue 102 | Hedgehog.Internal.Range 103 | Hedgehog.Internal.Region 104 | Hedgehog.Internal.Report 105 | Hedgehog.Internal.Runner 106 | Hedgehog.Internal.Seed 107 | Hedgehog.Internal.Show 108 | Hedgehog.Internal.Shrink 109 | Hedgehog.Internal.Source 110 | Hedgehog.Internal.State 111 | Hedgehog.Internal.TH 112 | Hedgehog.Internal.Tree 113 | Hedgehog.Internal.Tripping 114 | 115 | test-suite test 116 | type: 117 | exitcode-stdio-1.0 118 | 119 | main-is: 120 | test.hs 121 | 122 | ghc-options: 123 | -Wall -threaded -O2 124 | 125 | hs-source-dirs: 126 | test 127 | 128 | other-modules: 129 | Test.Hedgehog.Applicative 130 | Test.Hedgehog.Filter 131 | Test.Hedgehog.Seed 132 | Test.Hedgehog.Text 133 | Test.Hedgehog.Zip 134 | 135 | build-depends: 136 | hedgehog 137 | , base >= 3 && < 5 138 | , containers >= 0.4 && < 0.7 139 | , mmorph >= 1.0 && < 1.2 140 | , mtl >= 2.1 && < 2.3 141 | , pretty-show >= 1.6 && < 1.10 142 | , semigroups >= 0.16 && < 0.20 143 | , text >= 1.1 && < 1.3 144 | , transformers >= 0.3 && < 0.6 145 | -------------------------------------------------------------------------------- /patches/hedgehog-1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru hedgehog-1.0.orig/src/Hedgehog/Internal/Gen.hs hedgehog-1.0/src/Hedgehog/Internal/Gen.hs 2 | --- hedgehog-1.0.orig/src/Hedgehog/Internal/Gen.hs 2019-05-13 05:52:05.000000000 -0400 3 | +++ hedgehog-1.0/src/Hedgehog/Internal/Gen.hs 2019-05-17 13:26:15.191782408 -0400 4 | @@ -1,5 +1,6 @@ 5 | {-# OPTIONS_HADDOCK not-home #-} 6 | {-# LANGUAGE ApplicativeDo #-} 7 | +{-# LANGUAGE CPP #-} 8 | {-# LANGUAGE DataKinds #-} 9 | {-# LANGUAGE DeriveFoldable #-} 10 | {-# LANGUAGE DeriveFunctor #-} 11 | @@ -486,8 +487,10 @@ 12 | runGenT size sk . k =<< 13 | runGenT size sm m 14 | 15 | +#if !(MIN_VERSION_base(4,13,0)) 16 | fail = 17 | Fail.fail 18 | +#endif 19 | 20 | instance Monad m => MonadFail (GenT m) where 21 | fail = 22 | -------------------------------------------------------------------------------- /patches/hsc2hs-0.68.4.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: >=1.10 2 | Name: hsc2hs 3 | Version: 0.68.4 4 | x-revision: 1 5 | 6 | Copyright: 2000, Marcin Kowalczyk 7 | License: BSD3 8 | License-File: LICENSE 9 | Author: Marcin Kowalczyk 10 | Maintainer: ghc-devs@haskell.org 11 | Synopsis: A preprocessor that helps with writing Haskell bindings to C code 12 | Bug-Reports: https://github.com/haskell/hsc2hs/issues 13 | Description: 14 | The hsc2hs program can be used to automate some parts of the 15 | process of writing Haskell bindings to C code. It reads an 16 | almost-Haskell source file with embedded special constructs, and 17 | outputs a real Haskell file with these constructs processed, based 18 | on information taken from some C headers. The extra constructs 19 | provide Haskell counterparts of C types, values of C constants, 20 | including sizes of C types, and access to fields of C structs. 21 | . 22 | For more details, see the 23 | 24 | in the GHC User's Guide. 25 | Category: Development 26 | Data-Files: template-hsc.h 27 | build-type: Simple 28 | tested-with: GHC==8.6.1, GHC==8.4.3, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 29 | 30 | extra-source-files: 31 | changelog.md 32 | test/asm/*.s 33 | 34 | flag in-ghc-tree 35 | description: Are we in a GHC tree? 36 | default: False 37 | manual: True 38 | 39 | source-repository head 40 | Type: git 41 | Location: https://github.com/haskell/hsc2hs.git 42 | 43 | Executable hsc2hs 44 | Default-Language: Haskell2010 45 | Main-Is: Main.hs 46 | Other-Modules: 47 | C 48 | Common 49 | CrossCodegen 50 | DirectCodegen 51 | Flags 52 | HSCParser 53 | ATTParser 54 | UtilsCodegen 55 | Paths_hsc2hs 56 | 57 | Other-Extensions: CPP, NoMonomorphismRestriction 58 | 59 | Build-Depends: base >= 4.12 && < 5, 60 | containers >= 0.4.0 && < 0.7, 61 | directory >= 1.1.0 && < 1.4, 62 | filepath >= 1.2.0 && < 1.5, 63 | process >= 1.1.0 && < 1.7 64 | if flag(in-ghc-tree) 65 | cpp-options: -DIN_GHC_TREE 66 | 67 | test-suite spec 68 | main-is: Spec.hs 69 | hs-source-dirs: . 70 | other-modules: ATTParser 71 | ghc-options: -Wall -threaded 72 | type: exitcode-stdio-1.0 73 | build-depends: base 74 | , tasty 75 | , tasty-hspec 76 | default-language: Haskell2010 77 | -------------------------------------------------------------------------------- /patches/hsc2hs-0.68.4.patch: -------------------------------------------------------------------------------- 1 | From 6324184483b20233a67cb9b26c59e751738c57c7 Mon Sep 17 00:00:00 2001 2 | From: Herbert Valerio Riedel 3 | Date: Tue, 18 Dec 2018 23:03:58 +0100 4 | Subject: [PATCH] MonadFail forward-compat 5 | 6 | It turns out that the `fail` method was unused to begin with. 7 | --- 8 | HSCParser.hs | 6 ++++-- 9 | 1 file changed, 4 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/HSCParser.hs b/HSCParser.hs 12 | index b2ef799..d855cf1 100644 13 | --- a/HSCParser.hs 14 | +++ b/HSCParser.hs 15 | @@ -38,14 +38,16 @@ instance Monad Parser where 16 | Success pos'' (out1++out2) imp'' b 17 | Failure pos'' msg -> Failure pos'' msg 18 | Failure pos' msg -> Failure pos' msg 19 | - fail msg = Parser $ \pos _ -> Failure pos msg 20 | + 21 | +failp :: String -> Parser a 22 | +failp msg = Parser $ \pos _ -> Failure pos msg 23 | 24 | instance Alternative Parser where 25 | empty = mzero 26 | (<|>) = mplus 27 | 28 | instance MonadPlus Parser where 29 | - mzero = fail "mzero" 30 | + mzero = failp "mzero" 31 | Parser m `mplus` Parser n = 32 | Parser $ \pos s -> case m pos s of 33 | success@(Success _ _ _ _) -> success 34 | -------------------------------------------------------------------------------- /patches/hxt-9.3.1.16.patch: -------------------------------------------------------------------------------- 1 | diff -ru hxt-9.3.1.16.orig/src/Text/XML/HXT/Arrow/Pickle/Xml.hs hxt-9.3.1.16/src/Text/XML/HXT/Arrow/Pickle/Xml.hs 2 | --- hxt-9.3.1.16.orig/src/Text/XML/HXT/Arrow/Pickle/Xml.hs 2016-08-10 03:55:56.000000000 -0400 3 | +++ hxt-9.3.1.16/src/Text/XML/HXT/Arrow/Pickle/Xml.hs 2019-03-15 15:07:12.856241363 -0400 4 | @@ -65,6 +65,7 @@ 5 | import Control.Monad.Error (MonadError (..)) 6 | #endif 7 | 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.State (MonadState (..), gets, 10 | modify) 11 | 12 | @@ -141,8 +142,12 @@ 13 | case r of 14 | Left err -> (Left err, st') 15 | Right v -> runUP (f v) st' 16 | - fail = throwMsg -- don't use fail, use throwError 17 | +#if !(MIN_VERSION_base(4,13,0)) 18 | + fail = Fail.fail 19 | +#endif 20 | 21 | +instance Fail.MonadFail Unpickler where 22 | + fail = throwMsg -- don't use fail, use throwError 23 | 24 | instance MonadState St Unpickler where 25 | get = UP $ \ st -> (Right st, st) 26 | -------------------------------------------------------------------------------- /patches/inline-c-0.7.0.1.patch: -------------------------------------------------------------------------------- 1 | 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 2 | --- inline-c-0.7.0.1.orig/src/Language/C/Inline/Internal.hs 2018-12-16 18:08:10.000000000 -0500 3 | +++ inline-c-0.7.0.1/src/Language/C/Inline/Internal.hs 2019-05-17 16:26:24.310528911 -0400 4 | @@ -54,6 +54,7 @@ 5 | 6 | import Control.Applicative 7 | import Control.Monad (forM, void, msum) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.State (evalStateT, StateT, get, put) 10 | import Control.Monad.Trans.Class (lift) 11 | import Data.Foldable (forM_) 12 | @@ -523,7 +524,7 @@ 13 | -- The @m@ is polymorphic because we use this both for the plain 14 | -- parser and the StateT parser we use above. We only need 'fail'. 15 | purgeHaskellIdentifiers 16 | - :: forall n. (Applicative n, Monad n) 17 | + :: forall n. (Applicative n, Fail.MonadFail n) 18 | => C.Type HaskellIdentifier -> n (C.Type C.CIdentifier) 19 | purgeHaskellIdentifiers cTy = for cTy $ \hsIdent -> do 20 | let hsIdentS = unHaskellIdentifier hsIdent 21 | @@ -539,9 +540,9 @@ 22 | -> TH.QuasiQuoter 23 | quoteCode p = TH.QuasiQuoter 24 | { TH.quoteExp = p 25 | - , TH.quotePat = fail "inline-c: quotePat not implemented (quoteCode)" 26 | - , TH.quoteType = fail "inline-c: quoteType not implemented (quoteCode)" 27 | - , TH.quoteDec = fail "inline-c: quoteDec not implemented (quoteCode)" 28 | + , TH.quotePat = \_ -> fail "inline-c: quotePat not implemented (quoteCode)" 29 | + , TH.quoteType = \_ -> fail "inline-c: quoteType not implemented (quoteCode)" 30 | + , TH.quoteDec = \_ -> fail "inline-c: quoteDec not implemented (quoteCode)" 31 | } 32 | 33 | genericQuote 34 | 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 35 | --- inline-c-0.7.0.1.orig/src/Language/C/Types/Parse.hs 2018-05-01 05:44:49.000000000 -0400 36 | +++ inline-c-0.7.0.1/src/Language/C/Types/Parse.hs 2019-05-17 16:25:08.465693889 -0400 37 | @@ -88,6 +88,7 @@ 38 | 39 | import Control.Applicative 40 | import Control.Monad (msum, void, MonadPlus, unless, when) 41 | +import qualified Control.Monad.Fail as Fail 42 | import Control.Monad.Reader (MonadReader, runReaderT, ReaderT, asks, ask) 43 | import Data.Functor.Identity (Identity) 44 | import qualified Data.HashSet as HashSet 45 | @@ -166,7 +167,7 @@ 46 | -- referring to Haskell variables, and thus we need to parse Haskell 47 | -- identifiers in certain positions. 48 | type CParser i m = 49 | - ( Monad m 50 | + ( Fail.MonadFail m 51 | , Functor m 52 | , Applicative m 53 | , MonadPlus m 54 | -------------------------------------------------------------------------------- /patches/io-choice-0.0.7.patch: -------------------------------------------------------------------------------- 1 | commit 19f47a59a2c1ff72f218757de6c822e5134f2df9 2 | Author: Ryan Scott 3 | Date: Tue Dec 11 10:43:06 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/Control/Exception/IOChoice/THUtil.hs b/Control/Exception/IOChoice/THUtil.hs 8 | index b316527..68c8731 100644 9 | --- a/Control/Exception/IOChoice/THUtil.hs 10 | +++ b/Control/Exception/IOChoice/THUtil.hs 11 | @@ -24,8 +24,13 @@ checkSupported exc = do 12 | #if __GLASGOW_HASKELL__ >= 800 13 | DataD _ name [] _ _ _ -> conT name 14 | NewtypeD _ name [] _ _ _ -> conT name 15 | +# if MIN_VERSION_template_haskell(2,15,0) 16 | + DataInstD _ _ nameArgs _ _ _ -> return nameArgs 17 | + NewtypeInstD _ _ nameArgs _ _ _ -> return nameArgs 18 | +# else 19 | DataInstD _ name args _ _ _ -> foldl1 appT (conT name:map return args) 20 | NewtypeInstD _ name args _ _ _ -> foldl1 appT (conT name:map return args) 21 | +# endif 22 | #else 23 | DataD _ name [] _ _ -> conT name 24 | NewtypeD _ name [] _ _ -> conT name 25 | @@ -34,7 +39,11 @@ checkSupported exc = do 26 | #endif 27 | TySynD name [] _ -> conT name 28 | #if __GLASGOW_HASKELL__ >= 707 29 | +# if MIN_VERSION_template_haskell(2,15,0) 30 | + TySynInstD (TySynEqn _ nameArgs _) -> return nameArgs 31 | +# else 32 | TySynInstD name (TySynEqn args _) -> foldl1 appT (conT name:map return args) 33 | +# endif 34 | #else 35 | TySynInstD name args _ -> foldl1 appT (conT name:map return args) 36 | #endif 37 | -------------------------------------------------------------------------------- /patches/kind-generics-th-0.1.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru kind-generics-th-0.1.1.0.orig/src/Generics/Kind/TH.hs kind-generics-th-0.1.1.0/src/Generics/Kind/TH.hs 2 | --- kind-generics-th-0.1.1.0.orig/src/Generics/Kind/TH.hs 2019-04-30 04:39:19.000000000 -0400 3 | +++ kind-generics-th-0.1.1.0/src/Generics/Kind/TH.hs 2019-05-11 08:47:16.451331266 -0400 4 | @@ -1,3 +1,4 @@ 5 | +{-# language CPP #-} 6 | {-# language ExplicitNamespaces #-} 7 | {-# language MultiWayIf #-} 8 | {-# language TemplateHaskellQuotes #-} 9 | @@ -84,7 +85,12 @@ 10 | (conT ''GenericK `appT` dataApp `appT` 11 | foldr (\x y -> infixT x '(:&&:) y) 12 | (promotedT 'LoT0) (map varT argNamesToDrop)) 13 | - [ tySynInstD ''RepK $ tySynEqn [dataApp] $ 14 | + [ 15 | +#if MIN_VERSION_template_haskell(2,15,0) 16 | + tySynInstD $ tySynEqn Nothing (conT ''RepK `appT` dataApp) $ 17 | +#else 18 | + tySynInstD ''RepK $ tySynEqn [dataApp] $ 19 | +#endif 20 | deriveRepK dataName argNamesToDrop variant cons' 21 | , deriveFromK cons' 22 | , deriveToK cons' 23 | -------------------------------------------------------------------------------- /patches/language-c-0.8.2.cabal: -------------------------------------------------------------------------------- 1 | Name: language-c 2 | Version: 0.8.2 3 | x-revision: 1 4 | Cabal-Version: >= 1.8 5 | Build-Type: Simple 6 | License: BSD3 7 | License-File: LICENSE 8 | Copyright: LICENSE 9 | Author: AUTHORS 10 | Maintainer: benedikt.huber@gmail.com 11 | Stability: experimental 12 | Homepage: http://visq.github.io/language-c/ 13 | Bug-reports: https://github.com/visq/language-c/issues/ 14 | 15 | Synopsis: Analysis and generation of C code 16 | Description: Language C is a haskell library for the analysis and generation of C code. 17 | It features a complete, well tested parser and pretty printer for all of C99 and a large 18 | set of C11 and clang/GNU extensions. 19 | Category: Language 20 | Tested-With: GHC == 7.8.*, GHC == 7.10.*, GHC == 8.0.*, GHC == 8.2.1 21 | 22 | Extra-Source-Files: AUTHORS AUTHORS.c2hs ChangeLog README 23 | src/Language/C/Parser/Lexer.x 24 | src/Language/C/Parser/Parser.y 25 | 26 | Source-Repository head 27 | type: git 28 | location: https://github.com/visq/language-c.git 29 | 30 | Flag useByteStrings 31 | Description: Use ByteString as InputStream datatype 32 | Default: True 33 | Flag separateSYB 34 | description: Data.Generics available in separate package. 35 | Flag allWarnings 36 | Description: Turn on all warnings for building (development) 37 | Default: False 38 | Flag iecFpExtension 39 | Description: Support IEC 60559 floating point extension (defines _Float128) 40 | Default: True 41 | Library 42 | Extensions: CPP, DeriveDataTypeable, DeriveGeneric, PatternGuards, BangPatterns, ExistentialQuantification, GeneralizedNewtypeDeriving, ScopedTypeVariables 43 | Build-Depends: base >= 3 && < 5, 44 | array, 45 | containers >= 0.3, 46 | deepseq >= 1.4.0.0 && < 1.5, 47 | directory, 48 | filepath, 49 | pretty < 1.2.0, 50 | process 51 | if flag(allWarnings) 52 | if impl(ghc >= 8.0) 53 | ghc-options: -Wall -Wno-redundant-constraints 54 | else 55 | ghc-options: -Wall 56 | 57 | If flag(separateSYB) 58 | Build-Depends: 59 | base >=4.7 && <5, 60 | syb 61 | Else 62 | Build-Depends: 63 | base <4 64 | 65 | if flag(useByteStrings) 66 | Build-Depends: bytestring >= 0.9.0 67 | else 68 | cpp-options: -DNO_BYTESTRING 69 | 70 | if flag(iecFpExtension) 71 | cpp-options: -DIEC_60559_TYPES_EXT 72 | 73 | -- GHC.Generics lived in `ghc-prim` for GHC 7.2 & GHC 7.4 74 | if impl(ghc == 7.4.*) 75 | build-depends: ghc-prim == 0.2.* 76 | 77 | Build-Tools: happy, alex 78 | 79 | Hs-Source-Dirs: src 80 | Exposed-Modules: 81 | -- top-level 82 | Language.C 83 | -- data 84 | Language.C.Data 85 | Language.C.Data.Position 86 | Language.C.Data.Ident 87 | Language.C.Data.Error 88 | Language.C.Data.Name 89 | Language.C.Data.Node 90 | Language.C.Data.InputStream 91 | -- syntax 92 | Language.C.Syntax 93 | Language.C.Syntax.AST 94 | Language.C.Syntax.Constants 95 | Language.C.Syntax.Ops 96 | Language.C.Syntax.Utils 97 | -- parser 98 | Language.C.Parser 99 | -- pretty printer 100 | Language.C.Pretty 101 | -- system 102 | Language.C.System.Preprocess 103 | Language.C.System.GCC 104 | -- analysis [experimental] 105 | Language.C.Analysis 106 | Language.C.Analysis.ConstEval 107 | Language.C.Analysis.Builtins 108 | Language.C.Analysis.SemError 109 | Language.C.Analysis.SemRep 110 | Language.C.Analysis.DefTable 111 | Language.C.Analysis.TravMonad 112 | Language.C.Analysis.AstAnalysis 113 | Language.C.Analysis.DeclAnalysis 114 | Language.C.Analysis.Debug 115 | Language.C.Analysis.TypeCheck 116 | Language.C.Analysis.TypeConversions 117 | Language.C.Analysis.TypeUtils 118 | Language.C.Analysis.NameSpaceMap 119 | -- semrep -> code [alpha] 120 | Language.C.Analysis.Export 121 | Other-Modules: 122 | Language.C.Data.RList 123 | -- parser implementation 124 | Language.C.Parser.Builtin 125 | Language.C.Parser.Lexer 126 | Language.C.Parser.ParserMonad 127 | Language.C.Parser.Tokens 128 | Language.C.Parser.Parser 129 | 130 | -- test description 131 | Test-Suite language-c-harness 132 | type: exitcode-stdio-1.0 133 | main-is: test/harness/run-harness.hs 134 | build-depends: base, language-c, directory, process, filepath 135 | -------------------------------------------------------------------------------- /patches/language-c-0.8.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru language-c-0.8.2.orig/src/Language/C/Parser/ParserMonad.hs language-c-0.8.2/src/Language/C/Parser/ParserMonad.hs 2 | --- language-c-0.8.2.orig/src/Language/C/Parser/ParserMonad.hs 2018-09-19 00:21:29.000000000 -0400 3 | +++ language-c-0.8.2/src/Language/C/Parser/ParserMonad.hs 2019-04-19 16:43:53.153364757 -0400 4 | @@ -48,6 +48,7 @@ 5 | 6 | import Control.Applicative (Applicative(..)) 7 | import Control.Monad (liftM, ap) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Data.Set (Set) 10 | import qualified Data.Set as Set (fromList, insert, member, delete) 11 | 12 | @@ -82,8 +83,13 @@ 13 | instance Monad P where 14 | return = returnP 15 | (>>=) = thenP 16 | - fail m = getPos >>= \pos -> failP pos [m] 17 | +#if !(MIN_VERSION_base(4,13,0)) 18 | + fail = Fail.fail 19 | +#endif 20 | 21 | +instance Fail.MonadFail P where 22 | + fail m = getPos >>= \pos -> failP pos [m] 23 | + 24 | 25 | -- | execute the given parser on the supplied input stream. 26 | -- returns 'ParseError' if the parser failed, and a pair of 27 | -------------------------------------------------------------------------------- /patches/memory-0.14.18.patch: -------------------------------------------------------------------------------- 1 | commit d4241481d32fec2466a1a15572c1a65ea6ff1aca 2 | Author: Ryan Scott 3 | Date: Sat Mar 16 09:04:38 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Data/ByteArray/Parse.hs b/Data/ByteArray/Parse.hs 8 | index 10b7c06..b0235a8 100644 9 | --- a/Data/ByteArray/Parse.hs 10 | +++ b/Data/ByteArray/Parse.hs 11 | @@ -12,6 +12,7 @@ 12 | -- > > parse ((,,) <$> take 2 <*> byte 0x20 <*> (bytes "abc" *> anyByte)) "xx abctest" 13 | -- > ParseOK "est" ("xx", 116) 14 | -- 15 | +{-# LANGUAGE CPP #-} 16 | {-# LANGUAGE Rank2Types #-} 17 | {-# LANGUAGE BangPatterns #-} 18 | {-# LANGUAGE OverloadedStrings #-} 19 | @@ -36,6 +37,7 @@ module Data.ByteArray.Parse 20 | ) where 21 | 22 | import Control.Monad 23 | +import qualified Control.Monad.Fail as Fail 24 | import Foreign.Storable (Storable, peek, sizeOf) 25 | import Data.Word 26 | 27 | @@ -84,10 +86,14 @@ instance Applicative (Parser byteArray) where 28 | pure = return 29 | (<*>) d e = d >>= \b -> e >>= \a -> return (b a) 30 | instance Monad (Parser byteArray) where 31 | - fail errorMsg = Parser $ \buf err _ -> err buf ("Parser failed: " ++ errorMsg) 32 | +#if !(MIN_VERSION_base(4,13,0)) 33 | + fail = Fail.fail 34 | +#endif 35 | return v = Parser $ \buf _ ok -> ok buf v 36 | m >>= k = Parser $ \buf err ok -> 37 | runParser m buf err (\buf' a -> runParser (k a) buf' err ok) 38 | +instance Fail.MonadFail (Parser byteArray) where 39 | + fail errorMsg = Parser $ \buf err _ -> err buf ("Parser failed: " ++ errorMsg) 40 | instance MonadPlus (Parser byteArray) where 41 | mzero = fail "MonadPlus.mzero" 42 | mplus f g = Parser $ \buf err ok -> 43 | -------------------------------------------------------------------------------- /patches/microlens-0.4.10.patch: -------------------------------------------------------------------------------- 1 | diff -ru microlens-0.4.10.orig/src/Lens/Micro.hs microlens-0.4.10/src/Lens/Micro.hs 2 | --- microlens-0.4.10.orig/src/Lens/Micro.hs 2018-11-03 07:51:53.000000000 -0400 3 | +++ microlens-0.4.10/src/Lens/Micro.hs 2019-03-15 08:50:17.657663130 -0400 4 | @@ -1413,8 +1413,10 @@ 5 | ~(a, s') <- runStateT m s 6 | runStateT (k a) s' 7 | {-# INLINE (>>=) #-} 8 | +#if !(MIN_VERSION_base(4,13,0)) 9 | fail str = StateT $ \ _ -> fail str 10 | {-# INLINE fail #-} 11 | +#endif 12 | 13 | #if MIN_VERSION_base(4,9,0) 14 | instance (Fail.MonadFail m) => Fail.MonadFail (StateT s m) where 15 | -------------------------------------------------------------------------------- /patches/monadplus-1.4.2.patch: -------------------------------------------------------------------------------- 1 | From 63978a11cc1a512e564237e83060e9aa29ebce73 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Andr=C3=A9s=20Sicard-Ram=C3=ADrez?= 3 | Date: Sun, 7 Jan 2018 23:52:32 -0500 4 | Subject: [PATCH] Added Semigroup instance. 5 | 6 | The instance was required by GHC 8.4.1-alpha1. 7 | --- 8 | src/Control/Monad/Plus.hs | 9 ++++++--- 9 | 1 file changed, 6 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/src/Control/Monad/Plus.hs b/src/Control/Monad/Plus.hs 12 | index 25f4782..654d133 100644 13 | --- a/src/Control/Monad/Plus.hs 14 | +++ b/src/Control/Monad/Plus.hs 15 | @@ -1,5 +1,5 @@ 16 | 17 | -{-# LANGUAGE DeriveFunctor, DeriveFoldable, GeneralizedNewtypeDeriving #-} 18 | +{-# LANGUAGE CPP, DeriveFunctor, DeriveFoldable, GeneralizedNewtypeDeriving #-} 19 | 20 | ------------------------------------------------------------------------------------- 21 | -- | 22 | @@ -263,6 +263,9 @@ instance Category Partial where 23 | 24 | instance Monoid (Partial a b) where 25 | mempty = mzero 26 | +#if !MIN_VERSION_base(4,11,0) 27 | mappend = mplus 28 | - 29 | - 30 | +#else 31 | +instance Semigroup (Partial a b) where 32 | + (<>) = mappend 33 | +#endif 34 | -------------------------------------------------------------------------------- /patches/optparse-applicative-0.14.3.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru optparse-applicative-0.14.3.0.orig/Options/Applicative/Types.hs optparse-applicative-0.14.3.0/Options/Applicative/Types.hs 2 | --- optparse-applicative-0.14.3.0.orig/Options/Applicative/Types.hs 2018-10-03 21:20:14.000000000 -0400 3 | +++ optparse-applicative-0.14.3.0/Options/Applicative/Types.hs 2019-03-15 10:37:16.505610173 -0400 4 | @@ -1,4 +1,4 @@ 5 | -{-# LANGUAGE Rank2Types, ExistentialQuantification #-} 6 | +{-# LANGUAGE CPP, Rank2Types, ExistentialQuantification #-} 7 | module Options.Applicative.Types ( 8 | ParseError(..), 9 | ParserInfo(..), 10 | @@ -175,7 +175,9 @@ 11 | instance Monad ReadM where 12 | return = pure 13 | ReadM r >>= f = ReadM $ r >>= unReadM . f 14 | +#if !(MIN_VERSION_base(4,13,0)) 15 | fail = Fail.fail 16 | +#endif 17 | 18 | instance Fail.MonadFail ReadM where 19 | fail = readerError 20 | -------------------------------------------------------------------------------- /patches/packman-0.5.0.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cbits/Pack.c b/cbits/Pack.c 2 | index 2c73161e..27007c2a 100644 3 | --- a/cbits/Pack.c 4 | +++ b/cbits/Pack.c 5 | @@ -56,7 +56,13 @@ 6 | #define true rtsTrue 7 | #define false rtsFalse 8 | #endif 9 | - 10 | +// the story goes on 11 | +#if __GLASGOW_HASKELL__ >= 806 12 | +#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 13 | +#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 14 | +#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY 15 | +#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN 16 | +#endif 17 | 18 | #ifdef DEBUG 19 | #define DBG_HEADROOM 1 20 | @@ -529,7 +535,7 @@ getClosureInfo(StgClosure* node, StgInfoTable* info, 21 | 22 | // We remove the potential tag before doing anything. 23 | node = UNTAG_CLOSURE(node); 24 | - 25 | + 26 | if (info == NULL) { 27 | // Supposed to compute info table by ourselves. This will go very wrong 28 | // if we use an info _offset_ instead (if we are supposed to look at a 29 | @@ -930,7 +936,7 @@ loop: 30 | case CONSTR_NOCAF: 31 | 32 | // While it should be OK to execute the code below in older 33 | - // GHCs, the new type is not, and we separate it to make 34 | + // GHCs, the new type is not, and we separate it to make 35 | // differences apparent. 36 | 37 | if (!HEAP_ALLOCED(closure)) { 38 | @@ -1082,7 +1088,7 @@ loop: 39 | // In GUM, we would globalise and pack a FetchMe. 40 | #endif 41 | // Without global addresses and virtual shared heap, packing 42 | - // just fails, an error code is returned to Haskell. 43 | + // just fails, an error code is returned to Haskell. 44 | // Likewise in library code: would be good to just block on the 45 | // blackhole, but there is no way to return to the scheduler. 46 | PACKETDEBUG(debugBelch("packing hit a %s at %p (returning).\n", 47 | @@ -2285,7 +2291,7 @@ StgClosure* createBH(Capability *cap) { 48 | 49 | SET_HDR(new, &stg_BLACKHOLE_info, CCS_SYSTEM); // ccs to be checked! 50 | 51 | - new->payload[0] = (StgClosure*) &stg_system_tso; 52 | + new->payload[0] = (StgClosure*) &stg_system_tso; 53 | // see above. Pseudo-TSO (has TSO info pointer) owning all 54 | // system-created black holes, and storing BQs. 55 | 56 | @@ -2326,7 +2332,7 @@ StgClosure* createListNode(Capability *cap, StgClosure *head, StgClosure *tail) 57 | /* this array has to be kept in sync with includes/ClosureTypes.h. 58 | * For backwards compatibility of packman, changes need to be worked in 59 | * via CPP (or multipurpose code where possible). 60 | - * 61 | + * 62 | * Changes are identified by minor version, we cannot be more precise than 63 | * that, but non-released version numbers (odd minor version) are included. 64 | * 65 | @@ -2586,7 +2592,7 @@ print: 66 | graphFingerPrint_(fp, visited, (StgClosure *) (p)); 67 | if (strlen(fp)+2 < MAX_FINGER_PRINT_LEN) { 68 | StgWord bitmap; 69 | - const StgFunInfoTable *funInfo 70 | + const StgFunInfoTable *funInfo 71 | = get_fun_itbl(UNTAG_CLOSURE(p)); 72 | strcat(fp, "|"); 73 | switch (funInfo->f.fun_type) { 74 | -------------------------------------------------------------------------------- /patches/pandoc-2.7.2.patch: -------------------------------------------------------------------------------- 1 | commit 628b9f79437644aaad2fe486171c6a8e957099d3 2 | Author: Ryan Scott 3 | Date: Fri May 17 14:15:54 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs 8 | index fb3cfa72a..b924d51dc 100644 9 | --- a/src/Text/Pandoc/Class.hs 10 | +++ b/src/Text/Pandoc/Class.hs 11 | @@ -981,7 +981,7 @@ instance PandocMonad PandocPure where 12 | u : us -> do 13 | modifyPureState $ \st -> st { stUniqStore = us } 14 | return u 15 | - _ -> M.fail "uniq store ran out of elements" 16 | + _ -> error "uniq store ran out of elements" 17 | openURL u = throwError $ PandocResourceNotFound u 18 | readFileLazy fp = do 19 | fps <- getsPureState stFiles 20 | diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs 21 | index c3469b22b..364a6f473 100644 22 | --- a/src/Text/Pandoc/Readers/Markdown.hs 23 | +++ b/src/Text/Pandoc/Readers/Markdown.hs 24 | @@ -260,7 +260,7 @@ yamlBsToMeta bstr = do 25 | nodeToKey :: Monad m => YAML.Node -> m Text 26 | nodeToKey (YAML.Scalar (YAML.SStr t)) = return t 27 | nodeToKey (YAML.Scalar (YAML.SUnknown _ t)) = return t 28 | -nodeToKey _ = fail "Non-string key in YAML mapping" 29 | +nodeToKey _ = error "Non-string key in YAML mapping" 30 | 31 | toMetaValue :: PandocMonad m 32 | => Text -> MarkdownParser m (F MetaValue) 33 | diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs 34 | index a7b9ee621..c38ffc3d5 100644 35 | --- a/src/Text/Pandoc/Writers/Docx.hs 36 | +++ b/src/Text/Pandoc/Writers/Docx.hs 37 | @@ -560,7 +560,7 @@ writeDocx opts doc@(Pandoc meta _) = do 38 | settingsEntry <- copyChildren refArchive distArchive settingsPath epochtime settingsList 39 | 40 | let entryFromArchive arch path = 41 | - maybe (fail $ path ++ " missing in reference docx") 42 | + maybe (error $ path ++ " missing in reference docx") 43 | return 44 | (findEntryByPath path arch `mplus` findEntryByPath path distArchive) 45 | docPropsAppEntry <- entryFromArchive refArchive "docProps/app.xml" 46 | diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs 47 | index ae23a4f9b..32244dd94 100644 48 | --- a/src/Text/Pandoc/Writers/Muse.hs 49 | +++ b/src/Text/Pandoc/Writers/Muse.hs 50 | @@ -614,7 +614,7 @@ inlineToMuse (Subscript lst) = do 51 | modify $ \st -> st { stUseTags = False } 52 | return $ "" <> contents <> "" 53 | inlineToMuse SmallCaps {} = 54 | - fail "SmallCaps should be expanded before normalization" 55 | + error "SmallCaps should be expanded before normalization" 56 | inlineToMuse (Quoted SingleQuote lst) = do 57 | contents <- inlineListToMuse lst 58 | modify $ \st -> st { stUseTags = False } 59 | @@ -624,7 +624,7 @@ inlineToMuse (Quoted DoubleQuote lst) = do 60 | modify $ \st -> st { stUseTags = False } 61 | return $ "“" <> contents <> "”" 62 | inlineToMuse Cite {} = 63 | - fail "Citations should be expanded before normalization" 64 | + error "Citations should be expanded before normalization" 65 | inlineToMuse (Code _ str) = do 66 | useTags <- gets stUseTags 67 | modify $ \st -> st { stUseTags = False } 68 | @@ -632,7 +632,7 @@ inlineToMuse (Code _ str) = do 69 | then "" <> text (substitute "" "</code>" str) <> "" 70 | else "=" <> text str <> "=" 71 | inlineToMuse Math{} = 72 | - fail "Math should be expanded before normalization" 73 | + error "Math should be expanded before normalization" 74 | inlineToMuse (RawInline (Format f) str) = do 75 | modify $ \st -> st { stUseTags = False } 76 | return $ " text f <> "\">" <> text str <> "" 77 | diff --git a/src/Text/Pandoc/Writers/OOXML.hs b/src/Text/Pandoc/Writers/OOXML.hs 78 | index 3c62a4f79..469fe31ea 100644 79 | --- a/src/Text/Pandoc/Writers/OOXML.hs 80 | +++ b/src/Text/Pandoc/Writers/OOXML.hs 81 | @@ -54,9 +54,9 @@ parseXml :: (PandocMonad m) => Archive -> Archive -> String -> m Element 82 | parseXml refArchive distArchive relpath = 83 | case findEntryByPath relpath refArchive `mplus` 84 | findEntryByPath relpath distArchive of 85 | - Nothing -> fail $ relpath ++ " missing in reference file" 86 | + Nothing -> error $ relpath ++ " missing in reference file" 87 | Just e -> case parseXMLDoc . UTF8.toStringLazy . fromEntry $ e of 88 | - Nothing -> fail $ relpath ++ " corrupt in reference file" 89 | + Nothing -> error $ relpath ++ " corrupt in reference file" 90 | Just d -> return d 91 | 92 | -- Copied from Util 93 | diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs 94 | index a45c09bd4..6a0d4a002 100644 95 | --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs 96 | +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs 97 | @@ -153,7 +153,7 @@ copyFileToArchive arch fp = do 98 | refArchive <- asks envRefArchive 99 | distArchive <- asks envDistArchive 100 | case findEntryByPath fp refArchive `mplus` findEntryByPath fp distArchive of 101 | - Nothing -> fail $ fp ++ " missing in reference file" 102 | + Nothing -> error $ fp ++ " missing in reference file" 103 | Just e -> return $ addEntryToArchive e arch 104 | 105 | alwaysInheritedPatterns :: [Pattern] 106 | -------------------------------------------------------------------------------- /patches/persistent-2.10.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru persistent-2.10.0.orig/Database/Persist/Types/Base.hs persistent-2.10.0/Database/Persist/Types/Base.hs 2 | --- persistent-2.10.0.orig/Database/Persist/Types/Base.hs 2019-04-14 22:27:15.000000000 -0400 3 | +++ persistent-2.10.0/Database/Persist/Types/Base.hs 2019-04-19 16:55:07.211353215 -0400 4 | @@ -4,6 +4,7 @@ 5 | 6 | import Control.Arrow (second) 7 | import Control.Exception (Exception) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.Trans.Error (Error (..)) 10 | import qualified Data.Aeson as A 11 | import Data.Bits (shiftL, shiftR) 12 | @@ -433,10 +434,10 @@ 13 | parseJSON (A.String t0) = 14 | case T.uncons t0 of 15 | Nothing -> fail "Null string" 16 | - Just ('p', t) -> either (fail "Invalid base64") (return . PersistDbSpecific) 17 | + Just ('p', t) -> either (\_ -> fail "Invalid base64") (return . PersistDbSpecific) 18 | $ B64.decode $ TE.encodeUtf8 t 19 | Just ('s', t) -> return $ PersistText t 20 | - Just ('b', t) -> either (fail "Invalid base64") (return . PersistByteString) 21 | + Just ('b', t) -> either (\_ -> fail "Invalid base64") (return . PersistByteString) 22 | $ B64.decode $ TE.encodeUtf8 t 23 | Just ('t', t) -> fmap PersistTimeOfDay $ readMay t 24 | Just ('u', t) -> fmap PersistUTCTime $ readMay t 25 | @@ -448,7 +449,7 @@ 26 | where 27 | headMay [] = Nothing 28 | headMay (x:_) = Just x 29 | - readMay :: (Read a, Monad m) => T.Text -> m a 30 | + readMay :: (Read a, Fail.MonadFail m) => T.Text -> m a 31 | readMay t = 32 | case reads $ T.unpack t of 33 | (x, _):_ -> return x 34 | -------------------------------------------------------------------------------- /patches/persistent-template-2.7.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru persistent-template-2.7.1.orig/Database/Persist/TH.hs persistent-template-2.7.1/Database/Persist/TH.hs 2 | --- persistent-template-2.7.1.orig/Database/Persist/TH.hs 2019-05-06 21:35:33.000000000 -0400 3 | +++ persistent-template-2.7.1/Database/Persist/TH.hs 2019-05-11 09:02:38.170979008 -0400 4 | @@ -503,8 +503,14 @@ 5 | 6 | uniqueTypeDec :: MkPersistSettings -> EntityDef -> Dec 7 | uniqueTypeDec mps t = 8 | - DataInstD [] ''Unique 9 | + DataInstD [] 10 | +#if MIN_VERSION_template_haskell(2,15,0) 11 | + Nothing 12 | + (ConT ''Unique `AppT` genericDataType mps (entityHaskell t) backendT) 13 | +#else 14 | + ''Unique 15 | [genericDataType mps (entityHaskell t) backendT] 16 | +#endif 17 | Nothing 18 | (map (mkUnique mps t) $ entityUniques t) 19 | (derivClause $ entityUniques t) 20 | @@ -766,7 +772,12 @@ 21 | bi <- backendKeyI 22 | return (bi, allInstances) 23 | 24 | -#if MIN_VERSION_template_haskell(2,12,0) 25 | +#if MIN_VERSION_template_haskell(2,15,0) 26 | + cxti <- mapM conT i 27 | + let kd = if useNewtype 28 | + then NewtypeInstD [] Nothing (ConT k `AppT` recordType) Nothing dec [DerivClause Nothing cxti] 29 | + else DataInstD [] Nothing (ConT k `AppT` recordType) Nothing [dec] [DerivClause Nothing cxti] 30 | +#elif MIN_VERSION_template_haskell(2,12,0) 31 | cxti <- mapM conT i 32 | let kd = if useNewtype 33 | then NewtypeInstD [] k [recordType] Nothing dec [DerivClause Nothing cxti] 34 | @@ -1053,19 +1064,34 @@ 35 | , puk 36 | , DataInstD 37 | [] 38 | +#if MIN_VERSION_template_haskell(2,15,0) 39 | + Nothing 40 | + (ConT ''EntityField `AppT` 41 | + genDataType `AppT` 42 | + (VarT $ mkName "typ")) 43 | +#else 44 | ''EntityField 45 | [ genDataType 46 | , VarT $ mkName "typ" 47 | ] 48 | +#endif 49 | Nothing 50 | (map fst fields) 51 | [] 52 | , FunD 'persistFieldDef (map snd fields) 53 | +#if MIN_VERSION_template_haskell(2,15,0) 54 | + , TySynInstD 55 | + (TySynEqn 56 | + Nothing 57 | + (ConT ''PersistEntityBackend `AppT` genDataType) 58 | + (backendDataType mps)) 59 | +#else 60 | , TySynInstD 61 | ''PersistEntityBackend 62 | (TySynEqn 63 | [genDataType] 64 | (backendDataType mps)) 65 | +#endif 66 | , FunD 'persistIdField [normalClause [] (ConE $ keyIdName t)] 67 | , FunD 'fieldLens lensClauses 68 | ] 69 | -------------------------------------------------------------------------------- /patches/pipes-4.3.9.cabal: -------------------------------------------------------------------------------- 1 | Name: pipes 2 | Version: 4.3.9 3 | x-revision: 1 4 | Cabal-Version: >= 1.10 5 | Build-Type: Simple 6 | Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1 7 | License: BSD3 8 | License-File: LICENSE 9 | Copyright: 2012-2016 Gabriel Gonzalez 10 | Author: Gabriel Gonzalez 11 | Maintainer: Gabriel439@gmail.com 12 | Bug-Reports: https://github.com/Gabriel439/Haskell-Pipes-Library/issues 13 | Synopsis: Compositional pipelines 14 | Description: 15 | `pipes` is a clean and powerful stream processing library that lets you build 16 | and connect reusable streaming components 17 | . 18 | Advantages over traditional streaming libraries: 19 | . 20 | * /Concise API/: Use simple commands like 'for', ('>->'), 'await', and 'yield' 21 | . 22 | * /Blazing fast/: Implementation tuned for speed, including shortcut fusion 23 | . 24 | * /Lightweight Dependency/: @pipes@ is small and compiles very rapidly, 25 | including dependencies 26 | . 27 | * /Elegant semantics/: Use practical category theory 28 | . 29 | * /ListT/: Correct implementation of 'ListT' that interconverts with pipes 30 | . 31 | * /Bidirectionality/: Implement duplex channels 32 | . 33 | * /Extensive Documentation/: Second to none! 34 | . 35 | Import "Pipes" to use the library. 36 | . 37 | Read "Pipes.Tutorial" for an extensive tutorial. 38 | Category: Control, Pipes 39 | Extra-Source-Files: 40 | CHANGELOG.md 41 | Source-Repository head 42 | Type: git 43 | Location: https://github.com/Gabriel439/Haskell-Pipes-Library 44 | 45 | Library 46 | Default-Language: Haskell2010 47 | 48 | HS-Source-Dirs: src 49 | Build-Depends: 50 | base >= 4.4 && < 5 , 51 | transformers >= 0.2.0.0 && < 0.6 , 52 | exceptions >= 0.4 && < 0.11, 53 | mmorph >= 1.0.4 && < 1.2 , 54 | mtl >= 2.2.1 && < 2.3 , 55 | void >= 0.4 && < 0.8 , 56 | semigroups >= 0.17 && < 0.19 57 | 58 | Exposed-Modules: 59 | Pipes, 60 | Pipes.Core, 61 | Pipes.Internal, 62 | Pipes.Lift, 63 | Pipes.Prelude, 64 | Pipes.Tutorial 65 | GHC-Options: -O2 -Wall 66 | 67 | Benchmark prelude-benchmarks 68 | Default-Language: Haskell2010 69 | Type: exitcode-stdio-1.0 70 | HS-Source-Dirs: benchmarks 71 | Main-Is: PreludeBench.hs 72 | Other-Modules: Common 73 | GHC-Options: -O2 -Wall -rtsopts -fno-warn-unused-do-bind 74 | 75 | Build-Depends: 76 | base >= 4.4 && < 5 , 77 | criterion >= 1.1.1.0 && < 1.2, 78 | optparse-applicative >= 0.12 && < 0.14, 79 | mtl >= 2.1 && < 2.3, 80 | pipes 81 | 82 | test-suite tests 83 | Default-Language: Haskell2010 84 | Type: exitcode-stdio-1.0 85 | HS-Source-Dirs: tests 86 | Main-Is: Main.hs 87 | GHC-Options: -Wall -rtsopts -fno-warn-missing-signatures -fno-enable-rewrite-rules 88 | 89 | Build-Depends: 90 | base >= 4.4 && < 5 , 91 | pipes , 92 | QuickCheck >= 2.4 && < 3 , 93 | mtl >= 2.1 && < 2.3 , 94 | test-framework >= 0.4 && < 1 , 95 | test-framework-quickcheck2 >= 0.2.0 && < 0.4 , 96 | transformers >= 0.2.0.0 && < 0.6 97 | 98 | Benchmark lift-benchmarks 99 | Default-Language: Haskell2010 100 | Type: exitcode-stdio-1.0 101 | HS-Source-Dirs: benchmarks 102 | Main-Is: LiftBench.hs 103 | Other-Modules: Common 104 | GHC-Options: -O2 -Wall -rtsopts -fno-warn-unused-do-bind 105 | 106 | Build-Depends: 107 | base >= 4.4 && < 5 , 108 | criterion >= 1.1.1.0 && < 1.2 , 109 | optparse-applicative >= 0.12 && < 0.14, 110 | mtl >= 2.1 && < 2.3 , 111 | pipes , 112 | transformers >= 0.2.0.0 && < 0.6 113 | -------------------------------------------------------------------------------- /patches/pipes-4.3.9.patch: -------------------------------------------------------------------------------- 1 | diff -ru pipes-4.3.9.orig/src/Pipes.hs pipes-4.3.9/src/Pipes.hs 2 | --- pipes-4.3.9.orig/src/Pipes.hs 2018-03-12 14:27:03.000000000 -0400 3 | +++ pipes-4.3.9/src/Pipes.hs 2019-03-16 08:40:31.569137565 -0400 4 | @@ -66,6 +66,7 @@ 5 | import Control.Monad (void, MonadPlus(mzero, mplus)) 6 | import Control.Monad.Catch (MonadThrow(..), MonadCatch(..)) 7 | import Control.Monad.Except (MonadError(..)) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.IO.Class (MonadIO(liftIO)) 10 | import Control.Monad.Reader (MonadReader(..)) 11 | import Control.Monad.State (MonadState(..)) 12 | @@ -423,6 +424,12 @@ 13 | {-# INLINE return #-} 14 | m >>= f = Select (for (enumerate m) (\a -> enumerate (f a))) 15 | {-# INLINE (>>=) #-} 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | + fail = Fail.fail 18 | + {-# INLINE fail #-} 19 | +#endif 20 | + 21 | +instance Monad m => Fail.MonadFail (ListT m) where 22 | fail _ = mzero 23 | {-# INLINE fail #-} 24 | 25 | -------------------------------------------------------------------------------- /patches/prettyprinter-1.2.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru prettyprinter-1.2.1.orig/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs prettyprinter-1.2.1/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs 2 | --- prettyprinter-1.2.1.orig/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs 2018-02-22 02:08:03.000000000 -0500 3 | +++ prettyprinter-1.2.1/src/Data/Text/Prettyprint/Doc/Render/Util/SimpleDocTree.hs 2019-03-16 08:02:11.953351543 -0400 4 | @@ -127,7 +127,9 @@ 5 | (a'', s'') <- runParser (f a') s' 6 | pure (a'', s'') ) 7 | 8 | +#if !(MIN_VERSION_base(4,13,0)) 9 | fail _err = empty 10 | +#endif 11 | 12 | #if MONAD_FAIL 13 | instance MonadFail (UniqueParser s) where 14 | -------------------------------------------------------------------------------- /patches/primitive-0.6.4.0.cabal: -------------------------------------------------------------------------------- 1 | Name: primitive 2 | Version: 0.6.4.0 3 | x-revision: 1 4 | License: BSD3 5 | License-File: LICENSE 6 | 7 | Author: Roman Leshchinskiy 8 | Maintainer: libraries@haskell.org 9 | Copyright: (c) Roman Leshchinskiy 2009-2012 10 | Homepage: https://github.com/haskell/primitive 11 | Bug-Reports: https://github.com/haskell/primitive/issues 12 | Category: Data 13 | Synopsis: Primitive memory-related operations 14 | Cabal-Version: >= 1.10 15 | Build-Type: Simple 16 | Description: This package provides various primitive memory-related operations. 17 | 18 | Extra-Source-Files: changelog.md 19 | test/*.hs 20 | test/LICENSE 21 | test/primitive-tests.cabal 22 | 23 | Tested-With: 24 | GHC == 7.4.2, 25 | GHC == 7.6.3, 26 | GHC == 7.8.4, 27 | GHC == 7.10.3, 28 | GHC == 8.0.2, 29 | GHC == 8.2.2, 30 | GHC == 8.4.2 31 | 32 | Library 33 | Default-Language: Haskell2010 34 | Other-Extensions: 35 | BangPatterns, CPP, DeriveDataTypeable, 36 | MagicHash, TypeFamilies, UnboxedTuples, UnliftedFFITypes 37 | 38 | Exposed-Modules: 39 | Control.Monad.Primitive 40 | Data.Primitive 41 | Data.Primitive.MachDeps 42 | Data.Primitive.Types 43 | Data.Primitive.Array 44 | Data.Primitive.ByteArray 45 | Data.Primitive.PrimArray 46 | Data.Primitive.SmallArray 47 | Data.Primitive.UnliftedArray 48 | Data.Primitive.Addr 49 | Data.Primitive.Ptr 50 | Data.Primitive.MutVar 51 | Data.Primitive.MVar 52 | 53 | Other-Modules: 54 | Data.Primitive.Internal.Compat 55 | Data.Primitive.Internal.Operations 56 | 57 | Build-Depends: base >= 4.5 && < 4.13 58 | , ghc-prim >= 0.2 && < 0.6 59 | , transformers >= 0.2 && < 0.6 60 | 61 | Ghc-Options: -O2 62 | 63 | Include-Dirs: cbits 64 | Install-Includes: primitive-memops.h 65 | includes: primitive-memops.h 66 | c-sources: cbits/primitive-memops.c 67 | if !os(solaris) 68 | cc-options: -ftree-vectorize 69 | if arch(i386) || arch(x86_64) 70 | cc-options: -msse2 71 | 72 | source-repository head 73 | type: git 74 | location: https://github.com/haskell/primitive 75 | -------------------------------------------------------------------------------- /patches/primitive-0.6.4.0.patch: -------------------------------------------------------------------------------- 1 | From 7a1b7ec3779dedebe98a4435b5d61e23a6b89598 Mon Sep 17 00:00:00 2001 2 | From: Shao Cheng 3 | Date: Tue, 17 Jul 2018 17:17:27 +0800 4 | Subject: [PATCH 1/2] Fix compilation error by recent ghc-head (#187) 5 | 6 | --- 7 | Data/Primitive/MutVar.hs | 3 +-- 8 | 1 file changed, 1 insertion(+), 2 deletions(-) 9 | 10 | diff --git a/Data/Primitive/MutVar.hs b/Data/Primitive/MutVar.hs 11 | index f707bfb..04993fa 100644 12 | --- a/Data/Primitive/MutVar.hs 13 | +++ b/Data/Primitive/MutVar.hs 14 | @@ -25,7 +25,7 @@ module Data.Primitive.MutVar ( 15 | ) where 16 | 17 | import Control.Monad.Primitive ( PrimMonad(..), primitive_ ) 18 | -import GHC.Prim ( MutVar#, sameMutVar#, newMutVar#, 19 | +import GHC.Exts ( MutVar#, sameMutVar#, newMutVar#, 20 | readMutVar#, writeMutVar#, atomicModifyMutVar# ) 21 | import Data.Primitive.Internal.Compat ( isTrue# ) 22 | import Data.Typeable ( Typeable ) 23 | @@ -83,4 +83,3 @@ modifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m () 24 | modifyMutVar' (MutVar mv#) g = primitive_ $ \s# -> 25 | case readMutVar# mv# s# of 26 | (# s'#, a #) -> let a' = g a in a' `seq` writeMutVar# mv# a' s'# 27 | - 28 | -- 29 | 2.17.1 30 | 31 | 32 | From 261d3572ad42482ad80b13f944f7f57bf0d4d801 Mon Sep 17 00:00:00 2001 33 | From: Ryan Scott 34 | Date: Fri, 15 Mar 2019 10:03:57 -0400 35 | Subject: [PATCH 2/2] Adapt to base-4.13.0.0 36 | 37 | --- 38 | Data/Primitive/Array.hs | 6 ++++++ 39 | Data/Primitive/SmallArray.hs | 6 ++++++ 40 | 2 files changed, 12 insertions(+) 41 | 42 | diff --git a/Data/Primitive/Array.hs b/Data/Primitive/Array.hs 43 | index 13352f6..d363a97 100644 44 | --- a/Data/Primitive/Array.hs 45 | +++ b/Data/Primitive/Array.hs 46 | @@ -45,6 +45,7 @@ import Control.Monad.ST(ST,runST) 47 | 48 | import Control.Applicative 49 | import Control.Monad (MonadPlus(..), when) 50 | +import qualified Control.Monad.Fail as Fail 51 | import Control.Monad.Fix 52 | #if MIN_VERSION_base(4,4,0) 53 | import Control.Monad.Zip 54 | @@ -691,6 +692,11 @@ instance Monad Array where 55 | = copyArray smb off sb 0 (lsb) 56 | *> fill (off + lsb) sbs smb 57 | 58 | +#if !(MIN_VERSION_base(4,13,0)) 59 | + fail = Fail.fail 60 | +#endif 61 | + 62 | +instance Fail.MonadFail Array where 63 | fail _ = empty 64 | 65 | instance MonadPlus Array where 66 | diff --git a/Data/Primitive/SmallArray.hs b/Data/Primitive/SmallArray.hs 67 | index 3a50cf2..7e0eb41 100644 68 | --- a/Data/Primitive/SmallArray.hs 69 | +++ b/Data/Primitive/SmallArray.hs 70 | @@ -74,6 +74,7 @@ import qualified GHC.Exts 71 | 72 | import Control.Applicative 73 | import Control.Monad 74 | +import qualified Control.Monad.Fail as Fail 75 | import Control.Monad.Fix 76 | import Control.Monad.Primitive 77 | import Control.Monad.ST 78 | @@ -808,6 +809,11 @@ instance Monad SmallArray where 79 | copySmallArray smb off sb 0 (length sb) 80 | *> fill (off + length sb) sbs smb 81 | 82 | +#if !(MIN_VERSION_base(4,13,0)) 83 | + fail = Fail.fail 84 | +#endif 85 | + 86 | +instance Fail.MonadFail SmallArray where 87 | fail _ = emptySmallArray 88 | 89 | instance MonadPlus SmallArray where 90 | -- 91 | 2.17.1 92 | 93 | -------------------------------------------------------------------------------- /patches/regex-base-0.93.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru regex-base-0.93.2.orig/Text/Regex/Base/Context.hs regex-base-0.93.2/Text/Regex/Base/Context.hs 2 | --- regex-base-0.93.2.orig/Text/Regex/Base/Context.hs 2010-06-11 18:57:49.000000000 -0400 3 | +++ regex-base-0.93.2/Text/Regex/Base/Context.hs 2019-03-15 11:06:55.070138472 -0400 4 | @@ -187,6 +187,7 @@ 5 | module Text.Regex.Base.Context() where 6 | 7 | import Control.Monad(liftM) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Data.Array(Array,(!),elems,listArray) 10 | -- import Data.Maybe(maybe) 11 | import Text.Regex.Base.RegexLike(RegexLike(..),RegexContext(..) 12 | @@ -244,29 +245,29 @@ 13 | {-# INLINE nullArray #-} 14 | nullArray = listArray (1,0) [] 15 | 16 | -nullFail :: (RegexContext regex source (AllMatches [] target),Monad m) => regex -> source -> m (AllMatches [] target) 17 | +nullFail :: (RegexContext regex source (AllMatches [] target),Fail.MonadFail m) => regex -> source -> m (AllMatches [] target) 18 | {-# INLINE nullFail #-} 19 | nullFail r s = case match r s of 20 | (AllMatches []) -> regexFailed 21 | xs -> return xs 22 | 23 | -nullFailText :: (RegexContext regex source (AllTextMatches [] target),Monad m) => regex -> source -> m (AllTextMatches [] target) 24 | +nullFailText :: (RegexContext regex source (AllTextMatches [] target),Fail.MonadFail m) => regex -> source -> m (AllTextMatches [] target) 25 | {-# INLINE nullFailText #-} 26 | nullFailText r s = case match r s of 27 | (AllTextMatches []) -> regexFailed 28 | xs -> return xs 29 | 30 | -nullFail' :: (RegexContext regex source ([] target),Monad m) => regex -> source -> m ([] target) 31 | +nullFail' :: (RegexContext regex source ([] target),Fail.MonadFail m) => regex -> source -> m ([] target) 32 | {-# INLINE nullFail' #-} 33 | nullFail' r s = case match r s of 34 | ([]) -> regexFailed 35 | xs -> return xs 36 | 37 | -regexFailed :: (Monad m) => m b 38 | +regexFailed :: (Fail.MonadFail m) => m b 39 | {-# INLINE regexFailed #-} 40 | regexFailed = fail $ "regex failed to match" 41 | 42 | -actOn :: (RegexLike r s,Monad m) => ((s,MatchText s,s)->t) -> r -> s -> m t 43 | +actOn :: (RegexLike r s,Fail.MonadFail m) => ((s,MatchText s,s)->t) -> r -> s -> m t 44 | {-# INLINE actOn #-} 45 | actOn f r s = case matchOnceText r s of 46 | Nothing -> regexFailed 47 | diff -ru regex-base-0.93.2.orig/Text/Regex/Base/Impl.hs regex-base-0.93.2/Text/Regex/Base/Impl.hs 48 | --- regex-base-0.93.2.orig/Text/Regex/Base/Impl.hs 2010-06-11 18:57:49.000000000 -0400 49 | +++ regex-base-0.93.2/Text/Regex/Base/Impl.hs 2019-03-15 11:07:31.634589571 -0400 50 | @@ -35,13 +35,14 @@ 51 | module Text.Regex.Base.Impl(polymatch,polymatchM) where 52 | 53 | import Text.Regex.Base 54 | +import qualified Control.Monad.Fail as Fail 55 | import Data.Array((!)) 56 | 57 | -regexFailed :: (Monad m) => m b 58 | +regexFailed :: (Fail.MonadFail m) => m b 59 | {-# INLINE regexFailed #-} 60 | regexFailed = fail $ "regex failed to match" 61 | 62 | -actOn :: (RegexLike r s,Monad m) => ((s,MatchText s,s)->t) -> r -> s -> m t 63 | +actOn :: (RegexLike r s,Fail.MonadFail m) => ((s,MatchText s,s)->t) -> r -> s -> m t 64 | {-# INLINE actOn #-} 65 | actOn f r s = case matchOnceText r s of 66 | Nothing -> regexFailed 67 | @@ -53,6 +54,6 @@ 68 | Nothing -> empty 69 | Just (_,ma,_) -> fst (ma!0) 70 | 71 | -polymatchM :: (RegexLike a b,Monad m) => a -> b -> m b 72 | +polymatchM :: (RegexLike a b,Fail.MonadFail m) => a -> b -> m b 73 | {-# INLINE polymatchM #-} 74 | polymatchM = actOn (\(_,ma,_)->fst (ma!0)) 75 | diff -ru regex-base-0.93.2.orig/Text/Regex/Base/RegexLike.hs regex-base-0.93.2/Text/Regex/Base/RegexLike.hs 76 | --- regex-base-0.93.2.orig/Text/Regex/Base/RegexLike.hs 2010-06-11 18:57:49.000000000 -0400 77 | +++ regex-base-0.93.2/Text/Regex/Base/RegexLike.hs 2019-03-15 11:15:28.404344877 -0400 78 | @@ -39,6 +39,7 @@ 79 | AllSubmatches(..),AllTextSubmatches(..),AllMatches(..),AllTextMatches(..) 80 | ) where 81 | 82 | +import qualified Control.Monad.Fail as Fail 83 | import Data.Array(Array,(!)) 84 | import Data.Maybe(isJust) 85 | import qualified Data.ByteString as B (take,drop,empty,ByteString) 86 | @@ -102,9 +103,9 @@ 87 | -- | Specify your own options 88 | makeRegexOpts :: compOpt -> execOpt -> source -> regex 89 | -- | make using the defaultCompOpt and defaultExecOpt, reporting errors with fail 90 | - makeRegexM :: (Monad m) => source -> m regex 91 | + makeRegexM :: (Fail.MonadFail m) => source -> m regex 92 | -- | Specify your own options, reporting errors with fail 93 | - makeRegexOptsM :: (Monad m) => compOpt -> execOpt -> source -> m regex 94 | + makeRegexOptsM :: (Fail.MonadFail m) => compOpt -> execOpt -> source -> m regex 95 | 96 | makeRegex = makeRegexOpts defaultCompOpt defaultExecOpt 97 | makeRegexM = makeRegexOptsM defaultCompOpt defaultExecOpt 98 | @@ -189,7 +190,7 @@ 99 | -- > ["b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z"] 100 | class (RegexLike regex source) => RegexContext regex source target where 101 | match :: regex -> source -> target 102 | - matchM :: (Monad m) => regex -> source -> m target 103 | + matchM :: (Fail.MonadFail m) => regex -> source -> m target 104 | 105 | ---------------- 106 | -- | Extract allows for indexing operations on String or ByteString. 107 | -------------------------------------------------------------------------------- /patches/regex-pcre-builtin-0.94.4.8.8.35.patch: -------------------------------------------------------------------------------- 1 | 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 2 | --- regex-pcre-builtin-0.94.4.8.8.35.orig/Text/Regex/PCRE/Wrap.hsc 2014-05-12 08:04:05.000000000 -0400 3 | +++ regex-pcre-builtin-0.94.4.8.8.35/Text/Regex/PCRE/Wrap.hsc 2019-05-17 13:43:28.369074601 -0400 4 | @@ -69,6 +69,8 @@ 5 | retNoSubstring 6 | ) where 7 | 8 | +import qualified Control.Monad.Fail as Fail 9 | + 10 | #if defined(HAVE_PCRE_H) 11 | import Control.Monad(when) 12 | import Data.Array(Array,accumArray) 13 | @@ -134,7 +136,7 @@ 14 | 15 | (=~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target) 16 | => source1 -> source -> target 17 | -(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) 18 | +(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) 19 | => source1 -> source -> m target 20 | 21 | #if defined(HAVE_PCRE_H) 22 | @@ -154,7 +156,7 @@ 23 | q = makeRegex r 24 | in match q x 25 | 26 | --- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) => source1 -> source -> m target 27 | +-- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) => source1 -> source -> m target 28 | (=~~) x r = do (q :: Regex) <- makeRegexM r 29 | matchM q x 30 | 31 | -------------------------------------------------------------------------------- /patches/regex-posix-0.95.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru regex-posix-0.95.2.orig/Text/Regex/Posix/Wrap.hsc regex-posix-0.95.2/Text/Regex/Posix/Wrap.hsc 2 | --- regex-posix-0.95.2.orig/Text/Regex/Posix/Wrap.hsc 2012-05-20 12:35:49.000000000 -0400 3 | +++ regex-posix-0.95.2/Text/Regex/Posix/Wrap.hsc 2019-03-15 11:14:06.871373192 -0400 4 | @@ -123,6 +123,7 @@ 5 | #endif 6 | 7 | import Control.Monad(liftM) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Data.Array(Array,listArray) 10 | import Data.Bits(Bits(..)) 11 | import Data.Int(Int32,Int64) -- need whatever RegeOffset or #regoff_t type will be 12 | @@ -319,7 +320,7 @@ 13 | 14 | (=~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target) 15 | => source1 -> source -> target 16 | -(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) 17 | +(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) 18 | => source1 -> source -> m target 19 | 20 | instance RegexOptions Regex CompOption ExecOption where 21 | @@ -335,7 +336,7 @@ 22 | make = makeRegex 23 | in match (make r) x 24 | 25 | --- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) => source1 -> source -> m target 26 | +-- (=~~) ::(RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) => source1 -> source -> m target 27 | (=~~) x r = let make :: RegexMaker Regex CompOption ExecOption a => a -> Regex 28 | make = makeRegex 29 | in matchM (make r) x 30 | -------------------------------------------------------------------------------- /patches/regex-tdfa-1.2.3.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru regex-tdfa-1.2.3.2.orig/Text/Regex/TDFA.hs regex-tdfa-1.2.3.2/Text/Regex/TDFA.hs 2 | --- regex-tdfa-1.2.3.2.orig/Text/Regex/TDFA.hs 2019-05-08 17:56:36.000000000 -0400 3 | +++ regex-tdfa-1.2.3.2/Text/Regex/TDFA.hs 2019-05-11 09:11:57.955453593 -0400 4 | @@ -176,6 +176,7 @@ 5 | ,module Text.Regex.TDFA.Common 6 | ,module Text.Regex.Base) where 7 | 8 | +import qualified Control.Monad.Fail as Fail 9 | import Data.Version(Version) 10 | import Text.Regex.Base 11 | import Text.Regex.TDFA.String() 12 | @@ -202,9 +203,9 @@ 13 | 14 | -- | This is the monadic matching operator. If a single match fails, 15 | -- then 'fail' will be called. 16 | -(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Monad m) 17 | +(=~~) :: (RegexMaker Regex CompOption ExecOption source,RegexContext Regex source1 target,Fail.MonadFail m) 18 | => source1 -> source -> m target 19 | -(=~~) x r = do let make :: (RegexMaker Regex CompOption ExecOption a, Monad m) => a -> m Regex 20 | +(=~~) x r = do let make :: (RegexMaker Regex CompOption ExecOption a, Fail.MonadFail m) => a -> m Regex 21 | make = makeRegexM 22 | q <- make r 23 | matchM q x 24 | -------------------------------------------------------------------------------- /patches/safecopy-0.9.4.3.patch: -------------------------------------------------------------------------------- 1 | diff -ru safecopy-0.9.4.3.orig/src/Data/SafeCopy/Derive.hs safecopy-0.9.4.3/src/Data/SafeCopy/Derive.hs 2 | --- safecopy-0.9.4.3.orig/src/Data/SafeCopy/Derive.hs 2018-12-26 10:51:47.000000000 -0500 3 | +++ safecopy-0.9.4.3/src/Data/SafeCopy/Derive.hs 2019-03-16 07:43:01.091510157 -0400 4 | @@ -259,19 +259,29 @@ 5 | FamilyI _ insts -> do 6 | decs <- forM insts $ \inst -> 7 | case inst of 8 | +#if MIN_VERSION_template_haskell(2,15,0) 9 | + DataInstD context _ nty _kind cons _derivs -> 10 | + worker' (return nty) context [] (zip [0..] cons) 11 | +#else 12 | #if MIN_VERSION_template_haskell(2,11,0) 13 | DataInstD context _name ty _kind cons _derivs -> 14 | #else 15 | DataInstD context _name ty cons _derivs -> 16 | #endif 17 | worker' (foldl appT (conT tyName) (map return ty)) context [] (zip [0..] cons) 18 | +#endif 19 | 20 | +#if MIN_VERSION_template_haskell(2,15,0) 21 | + NewtypeInstD context _ nty _kind con _derivs -> 22 | + worker' (return nty) context [] [(0, con)] 23 | +#else 24 | #if MIN_VERSION_template_haskell(2,11,0) 25 | NewtypeInstD context _name ty _kind con _derivs -> 26 | #else 27 | NewtypeInstD context _name ty con _derivs -> 28 | #endif 29 | worker' (foldl appT (conT tyName) (map return ty)) context [] [(0, con)] 30 | +#endif 31 | _ -> fail $ "Can't derive SafeCopy instance for: " ++ show (tyName, inst) 32 | return $ concat decs 33 | _ -> fail $ "Can't derive SafeCopy instance for: " ++ show (tyName, info) 34 | @@ -305,6 +315,13 @@ 35 | FamilyI _ insts -> do 36 | decs <- forM insts $ \inst -> 37 | case inst of 38 | +#if MIN_VERSION_template_haskell(2,15,0) 39 | + DataInstD context _ nty _kind cons _derivs 40 | + | nty == foldl AppT (ConT tyName) tyIndex -> 41 | + worker' (return nty) context [] (zip [0..] cons) 42 | + | otherwise -> 43 | + return [] 44 | +#else 45 | #if MIN_VERSION_template_haskell(2,11,0) 46 | DataInstD context _name ty _kind cons _derivs 47 | #else 48 | @@ -314,7 +331,15 @@ 49 | worker' (foldl appT (conT tyName) (map return ty)) context [] (zip [0..] cons) 50 | | otherwise -> 51 | return [] 52 | +#endif 53 | 54 | +#if MIN_VERSION_template_haskell(2,15,0) 55 | + NewtypeInstD context _ nty _kind con _derivs 56 | + | nty == foldl AppT (ConT tyName) tyIndex -> 57 | + worker' (return nty) context [] [(0, con)] 58 | + | otherwise -> 59 | + return [] 60 | +#else 61 | #if MIN_VERSION_template_haskell(2,11,0) 62 | NewtypeInstD context _name ty _kind con _derivs 63 | #else 64 | @@ -324,6 +349,7 @@ 65 | worker' (foldl appT (conT tyName) (map return ty)) context [] [(0, con)] 66 | | otherwise -> 67 | return [] 68 | +#endif 69 | _ -> fail $ "Can't derive SafeCopy instance for: " ++ show (tyName, inst) 70 | return $ concat decs 71 | _ -> fail $ "Can't derive SafeCopy instance for: " ++ show (tyName, info) 72 | diff -ru safecopy-0.9.4.3.orig/src/Data/SafeCopy/SafeCopy.hs safecopy-0.9.4.3/src/Data/SafeCopy/SafeCopy.hs 73 | --- safecopy-0.9.4.3.orig/src/Data/SafeCopy/SafeCopy.hs 2018-12-26 10:51:47.000000000 -0500 74 | +++ safecopy-0.9.4.3/src/Data/SafeCopy/SafeCopy.hs 2019-03-16 07:43:17.499665286 -0400 75 | @@ -337,7 +337,7 @@ 76 | checkConsistency :: (SafeCopy a, Monad m) => Proxy a -> m b -> m b 77 | checkConsistency proxy ks 78 | = case consistentFromProxy proxy of 79 | - NotConsistent msg -> fail msg 80 | + NotConsistent msg -> error msg 81 | Consistent -> ks 82 | 83 | {-# INLINE computeConsistency #-} 84 | -------------------------------------------------------------------------------- /patches/shakespeare-2.0.20.patch: -------------------------------------------------------------------------------- 1 | commit a265023518932249e2324bf4ba9947a71e7b44f9 2 | Author: Ryan Scott 3 | Date: Sat Mar 16 07:50:28 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Text/Hamlet/Parse.hs b/Text/Hamlet/Parse.hs 8 | index 2f0642b..6eb8e49 100644 9 | --- a/Text/Hamlet/Parse.hs 10 | +++ b/Text/Hamlet/Parse.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | {-# LANGUAGE DeriveDataTypeable #-} 14 | {-# LANGUAGE FlexibleContexts #-} 15 | {-# LANGUAGE TemplateHaskell #-} 16 | @@ -22,6 +23,7 @@ module Text.Hamlet.Parse 17 | import Text.Shakespeare.Base 18 | import Control.Applicative ((<$>), Applicative (..)) 19 | import Control.Monad 20 | +import qualified Control.Monad.Fail as Fail 21 | import Control.Arrow 22 | import Data.Char (GeneralCategory(..), generalCategory, isUpper) 23 | import Data.Data 24 | @@ -37,6 +39,10 @@ instance Monad Result where 25 | return = Ok 26 | Error s >>= _ = Error s 27 | Ok v >>= f = f v 28 | +#if !(MIN_VERSION_base(4,13,0)) 29 | + fail = Fail.fail 30 | +#endif 31 | +instance Fail.MonadFail Result where 32 | fail = Error 33 | instance Functor Result where 34 | fmap = liftM 35 | diff --git a/Text/Internal/Css.hs b/Text/Internal/Css.hs 36 | index 05e915c..1bedbac 100644 37 | --- a/Text/Internal/Css.hs 38 | +++ b/Text/Internal/Css.hs 39 | @@ -298,15 +298,15 @@ getVars scope (ContentVar d) = 40 | getVars scope (ContentUrl d) = 41 | case lookupD d scope of 42 | Nothing -> return [(d, VTUrl)] 43 | - Just s -> fail $ "Expected URL for " ++ s 44 | + Just s -> error $ "Expected URL for " ++ s 45 | getVars scope (ContentUrlParam d) = 46 | case lookupD d scope of 47 | Nothing -> return [(d, VTUrlParam)] 48 | - Just s -> fail $ "Expected URLParam for " ++ s 49 | + Just s -> error $ "Expected URLParam for " ++ s 50 | getVars scope (ContentMixin d) = 51 | case lookupD d scope of 52 | Nothing -> return [(d, VTMixin)] 53 | - Just s -> fail $ "Expected Mixin for " ++ s 54 | + Just s -> error $ "Expected Mixin for " ++ s 55 | 56 | lookupD :: Deref -> [(String, b)] -> Maybe String 57 | lookupD (DerefIdent (Ident s)) scope = 58 | -------------------------------------------------------------------------------- /patches/shelly-1.8.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru shelly-1.8.1.orig/src/Shelly/Base.hs shelly-1.8.1/src/Shelly/Base.hs 2 | --- shelly-1.8.1.orig/src/Shelly/Base.hs 2018-03-17 15:19:41.000000000 -0400 3 | +++ shelly-1.8.1/src/Shelly/Base.hs 2019-03-15 18:08:54.388824423 -0400 4 | @@ -45,6 +45,7 @@ 5 | liftM 6 | ) 7 | import Control.Monad.Base 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad.Trans.Control 10 | import Control.Applicative (Applicative, (<$>)) 11 | import Filesystem (isDirectory, listDirectory) 12 | @@ -71,7 +72,7 @@ 13 | 14 | newtype Sh a = Sh { 15 | unSh :: ReaderT (IORef State) IO a 16 | - } deriving (Applicative, Monad, MonadIO, MonadReader (IORef State), Functor, Catch.MonadMask) 17 | + } deriving (Applicative, Monad, MonadIO, MonadReader (IORef State), Functor, Catch.MonadMask, Fail.MonadFail) 18 | 19 | instance MonadBase IO Sh where 20 | liftBase = Sh . ReaderT . const 21 | -------------------------------------------------------------------------------- /patches/singleton-bool-0.1.4.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: >= 1.10 2 | name: singleton-bool 3 | version: 0.1.4 4 | x-revision: 1 5 | 6 | synopsis: Type level booleans 7 | description: Type level booleans. 8 | . 9 | @singletons@ package provides similar functionality, 10 | but it has tight dependency constraints. 11 | category: Web 12 | homepage: https://github.com/phadej/singleton-bool#readme 13 | bug-reports: https://github.com/phadej/singleton-bool/issues 14 | author: Oleg Grenrus 15 | maintainer: Oleg Grenrus 16 | license: BSD3 17 | license-file: LICENSE 18 | build-type: Simple 19 | tested-with: 20 | GHC==7.6.3, 21 | GHC==7.8.4, 22 | GHC==7.10.3, 23 | GHC==8.0.2, 24 | GHC==8.2.2, 25 | GHC==8.4.3, 26 | GHC==8.6.1 27 | 28 | extra-source-files: 29 | CHANGELOG.md 30 | README.md 31 | 32 | source-repository head 33 | type: git 34 | location: https://github.com/phadej/singleton-bool 35 | 36 | library 37 | hs-source-dirs: 38 | src 39 | ghc-options: -Wall 40 | build-depends: 41 | base >=4.6 && <4.13 42 | exposed-modules: 43 | Data.Singletons.Bool 44 | default-language: Haskell2010 45 | 46 | if !impl(ghc >= 7.8) 47 | build-depends: tagged >= 0.8.5 && <0.9 48 | -------------------------------------------------------------------------------- /patches/singleton-bool-0.1.4.patch: -------------------------------------------------------------------------------- 1 | commit daf73dfbc836348088d2ad88ecf89bdede000982 2 | Author: Ryan Scott 3 | Date: Thu Feb 21 06:51:44 2019 -0500 4 | 5 | Allow building with GHC 8.9 6 | 7 | diff --git a/src/Data/Singletons/Bool.hs b/src/Data/Singletons/Bool.hs 8 | index bcbfe18..3d4d6d5 100644 9 | --- a/src/Data/Singletons/Bool.hs 10 | +++ b/src/Data/Singletons/Bool.hs 11 | @@ -113,10 +113,16 @@ eqCast = unsafeCoerce 12 | trivialRefl :: () :~: () 13 | trivialRefl = Refl 14 | 15 | +# if __GLASGOW_HASKELL__ >= 809 16 | +# define KVS(kvs) kvs 17 | +# else 18 | +# define KVS(kvs) 19 | +# endif 20 | + 21 | -- | Useful combination of 'sbool' and 'eqToRefl' 22 | -- 23 | -- @since 0.1.2.0 24 | -sboolEqRefl :: forall (a :: k) (b :: k). SBoolI (a == b) => Maybe (a :~: b) 25 | +sboolEqRefl :: forall KVS(k) (a :: k) (b :: k). SBoolI (a == b) => Maybe (a :~: b) 26 | sboolEqRefl = case sbool :: SBool (a == b) of 27 | STrue -> Just eqToRefl 28 | SFalse -> Nothing 29 | -------------------------------------------------------------------------------- /patches/singleton-nats-0.4.2.patch: -------------------------------------------------------------------------------- 1 | commit d47b43f4558086df438845fa203aba74968396f5 2 | Author: Ryan Scott 3 | Date: Mon Jan 21 22:26:30 2019 -0500 4 | 5 | Allow building with GHC 8.8 6 | 7 | diff --git a/Data/Nat.hs b/Data/Nat.hs 8 | index 1b64fe6..25dfa1c 100644 9 | --- a/Data/Nat.hs 10 | +++ b/Data/Nat.hs 11 | @@ -3,7 +3,7 @@ 12 | FlexibleInstances, GADTs, TypeFamilies, TemplateHaskell, 13 | InstanceSigs, TypeOperators, PolyKinds, StandaloneDeriving, 14 | FlexibleContexts, AllowAmbiguousTypes, CPP, OverloadedStrings, 15 | - EmptyCase #-} 16 | + EmptyCase, TypeApplications #-} 17 | #if __GLASGOW_HASKELL__ >= 806 18 | {-# LANGUAGE QuantifiedConstraints #-} 19 | #endif 20 | -------------------------------------------------------------------------------- /patches/skylighting-core-0.7.7.patch: -------------------------------------------------------------------------------- 1 | diff -ru skylighting-core-0.7.7.orig/src/Skylighting/Regex.hs skylighting-core-0.7.7/src/Skylighting/Regex.hs 2 | --- skylighting-core-0.7.7.orig/src/Skylighting/Regex.hs 2019-02-28 01:12:37.000000000 -0500 3 | +++ skylighting-core-0.7.7/src/Skylighting/Regex.hs 2019-05-17 14:07:17.266167167 -0400 4 | @@ -12,6 +12,7 @@ 5 | , convertOctalEscapes 6 | ) where 7 | 8 | +import qualified Control.Monad.Fail as Fail 9 | import qualified Control.Exception as E 10 | import Data.Aeson 11 | import Data.Binary (Binary) 12 | @@ -102,5 +103,5 @@ 13 | encodeToText :: BS.ByteString -> Text.Text 14 | encodeToText = TE.decodeUtf8 . Base64.encode 15 | 16 | -decodeFromText :: (Monad m) => Text.Text -> m BS.ByteString 17 | +decodeFromText :: (Fail.MonadFail m) => Text.Text -> m BS.ByteString 18 | decodeFromText = either fail return . Base64.decode . TE.encodeUtf8 19 | -------------------------------------------------------------------------------- /patches/snap-core-1.0.4.0.patch: -------------------------------------------------------------------------------- 1 | commit e4c888ec62da07419179affd5dda755c7d20bc0e 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 20:33:25 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Snap/Internal/Core.hs b/src/Snap/Internal/Core.hs 8 | index ceb81dd..738d762 100644 9 | --- a/src/Snap/Internal/Core.hs 10 | +++ b/src/Snap/Internal/Core.hs 11 | @@ -311,7 +311,9 @@ instance Monad Snap where 12 | return = pure 13 | {-# INLINE return #-} 14 | #endif 15 | +#if !(MIN_VERSION_base(4,13,0)) 16 | fail = Fail.fail 17 | +#endif 18 | 19 | instance Fail.MonadFail Snap where 20 | fail = snapFail 21 | -------------------------------------------------------------------------------- /patches/socks-0.6.0.patch: -------------------------------------------------------------------------------- 1 | commit d81a8117a1b31d784f7b98135427863629d7eeca 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 18:12:23 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Network/Socks5/Parse.hs b/Network/Socks5/Parse.hs 8 | index d857274..fe4fd27 100644 9 | --- a/Network/Socks5/Parse.hs 10 | +++ b/Network/Socks5/Parse.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | {-# LANGUAGE Rank2Types #-} 14 | {-# LANGUAGE BangPatterns #-} 15 | {-# LANGUAGE OverloadedStrings #-} 16 | @@ -36,6 +37,7 @@ module Network.Socks5.Parse 17 | 18 | import Control.Applicative 19 | import Control.Monad 20 | +import qualified Control.Monad.Fail as Fail 21 | import Data.ByteString (ByteString) 22 | import qualified Data.ByteString as B 23 | import qualified Data.ByteString.Internal as B (toForeignPtr) 24 | @@ -71,10 +73,14 @@ newtype Parser a = Parser 25 | { runParser :: forall r . ByteString -> Failure r -> Success a r -> Result r } 26 | 27 | instance Monad Parser where 28 | - fail errorMsg = Parser $ \buf err _ -> err buf ("failed: " ++ errorMsg) 29 | +#if !(MIN_VERSION_base(4,13,0)) 30 | + fail = Fail.fail 31 | +#endif 32 | return v = Parser $ \buf _ ok -> ok buf v 33 | m >>= k = Parser $ \buf err ok -> 34 | runParser m buf err (\buf' a -> runParser (k a) buf' err ok) 35 | +instance Fail.MonadFail Parser where 36 | + fail errorMsg = Parser $ \buf err _ -> err buf ("failed: " ++ errorMsg) 37 | instance MonadPlus Parser where 38 | mzero = fail "Parser.MonadPlus.mzero" 39 | mplus f g = Parser $ \buf err ok -> 40 | -------------------------------------------------------------------------------- /patches/store-0.5.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru store-0.5.1.0.orig/src/Data/Store/TH/Internal.hs store-0.5.1.0/src/Data/Store/TH/Internal.hs 2 | --- store-0.5.1.0.orig/src/Data/Store/TH/Internal.hs 2019-04-24 14:58:44.000000000 -0400 3 | +++ store-0.5.1.0/src/Data/Store/TH/Internal.hs 2019-05-11 08:56:43.536046269 -0400 4 | @@ -363,7 +363,14 @@ 5 | FamilyI _ insts <- reify ''UV.Vector 6 | return (map (everywhere (id `extT` dequalVarT) . go) insts) 7 | where 8 | -#if MIN_VERSION_template_haskell(2,11,0) 9 | +#if MIN_VERSION_template_haskell(2,15,0) 10 | + go (NewtypeInstD preds _ lhs _ con _) 11 | + | [_, ty] <- unAppsT lhs 12 | + = (preds, ty, conToDataCons con) 13 | + go (DataInstD preds _ lhs _ cons _) 14 | + | [_, ty] <- unAppsT lhs 15 | + = (preds, ty, concatMap conToDataCons cons) 16 | +#elif MIN_VERSION_template_haskell(2,11,0) 17 | go (NewtypeInstD preds _ [ty] _ con _) = (preds, ty, conToDataCons con) 18 | go (DataInstD preds _ [ty] _ cons _) = (preds, ty, concatMap conToDataCons cons) 19 | #else 20 | diff -ru store-0.5.1.0.orig/src/Data/Store/TH.hs store-0.5.1.0/src/Data/Store/TH.hs 21 | --- store-0.5.1.0.orig/src/Data/Store/TH.hs 2019-04-24 14:58:44.000000000 -0400 22 | +++ store-0.5.1.0/src/Data/Store/TH.hs 2019-05-11 08:56:43.536046269 -0400 23 | @@ -37,6 +37,7 @@ 24 | , assertRoundtrip 25 | ) where 26 | 27 | +import qualified Control.Monad.Fail as Fail 28 | import Data.Complex () 29 | import Data.Store.Impl 30 | import Data.Typeable (Typeable, typeOf) 31 | @@ -60,7 +61,7 @@ 32 | expr <- [e| property $ changeDepth (\_ -> depth) $ \x -> checkRoundtrip verbose (x :: $(return ty)) |] 33 | return ("Roundtrips (" ++ pprint ty ++ ")", expr) 34 | 35 | -assertRoundtrip :: (Eq a, Show a, Store a, Monad m, Typeable a) => Bool -> a -> m () 36 | +assertRoundtrip :: (Eq a, Show a, Store a, Fail.MonadFail m, Typeable a) => Bool -> a -> m () 37 | assertRoundtrip verbose x 38 | | checkRoundtrip verbose x = return () 39 | | otherwise = fail $ "Failed to roundtrip " ++ show (typeOf x) 40 | diff -ru store-0.5.1.0.orig/src/Data/Store/Version.hs store-0.5.1.0/src/Data/Store/Version.hs 41 | --- store-0.5.1.0.orig/src/Data/Store/Version.hs 2019-04-24 14:58:44.000000000 -0400 42 | +++ store-0.5.1.0/src/Data/Store/Version.hs 2019-05-11 08:56:43.536046269 -0400 43 | @@ -217,7 +217,7 @@ 44 | goField = do 45 | s <- get 46 | case sFieldNames s of 47 | - [] -> fail "impossible case in getStructureInfo'" 48 | + [] -> error "impossible case in getStructureInfo'" 49 | (name:names) -> do 50 | getStructureInfo' ignore renames (Proxy :: Proxy b) 51 | s' <- get 52 | diff -ru store-0.5.1.0.orig/src/System/IO/ByteBuffer.hs store-0.5.1.0/src/System/IO/ByteBuffer.hs 53 | --- store-0.5.1.0.orig/src/System/IO/ByteBuffer.hs 2018-12-24 02:27:39.000000000 -0500 54 | +++ store-0.5.1.0/src/System/IO/ByteBuffer.hs 2019-05-11 08:56:43.536046269 -0400 55 | @@ -43,6 +43,7 @@ 56 | import Control.Applicative 57 | import Control.Exception (SomeException, throwIO) 58 | import Control.Exception.Lifted (Exception, bracket, catch) 59 | +import qualified Control.Monad.Fail as Fail 60 | import Control.Monad.IO.Class (MonadIO, liftIO) 61 | import Control.Monad.Trans.Control (MonadBaseControl) 62 | import Data.ByteString (ByteString) 63 | @@ -280,7 +281,7 @@ 64 | -- such the ones created by the @network@ package. 65 | -- 66 | -- Returns how many bytes could be read non-blockingly. 67 | -fillFromFd :: MonadIO m => ByteBuffer -> Fd -> Int -> m Int 68 | +fillFromFd :: (MonadIO m, Fail.MonadFail m) => ByteBuffer -> Fd -> Int -> m Int 69 | fillFromFd bb sock maxBytes = if maxBytes < 0 70 | then fail ("fillFromFd: negative argument (" ++ show maxBytes ++ ")") 71 | else bbHandler "fillFromFd" bb go 72 | -------------------------------------------------------------------------------- /patches/store-core-0.4.4.patch: -------------------------------------------------------------------------------- 1 | diff -ru store-core-0.4.4.orig/src/Data/Store/Core.hs store-core-0.4.4/src/Data/Store/Core.hs 2 | --- store-core-0.4.4.orig/src/Data/Store/Core.hs 2018-06-17 04:49:13.000000000 -0400 3 | +++ store-core-0.4.4/src/Data/Store/Core.hs 2019-03-15 14:21:59.659138711 -0400 4 | @@ -112,8 +112,10 @@ 5 | (offset2, x') <- x ptr offset1 6 | runPoke (f x') ptr offset2 7 | {-# INLINE (>>=) #-} 8 | +#if !(MIN_VERSION_base(4,13,0)) 9 | fail = pokeException . T.pack 10 | {-# INLINE fail #-} 11 | +#endif 12 | 13 | #if MIN_VERSION_base(4,9,0) 14 | instance Fail.MonadFail Poke where 15 | @@ -228,8 +230,10 @@ 16 | PeekResult ptr2 x' <- x end ptr1 17 | runPeek (f x') end ptr2 18 | {-# INLINE (>>=) #-} 19 | +#if !(MIN_VERSION_base(4,13,0)) 20 | fail = peekException . T.pack 21 | {-# INLINE fail #-} 22 | +#endif 23 | 24 | #if MIN_VERSION_base(4,9,0) 25 | instance Fail.MonadFail Peek where 26 | -------------------------------------------------------------------------------- /patches/streaming-0.2.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru streaming-0.2.2.0.orig/src/Streaming/Internal.hs streaming-0.2.2.0/src/Streaming/Internal.hs 2 | --- streaming-0.2.2.0.orig/src/Streaming/Internal.hs 1969-12-31 19:00:00.000000000 -0500 3 | +++ streaming-0.2.2.0/src/Streaming/Internal.hs 2019-05-02 15:48:52.108061100 -0400 4 | @@ -91,6 +91,7 @@ 5 | import Control.Monad.Reader.Class 6 | import Control.Monad.State.Class 7 | import Control.Monad.Error.Class 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Applicative 10 | import Data.Function ( on ) 11 | import Control.Monad.Morph 12 | @@ -244,9 +245,14 @@ 13 | Return r -> f r 14 | {-# INLINABLE (>>=) #-} 15 | 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | fail = lift . fail 18 | {-#INLINE fail #-} 19 | +#endif 20 | 21 | +instance (Functor f, MonadFail m) => MonadFail (Stream f m) where 22 | + fail = lift . Fail.fail 23 | + {-# INLINE fail #-} 24 | 25 | -- _bind 26 | -- :: (Functor f, Monad m) 27 | -------------------------------------------------------------------------------- /patches/tar-0.5.1.0.cabal: -------------------------------------------------------------------------------- 1 | name: tar 2 | version: 0.5.1.0 3 | x-revision: 1 4 | license: BSD3 5 | license-file: LICENSE 6 | author: Duncan Coutts 7 | Bjorn Bringert 8 | maintainer: Duncan Coutts 9 | bug-reports: https://github.com/haskell/tar/issues 10 | copyright: 2007 Bjorn Bringert 11 | 2008-2016 Duncan Coutts 12 | category: Codec 13 | synopsis: Reading, writing and manipulating ".tar" archive files. 14 | description: This library is for working with \"@.tar@\" archive files. It 15 | can read and write a range of common variations of archive 16 | format including V7, POSIX USTAR and GNU formats. 17 | . 18 | It provides support for packing and unpacking portable 19 | archives. This makes it suitable for distribution but not 20 | backup because details like file ownership and exact 21 | permissions are not preserved. 22 | . 23 | It also provides features for random access to archive 24 | content using an index. 25 | build-type: Simple 26 | cabal-version: >=1.8 27 | extra-source-files: changelog.md 28 | tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, 29 | GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1 30 | 31 | source-repository head 32 | type: git 33 | location: https://github.com/haskell/tar.git 34 | 35 | flag old-time 36 | default: False 37 | 38 | flag old-bytestring 39 | default: False 40 | 41 | library 42 | build-depends: base == 4.*, 43 | filepath < 1.5, 44 | array < 0.6, 45 | containers >= 0.2 && < 0.7, 46 | deepseq >= 1.1 && < 1.5 47 | 48 | if flag(old-time) 49 | build-depends: directory < 1.2, old-time < 1.2 50 | else 51 | build-depends: directory >= 1.2 && < 1.4, time < 1.9 52 | 53 | if flag(old-bytestring) 54 | build-depends: bytestring-builder >= 0.10.4.0.2 && < 0.11, bytestring == 0.9.* 55 | else 56 | build-depends: bytestring == 0.10.* 57 | 58 | if !impl(ghc >= 8.0) 59 | build-depends: semigroups == 0.18.* 60 | 61 | exposed-modules: 62 | Codec.Archive.Tar 63 | Codec.Archive.Tar.Entry 64 | Codec.Archive.Tar.Check 65 | Codec.Archive.Tar.Index 66 | 67 | other-modules: 68 | Codec.Archive.Tar.Types 69 | Codec.Archive.Tar.Read 70 | Codec.Archive.Tar.Write 71 | Codec.Archive.Tar.Pack 72 | Codec.Archive.Tar.Unpack 73 | Codec.Archive.Tar.Index.StringTable 74 | Codec.Archive.Tar.Index.IntTrie 75 | 76 | other-extensions: 77 | BangPatterns 78 | CPP 79 | DeriveDataTypeable 80 | GeneralizedNewtypeDeriving 81 | PatternGuards 82 | ScopedTypeVariables 83 | 84 | ghc-options: -Wall -fno-warn-unused-imports 85 | 86 | test-suite properties 87 | type: exitcode-stdio-1.0 88 | build-depends: base, 89 | filepath, 90 | array, 91 | containers, 92 | deepseq, 93 | bytestring-handle, 94 | QuickCheck == 2.*, 95 | tasty >= 0.10 && <0.12, 96 | tasty-quickcheck == 0.8.* 97 | 98 | if flag(old-time) 99 | build-depends: directory < 1.2, old-time 100 | else 101 | build-depends: directory >= 1.2, time 102 | 103 | if flag(old-bytestring) 104 | build-depends: bytestring-builder, bytestring >= 0.9 && <0.10 105 | else 106 | build-depends: bytestring >= 0.10 107 | 108 | if !impl(ghc >= 8.0) 109 | build-depends: semigroups == 0.18.* 110 | 111 | hs-source-dirs: . test 112 | 113 | main-is: test/Properties.hs 114 | cpp-options: -DTESTS 115 | 116 | other-modules: 117 | Codec.Archive.Tar.Index 118 | Codec.Archive.Tar.Index.StringTable 119 | Codec.Archive.Tar.Index.IntTrie 120 | 121 | -- shared w/ lib:tar component 122 | other-modules: 123 | Codec.Archive.Tar 124 | Codec.Archive.Tar.Check 125 | Codec.Archive.Tar.Pack 126 | Codec.Archive.Tar.Read 127 | Codec.Archive.Tar.Types 128 | Codec.Archive.Tar.Unpack 129 | Codec.Archive.Tar.Write 130 | 131 | other-extensions: 132 | CPP 133 | BangPatterns, 134 | DeriveDataTypeable 135 | ScopedTypeVariables 136 | 137 | ghc-options: -fno-ignore-asserts 138 | 139 | benchmark bench 140 | type: exitcode-stdio-1.0 141 | hs-source-dirs: . bench 142 | main-is: bench/Main.hs 143 | build-depends: base, 144 | bytestring >= 0.10, 145 | filepath, 146 | directory >= 1.2, 147 | array, 148 | containers, 149 | deepseq, 150 | time, 151 | criterion >= 1.0 152 | 153 | if !impl(ghc >= 8.0) 154 | build-depends: semigroups == 0.18.* 155 | 156 | -- shared w/ lib:tar component 157 | other-modules: 158 | Codec.Archive.Tar 159 | Codec.Archive.Tar.Check 160 | Codec.Archive.Tar.Index 161 | Codec.Archive.Tar.Index.IntTrie 162 | Codec.Archive.Tar.Index.StringTable 163 | Codec.Archive.Tar.Pack 164 | Codec.Archive.Tar.Read 165 | Codec.Archive.Tar.Types 166 | Codec.Archive.Tar.Unpack 167 | Codec.Archive.Tar.Write 168 | -------------------------------------------------------------------------------- /patches/tar-0.5.1.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru tar-0.5.1.0.orig/Codec/Archive/Tar/Read.hs tar-0.5.1.0/Codec/Archive/Tar/Read.hs 2 | --- tar-0.5.1.0.orig/Codec/Archive/Tar/Read.hs 2018-03-09 10:46:26.000000000 -0500 3 | +++ tar-0.5.1.0/Codec/Archive/Tar/Read.hs 2019-03-15 18:06:31.923654193 -0400 4 | @@ -23,6 +23,7 @@ 5 | import Data.Typeable (Typeable) 6 | import Control.Applicative 7 | import Control.Monad 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.DeepSeq 10 | 11 | import qualified Data.ByteString as BS 12 | @@ -252,6 +253,11 @@ 13 | return = pure 14 | Error m >>= _ = Error m 15 | Ok x >>= k = k x 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | + fail = Fail.fail 18 | +#endif 19 | + 20 | +instance Fail.MonadFail (Partial e) where 21 | fail = error "fail @(Partial e)" 22 | 23 | {-# SPECIALISE readOct :: BS.ByteString -> Maybe Int #-} 24 | -------------------------------------------------------------------------------- /patches/texmath-0.11.2.2.patch: -------------------------------------------------------------------------------- 1 | commit 4b33d76001a11970d615f675a7e10b71a74085c2 2 | Author: Ryan Scott 3 | Date: Fri May 17 13:57:34 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Text/TeXMath/Writers/TeX.hs b/src/Text/TeXMath/Writers/TeX.hs 8 | index 262ece97..a0e54516 100644 9 | --- a/src/Text/TeXMath/Writers/TeX.hs 10 | +++ b/src/Text/TeXMath/Writers/TeX.hs 11 | @@ -93,7 +93,7 @@ writeBinom cmd x y = do 12 | "\\brack" -> tellGenFrac "[" "]" 13 | "\\brace" -> tellGenFrac "\\{" "\\}" 14 | "\\bangle" -> tellGenFrac "\\langle" "\\rangle" 15 | - _ -> fail "writeBinom: unknown cmd" 16 | + _ -> error "writeBinom: unknown cmd" 17 | tellGroup $ writeExp x 18 | tellGroup $ writeExp y 19 | else tellGroup $ do 20 | -------------------------------------------------------------------------------- /patches/th-data-compat-0.0.2.7.patch: -------------------------------------------------------------------------------- 1 | commit fc0d2aa1a8fe304dcbe2e49fb9b20a7cb192171a 2 | Author: Ryan Scott 3 | Date: Sat Dec 29 20:39:21 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/src/Language/Haskell/TH/Compat/Data/Current.hs b/src/Language/Haskell/TH/Compat/Data/Current.hs 8 | index cdb8f09..a74e8d8 100644 9 | --- a/src/Language/Haskell/TH/Compat/Data/Current.hs 10 | +++ b/src/Language/Haskell/TH/Compat/Data/Current.hs 11 | @@ -1,3 +1,4 @@ 12 | +{-# LANGUAGE CPP #-} 13 | module Language.Haskell.TH.Compat.Data.Current ( 14 | dataD', unDataD, 15 | newtypeD', unNewtypeD, 16 | @@ -12,7 +13,9 @@ import Language.Haskell.TH 17 | Dec (DataD, NewtypeD, DataInstD, NewtypeInstD, InstanceD), 18 | DerivClauseQ, DerivClause (..), Pred, 19 | dataD, newtypeD, dataInstD, newtypeInstD, derivClause, conT) 20 | - 21 | +#if MIN_VERSION_template_haskell(2,15,0) 22 | +import Language.Haskell.TH (Type(..)) 23 | +#endif 24 | 25 | derivesFromNames :: [Name] -> [DerivClauseQ] 26 | derivesFromNames ns = [derivClause Nothing $ map conT ns] 27 | @@ -50,8 +53,15 @@ dataInstD' cxt n as cs ds = dataInstD cxt n as Nothing cs $ derivesFromNames ds 28 | 29 | -- | Compatible interface to destruct 'DataInstD' 30 | unDataInstD :: Dec -> Maybe (Cxt, Name, [Type], Maybe Kind, [Con], [Type]) 31 | +#if MIN_VERSION_template_haskell(2,15,0) 32 | +unDataInstD (DataInstD cxt _mtvbs nas mk cs ds) 33 | + | ConT n:as <- unAppsT nas 34 | + = Just (cxt, n, as, mk, cs, ds >>= unDerivClause) 35 | +unDataInstD _ = Nothing 36 | +#else 37 | unDataInstD (DataInstD cxt n as mk cs ds) = Just (cxt, n, as, mk, cs, ds >>= unDerivClause) 38 | unDataInstD _ = Nothing 39 | +#endif 40 | 41 | -- | Definition against 'newtypeInstD', 42 | -- compatible with before temaplate-haskell-2.11 43 | @@ -61,11 +71,26 @@ newtypeInstD' cxt n as c ds = newtypeInstD cxt n as Nothing c $ derivesFromNames 44 | 45 | -- | Compatible interface to destruct 'NewtypeInstD' 46 | unNewtypeInstD :: Dec -> Maybe (Cxt, Name, [Type], Maybe Kind, Con, [Type]) 47 | +#if MIN_VERSION_template_haskell(2,15,0) 48 | +unNewtypeInstD (NewtypeInstD cxt _mtvbs nas mk c ds) 49 | + | ConT n:as <- unAppsT nas 50 | + = Just (cxt, n, as, mk, c, ds >>= unDerivClause) 51 | +unNewtypeInstD _ = Nothing 52 | +#else 53 | unNewtypeInstD (NewtypeInstD cxt n as mk c ds) = Just (cxt, n, as, mk, c, ds >>= unDerivClause) 54 | unNewtypeInstD _ = Nothing 55 | +#endif 56 | 57 | -- | Compatible interface to destruct 'InstanceD' 58 | -- No Overlap type is defined before template-haskell-2.11. 59 | unInstanceD :: Dec -> Maybe (Cxt, Type, [Dec]) 60 | unInstanceD (InstanceD _ cxt ty decs) = Just (cxt, ty, decs) 61 | unInstanceD _ = Nothing 62 | + 63 | +#if MIN_VERSION_template_haskell(2,15,0) 64 | +unAppsT :: Type -> [Type] 65 | +unAppsT = go [] 66 | + where 67 | + go xs (AppT l x) = go (x : xs) l 68 | + go xs ty = ty : xs 69 | +#endif 70 | -------------------------------------------------------------------------------- /patches/th-utilities-0.2.3.0.patch: -------------------------------------------------------------------------------- 1 | commit 5e510f6a6ed24b98d143e5baeb156a8901bf3faa 2 | Author: Ryan Scott 3 | Date: Mon Dec 10 15:12:47 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/src/TH/ReifySimple.hs b/src/TH/ReifySimple.hs 8 | index d179829..70b929e 100644 9 | --- a/src/TH/ReifySimple.hs 10 | +++ b/src/TH/ReifySimple.hs 11 | @@ -233,18 +233,24 @@ infoToDataFamily info = case info of 12 | Just $ DataFamily name (map tyVarBndrName tvs) (map go insts) 13 | _ -> Nothing 14 | where 15 | -#if MIN_VERSION_template_haskell(2,11,0) 16 | - go (NewtypeInstD preds name params _kind con _deriving) = 17 | +#if MIN_VERSION_template_haskell(2,15,0) 18 | + go (NewtypeInstD preds _ lhs _kind con _deriving) 19 | + | ConT name:params <- unAppsT lhs 20 | +#elif MIN_VERSION_template_haskell(2,11,0) 21 | + go (NewtypeInstD preds name params _kind con _deriving) 22 | #else 23 | - go (NewtypeInstD preds name params con _deriving) = 24 | + go (NewtypeInstD preds name params con _deriving) 25 | #endif 26 | - DataInst name preds params (conToDataCons con) 27 | -#if MIN_VERSION_template_haskell(2,11,0) 28 | - go (DataInstD preds name params _kind cons _deriving) = 29 | + = DataInst name preds params (conToDataCons con) 30 | +#if MIN_VERSION_template_haskell(2,15,0) 31 | + go (DataInstD preds _ lhs _kind cons _deriving) 32 | + | ConT name:params <- unAppsT lhs 33 | +#elif MIN_VERSION_template_haskell(2,11,0) 34 | + go (DataInstD preds name params _kind cons _deriving) 35 | #else 36 | - go (DataInstD preds name params cons _deriving) = 37 | + go (DataInstD preds name params cons _deriving) 38 | #endif 39 | - DataInst name preds params (concatMap conToDataCons cons) 40 | + = DataInst name preds params (concatMap conToDataCons cons) 41 | go info' = error $ 42 | "Unexpected instance in FamilyI in infoToDataInsts:\n" ++ pprint info' 43 | 44 | @@ -263,8 +269,23 @@ infoToTypeFamily info = case info of 45 | #endif 46 | _ -> Nothing 47 | where 48 | +#if MIN_VERSION_template_haskell(2,15,0) 49 | + goEqn _ (TySynEqn _ lhs ty) 50 | + | ConT name:params <- unAppsT lhs 51 | + = TypeInst name params ty 52 | + | otherwise 53 | + = error $ "Unexpected type family instance head: " ++ pprint lhs 54 | +#else 55 | goEqn name (TySynEqn params ty) = TypeInst name params ty 56 | +#endif 57 | + 58 | +#if MIN_VERSION_template_haskell(2,15,0) 59 | + go (TySynInstD (TySynEqn _ lhs ty)) 60 | + | ConT name:params <- unAppsT lhs 61 | + = TypeInst name params ty 62 | +#else 63 | go (TySynInstD name (TySynEqn params ty)) = TypeInst name params ty 64 | +#endif 65 | go info' = error $ 66 | "Unexpected instance in FamilyI in infoToTypeInsts:\n" ++ pprint info' 67 | 68 | -------------------------------------------------------------------------------- /patches/tls-1.4.1.patch: -------------------------------------------------------------------------------- 1 | diff -ru tls-1.4.1.orig/Network/TLS/Handshake/Key.hs tls-1.4.1/Network/TLS/Handshake/Key.hs 2 | --- tls-1.4.1.orig/Network/TLS/Handshake/Key.hs 2017-12-17 09:13:58.000000000 -0500 3 | +++ tls-1.4.1/Network/TLS/Handshake/Key.hs 2019-03-16 09:40:09.391118702 -0400 4 | @@ -37,7 +37,7 @@ 5 | usingState_ ctx $ do 6 | v <- withRNG $ kxEncrypt publicKey content 7 | case v of 8 | - Left err -> fail ("rsa encrypt failed: " ++ show err) 9 | + Left err -> error ("rsa encrypt failed: " ++ show err) 10 | Right econtent -> return econtent 11 | 12 | signPrivate :: Context -> Role -> SignatureParams -> ByteString -> IO ByteString 13 | @@ -46,7 +46,7 @@ 14 | usingState_ ctx $ do 15 | r <- withRNG $ kxSign privateKey params content 16 | case r of 17 | - Left err -> fail ("sign failed: " ++ show err) 18 | + Left err -> error ("sign failed: " ++ show err) 19 | Right econtent -> return econtent 20 | 21 | decryptRSA :: Context -> ByteString -> IO (Either KxError ByteString) 22 | diff -ru tls-1.4.1.orig/Network/TLS/Packet.hs tls-1.4.1/Network/TLS/Packet.hs 23 | --- tls-1.4.1.orig/Network/TLS/Packet.hs 2018-02-13 09:38:44.000000000 -0500 24 | +++ tls-1.4.1/Network/TLS/Packet.hs 2019-03-16 09:39:48.134953925 -0400 25 | @@ -74,6 +74,7 @@ 26 | import qualified Data.ByteString.Char8 as BC 27 | import Data.ByteArray (ByteArrayAccess) 28 | import qualified Data.ByteArray as B (convert) 29 | +import qualified Control.Monad.Fail as Fail 30 | 31 | data CurrentParams = CurrentParams 32 | { cParamsVersion :: Version -- ^ current protocol version 33 | @@ -644,6 +645,6 @@ 34 | encodeSignedECDHParams dhparams cran sran = runPut $ 35 | putClientRandom32 cran >> putServerRandom32 sran >> putServerECDHParams dhparams 36 | 37 | -fromJustM :: Monad m => String -> Maybe a -> m a 38 | +fromJustM :: Fail.MonadFail m => String -> Maybe a -> m a 39 | fromJustM what Nothing = fail ("fromJust " ++ what ++ ": Nothing") 40 | fromJustM _ (Just x) = return x 41 | -------------------------------------------------------------------------------- /patches/trifecta-2.cabal: -------------------------------------------------------------------------------- 1 | name: trifecta 2 | category: Text, Parsing, Diagnostics, Pretty Printer, Logging 3 | version: 2 4 | x-revision: 2 5 | license: BSD3 6 | cabal-version: >= 1.10 7 | license-file: LICENSE 8 | author: Edward A. Kmett 9 | maintainer: Edward A. Kmett 10 | stability: experimental 11 | homepage: http://github.com/ekmett/trifecta/ 12 | bug-reports: http://github.com/ekmett/trifecta/issues 13 | copyright: Copyright (C) 2010-2017 Edward A. Kmett 14 | synopsis: A modern parser combinator library with convenient diagnostics 15 | description: 16 | A modern parser combinator library with slicing and Clang-style colored diagnostics 17 | 18 | build-type: Custom 19 | tested-with: GHC == 7.4.2 20 | , GHC == 7.6.3 21 | , GHC == 7.8.4 22 | , GHC == 7.10.3 23 | , GHC == 8.0.2 24 | , GHC == 8.2.2 25 | , GHC == 8.4.3 26 | , GHC == 8.6.1 27 | 28 | extra-source-files: 29 | examples/*.hs 30 | examples/LICENSE 31 | examples/rfc2616/*.hs 32 | examples/RFC2616.txt 33 | examples/trifecta-examples.cabal 34 | .travis.yml 35 | CHANGELOG.markdown 36 | README.markdown 37 | Warning.hs 38 | 39 | source-repository head 40 | type: git 41 | location: https://github.com/ekmett/trifecta 42 | 43 | custom-setup 44 | setup-depends: 45 | base >= 4 && < 5, 46 | Cabal, 47 | cabal-doctest >= 1 && < 1.1 48 | 49 | library 50 | exposed-modules: 51 | Text.Trifecta 52 | Text.Trifecta.Combinators 53 | Text.Trifecta.Delta 54 | Text.Trifecta.Highlight 55 | Text.Trifecta.Parser 56 | Text.Trifecta.Rendering 57 | Text.Trifecta.Result 58 | Text.Trifecta.Rope 59 | Text.Trifecta.Tutorial 60 | Text.Trifecta.Util.Array 61 | Text.Trifecta.Util.IntervalMap 62 | Text.Trifecta.Util.It 63 | 64 | other-modules: 65 | Text.Trifecta.Instances 66 | Text.Trifecta.Util.Combinators 67 | 68 | build-depends: 69 | ansi-wl-pprint >= 0.6.6 && < 0.7, 70 | ansi-terminal >= 0.6 && < 0.10, 71 | array >= 0.3.0.2 && < 0.6, 72 | base >= 4.4 && < 5, 73 | blaze-builder >= 0.3.0.1 && < 0.5, 74 | blaze-html >= 0.5 && < 0.10, 75 | blaze-markup >= 0.5 && < 0.9, 76 | bytestring >= 0.9.1 && < 0.11, 77 | charset >= 0.3.5.1 && < 1, 78 | comonad >= 4 && < 6, 79 | containers >= 0.3 && < 0.7, 80 | deepseq >= 1.2.0.1 && < 1.5, 81 | fingertree >= 0.1 && < 0.2, 82 | ghc-prim, 83 | hashable >= 1.2.1 && < 1.4, 84 | lens >= 4.0 && < 5, 85 | mtl >= 2.0.1 && < 2.3, 86 | parsers >= 0.12.1 && < 1, 87 | profunctors >= 4.0 && < 6, 88 | reducers >= 3.10 && < 4, 89 | semigroups >= 0.8.3.1 && < 1, 90 | transformers >= 0.2 && < 0.6, 91 | unordered-containers >= 0.2.1 && < 0.3, 92 | utf8-string >= 0.3.6 && < 1.1 93 | 94 | default-language: Haskell2010 95 | hs-source-dirs: src 96 | ghc-options: -O2 -Wall -fobject-code 97 | 98 | -- See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#base-4.9.0.0 99 | if impl(ghc >= 8.0) 100 | ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances 101 | else 102 | build-depends: fail == 4.9.* 103 | 104 | test-suite doctests 105 | type: exitcode-stdio-1.0 106 | main-is: doctests.hs 107 | ghc-options: -Wall -threaded 108 | x-doctest-options: -fobject-code 109 | hs-source-dirs: tests 110 | default-language: Haskell2010 111 | build-depends: 112 | base, 113 | doctest >= 0.11.1 && < 0.17, 114 | trifecta 115 | 116 | test-suite quickcheck 117 | type: exitcode-stdio-1.0 118 | main-is: QuickCheck.hs 119 | default-language: Haskell2010 120 | build-depends: 121 | base == 4.*, 122 | parsers, 123 | QuickCheck, 124 | trifecta 125 | ghc-options: -Wall -threaded 126 | hs-source-dirs: tests 127 | -------------------------------------------------------------------------------- /patches/trifecta-2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/Text/Trifecta/Parser.hs b/src/Text/Trifecta/Parser.hs 2 | index 26a5c1c..91695da 100644 3 | --- a/src/Text/Trifecta/Parser.hs 4 | +++ b/src/Text/Trifecta/Parser.hs 5 | @@ -177,8 +177,10 @@ instance Monad Parser where 6 | {-# INLINE (>>=) #-} 7 | (>>) = (*>) 8 | {-# INLINE (>>) #-} 9 | +#if !(MIN_VERSION_base(4,13,0)) 10 | fail = Fail.fail 11 | {-# INLINE fail #-} 12 | +#endif 13 | 14 | instance Fail.MonadFail Parser where 15 | fail s = Parser $ \ _ ee _ _ _ _ -> ee (failed s) 16 | -------------------------------------------------------------------------------- /patches/true-name-0.1.0.3.patch: -------------------------------------------------------------------------------- 1 | commit 684d9831d9799d35b2e2af46f6d171d2fd20fa14 2 | Author: Ryan Scott 3 | Date: Sat Dec 29 20:49:37 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/Unsafe/TrueName.hs b/Unsafe/TrueName.hs 8 | index d126ced..e5476ed 100644 9 | --- a/Unsafe/TrueName.hs 10 | +++ b/Unsafe/TrueName.hs 11 | @@ -65,6 +65,11 @@ decNames dec = case dec of 12 | #endif 13 | 14 | #if MIN_VERSION_template_haskell(2,12,0) 15 | + DataInstD cxt _mbtvs _ntyps _kind cons derivs -> 16 | + datatypeNames cxt cons ++ derivNames derivs 17 | + NewtypeInstD cxt _mbtvs _ntyps _kind con derivs -> 18 | + datatypeNames cxt [con] ++ derivNames derivs 19 | +#elif MIN_VERSION_template_haskell(2,12,0) 20 | DataInstD cxt _name _typs _kind cons derivs -> 21 | datatypeNames cxt cons ++ derivNames derivs 22 | NewtypeInstD cxt _name _typs _kind con derivs -> 23 | @@ -93,7 +98,11 @@ decNames dec = case dec of 24 | #endif 25 | 26 | #if MIN_VERSION_template_haskell(2,9,0) 27 | - TySynInstD _ tse -> tseNames tse 28 | + TySynInstD 29 | +# if !(MIN_VERSION_template_haskell(2,15,0)) 30 | + _ 31 | +# endif 32 | + tse -> tseNames tse 33 | RoleAnnotD _ _ -> [] 34 | #else 35 | TySynInstD _ ts t -> (typNames =<< ts) ++ typNames t 36 | @@ -121,7 +130,19 @@ derivNames derivs = predNames =<< 37 | 38 | #if MIN_VERSION_template_haskell(2,9,0) 39 | tseNames :: TySynEqn -> [Name] 40 | +# if MIN_VERSION_template_haskell(2,15,0) 41 | +tseNames (TySynEqn _ nts t) = (typNames =<< ts) ++ typNames t 42 | + where 43 | + (_n, ts) = unAppsT nts 44 | + 45 | + unAppsT :: Type -> (Type, [Type]) 46 | + unAppsT = go [] 47 | + where 48 | + go xs (AppT l x) = go (x : xs) l 49 | + go xs ty = (ty, xs) 50 | +# else 51 | tseNames (TySynEqn ts t) = (typNames =<< ts) ++ typNames t 52 | +# endif 53 | #endif 54 | 55 | predNames :: Pred -> [Name]{- {{{ -} 56 | -------------------------------------------------------------------------------- /patches/turtle-1.5.14.patch: -------------------------------------------------------------------------------- 1 | diff -ru turtle-1.5.14.orig/src/Turtle/Shell.hs turtle-1.5.14/src/Turtle/Shell.hs 2 | --- turtle-1.5.14.orig/src/Turtle/Shell.hs 2019-04-18 13:54:20.000000000 -0400 3 | +++ turtle-1.5.14/src/Turtle/Shell.hs 2019-04-19 11:03:20.586908168 -0400 4 | @@ -182,7 +182,9 @@ 5 | let step1 x a = _foldShell (f a) (FoldShell step0 x return) 6 | _foldShell m (FoldShell step1 begin0 done0) ) 7 | 8 | - fail _ = mzero 9 | +#if !(MIN_VERSION_base(4,13,0)) 10 | + fail = Fail.fail 11 | +#endif 12 | 13 | instance Alternative Shell where 14 | empty = Shell (\(FoldShell _ begin done) -> done begin) 15 | @@ -215,7 +217,7 @@ 16 | 17 | #if MIN_VERSION_base(4,9,0) 18 | instance Fail.MonadFail Shell where 19 | - fail = Prelude.fail 20 | + fail _ = mzero 21 | #endif 22 | 23 | #if __GLASGOW_HASKELL__ >= 804 24 | -------------------------------------------------------------------------------- /patches/vector-th-unbox-0.2.1.6.patch: -------------------------------------------------------------------------------- 1 | commit b680978690ac2f79fde3d06f4a6c3b6f977b8b17 2 | Author: Ryan Scott 3 | Date: Sat Dec 29 17:37:29 2018 -0500 4 | 5 | Allow building with template-haskell-2.15.0.0 6 | 7 | diff --git a/Data/Vector/Unboxed/Deriving.hs b/Data/Vector/Unboxed/Deriving.hs 8 | index 52380b6..f7ed37e 100644 9 | --- a/Data/Vector/Unboxed/Deriving.hs 10 | +++ b/Data/Vector/Unboxed/Deriving.hs 11 | @@ -117,6 +117,11 @@ derivingUnbox name argsQ toRepQ fromRepQ = do 12 | _ -> fail "Expecting a type of the form: cxts => typ -> rep" 13 | 14 | let s = VarT (mkName "s") 15 | +#if MIN_VERSION_template_haskell(2,15,0) 16 | +# define MAYBE_TVBS Nothing 17 | +#else 18 | +# define MAYBE_TVBS 19 | +#endif 20 | #if MIN_VERSION_template_haskell(2,11,0) 21 | let lazy = Bang NoSourceUnpackedness NoSourceStrictness 22 | # define MAYBE_KIND Nothing 23 | @@ -126,7 +131,13 @@ derivingUnbox name argsQ toRepQ fromRepQ = do 24 | # define MAYBE_KIND 25 | # define MAYBE_OVERLAP 26 | #endif 27 | - let newtypeMVector = NewtypeInstD [] ''MVector [s, typ] MAYBE_KIND 28 | + let newtypeMVector = NewtypeInstD [] MAYBE_TVBS 29 | +#if MIN_VERSION_template_haskell(2,15,0) 30 | + (ConT ''MVector `AppT` s `AppT` typ) 31 | +#else 32 | + ''MVector [s, typ] 33 | +#endif 34 | + MAYBE_KIND 35 | (NormalC mvName [(lazy, ConT ''MVector `AppT` s `AppT` rep)]) [] 36 | let mvCon = ConE mvName 37 | let instanceMVector = InstanceD MAYBE_OVERLAP cxts 38 | @@ -147,7 +158,13 @@ derivingUnbox name argsQ toRepQ fromRepQ = do 39 | , wrap 'M.basicUnsafeMove [mv, mv'] id 40 | , wrap 'M.basicUnsafeGrow [mv, n] (liftE mvCon) ] 41 | 42 | - let newtypeVector = NewtypeInstD [] ''Vector [typ] MAYBE_KIND 43 | + let newtypeVector = NewtypeInstD [] MAYBE_TVBS 44 | +#if MIN_VERSION_template_haskell(2,15,0) 45 | + (ConT ''Vector `AppT` typ) 46 | +#else 47 | + ''Vector [typ] 48 | +#endif 49 | + MAYBE_KIND 50 | (NormalC vName [(lazy, ConT ''Vector `AppT` rep)]) [] 51 | let vCon = ConE vName 52 | let instanceVector = InstanceD MAYBE_OVERLAP cxts 53 | -------------------------------------------------------------------------------- /patches/vty-5.25.1.patch: -------------------------------------------------------------------------------- 1 | commit 1451ef6da0215ee6189ae176cfef113d1646ac15 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 20:29:43 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/src/Graphics/Vty/Output.hs b/src/Graphics/Vty/Output.hs 8 | index 3886b88..318a228 100644 9 | --- a/src/Graphics/Vty/Output.hs 10 | +++ b/src/Graphics/Vty/Output.hs 11 | @@ -29,6 +29,7 @@ module Graphics.Vty.Output 12 | where 13 | 14 | import Control.Monad (when) 15 | +import qualified Control.Monad.Fail as Fail 16 | 17 | import Graphics.Vty.Config 18 | import Graphics.Vty.Image (regionWidth, regionHeight) 19 | @@ -84,7 +85,7 @@ outputForConfig config = (<> config) <$> standardIOConfig >>= outputForConfig 20 | -- Currently, the only way to set the cursor position to a given 21 | -- character coordinate is to specify the coordinate in the Picture 22 | -- instance provided to 'outputPicture' or 'refresh'. 23 | -setCursorPos :: MonadIO m => Output -> Int -> Int -> m () 24 | +setCursorPos :: (MonadIO m, Fail.MonadFail m) => Output -> Int -> Int -> m () 25 | setCursorPos t x y = do 26 | bounds <- displayBounds t 27 | when (x >= 0 && x < regionWidth bounds && y >= 0 && y < regionHeight bounds) $ do 28 | @@ -92,14 +93,14 @@ setCursorPos t x y = do 29 | liftIO $ outputByteBuffer t $ writeToByteString $ writeMoveCursor dc x y 30 | 31 | -- | Hides the cursor. 32 | -hideCursor :: MonadIO m => Output -> m () 33 | +hideCursor :: (MonadIO m, Fail.MonadFail m) => Output -> m () 34 | hideCursor t = do 35 | bounds <- displayBounds t 36 | dc <- displayContext t bounds 37 | liftIO $ outputByteBuffer t $ writeToByteString $ writeHideCursor dc 38 | 39 | -- | Shows the cursor. 40 | -showCursor :: MonadIO m => Output -> m () 41 | +showCursor :: (MonadIO m, Fail.MonadFail m) => Output -> m () 42 | showCursor t = do 43 | bounds <- displayBounds t 44 | dc <- displayContext t bounds 45 | diff --git a/src/Graphics/Vty/Output/Interface.hs b/src/Graphics/Vty/Output/Interface.hs 46 | index b3e13a9..b7e8bdd 100644 47 | --- a/src/Graphics/Vty/Output/Interface.hs 48 | +++ b/src/Graphics/Vty/Output/Interface.hs 49 | @@ -29,6 +29,7 @@ import Graphics.Vty.DisplayAttributes 50 | import Blaze.ByteString.Builder (Write, writeToByteString) 51 | import Blaze.ByteString.Builder.ByteString (writeByteString) 52 | 53 | +import qualified Control.Monad.Fail as Fail 54 | import Control.Monad.Trans 55 | 56 | import qualified Data.ByteString as BS 57 | @@ -76,7 +77,7 @@ data Output = Output 58 | -- previous state then set the display state to the initial state. 59 | , releaseDisplay :: forall m. MonadIO m => m () 60 | -- | Returns the current display bounds. 61 | - , displayBounds :: forall m. MonadIO m => m DisplayRegion 62 | + , displayBounds :: forall m. (MonadIO m, Fail.MonadFail m) => m DisplayRegion 63 | -- | Output the bytestring to the terminal device. 64 | , outputByteBuffer :: BS.ByteString -> IO () 65 | -- | Specifies the maximum number of colors supported by the 66 | diff --git a/src/Graphics/Vty/Output/TerminfoBased.hs b/src/Graphics/Vty/Output/TerminfoBased.hs 67 | index 52ba2a3..9444295 100644 68 | --- a/src/Graphics/Vty/Output/TerminfoBased.hs 69 | +++ b/src/Graphics/Vty/Output/TerminfoBased.hs 70 | @@ -13,6 +13,7 @@ module Graphics.Vty.Output.TerminfoBased 71 | where 72 | 73 | import Control.Monad (when) 74 | +import qualified Control.Monad.Fail as Fail 75 | import qualified Data.ByteString as BS 76 | import Data.ByteString.Internal (toForeignPtr) 77 | import Data.Terminfo.Parse 78 | @@ -203,25 +204,25 @@ reserveTerminal termName outFd = liftIO $ do 79 | maybeSendCap s = when (isJust $ s terminfoCaps) . sendCap (fromJust . s) 80 | return t 81 | 82 | -requireCap :: (Applicative m, MonadIO m) => Terminfo.Terminal -> String -> m CapExpression 83 | +requireCap :: (Applicative m, MonadIO m, Fail.MonadFail m) => Terminfo.Terminal -> String -> m CapExpression 84 | requireCap ti capName 85 | = case Terminfo.getCapability ti (Terminfo.tiGetStr capName) of 86 | Nothing -> fail $ "Terminal does not define required capability \"" ++ capName ++ "\"" 87 | Just capStr -> parseCap capStr 88 | 89 | -probeCap :: (Applicative m, MonadIO m) => Terminfo.Terminal -> String -> m (Maybe CapExpression) 90 | +probeCap :: (Applicative m, MonadIO m, Fail.MonadFail m) => Terminfo.Terminal -> String -> m (Maybe CapExpression) 91 | probeCap ti capName 92 | = case Terminfo.getCapability ti (Terminfo.tiGetStr capName) of 93 | Nothing -> return Nothing 94 | Just capStr -> Just <$> parseCap capStr 95 | 96 | -parseCap :: (Applicative m, MonadIO m) => String -> m CapExpression 97 | +parseCap :: (Applicative m, MonadIO m, Fail.MonadFail m) => String -> m CapExpression 98 | parseCap capStr = do 99 | case parseCapExpression capStr of 100 | Left e -> fail $ show e 101 | Right cap -> return cap 102 | 103 | -currentDisplayAttrCaps :: ( Applicative m, MonadIO m ) 104 | +currentDisplayAttrCaps :: ( Applicative m, MonadIO m, Fail.MonadFail m ) 105 | => Terminfo.Terminal 106 | -> m DisplayAttrCaps 107 | currentDisplayAttrCaps ti 108 | -------------------------------------------------------------------------------- /patches/xml-hamlet-0.5.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru xml-hamlet-0.5.0.orig/Text/Hamlet/XMLParse.hs xml-hamlet-0.5.0/Text/Hamlet/XMLParse.hs 2 | --- xml-hamlet-0.5.0.orig/Text/Hamlet/XMLParse.hs 2017-01-16 07:55:00.000000000 -0500 3 | +++ xml-hamlet-0.5.0/Text/Hamlet/XMLParse.hs 2019-05-17 14:34:44.015911657 -0400 4 | @@ -15,6 +15,7 @@ 5 | import Text.Shakespeare.Base 6 | import Control.Applicative ((<$>), Applicative (..)) 7 | import Control.Monad 8 | +import qualified Control.Monad.Fail as Fail 9 | import Data.Char (isUpper) 10 | import Data.Data 11 | import Text.ParserCombinators.Parsec hiding (Line) 12 | @@ -25,6 +26,10 @@ 13 | return = Ok 14 | Error s >>= _ = Error s 15 | Ok v >>= f = f v 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | + fail = Fail.fail 18 | +#endif 19 | +instance Fail.MonadFail Result where 20 | fail = Error 21 | instance Functor Result where 22 | fmap = liftM 23 | -------------------------------------------------------------------------------- /patches/yaml-0.11.0.0.patch: -------------------------------------------------------------------------------- 1 | diff -ru yaml-0.11.0.0.orig/src/Data/Yaml/Parser.hs yaml-0.11.0.0/src/Data/Yaml/Parser.hs 2 | --- yaml-0.11.0.0.orig/src/Data/Yaml/Parser.hs 2018-10-12 02:00:28.000000000 -0400 3 | +++ yaml-0.11.0.0/src/Data/Yaml/Parser.hs 2019-03-15 20:18:04.718999343 -0400 4 | @@ -7,6 +7,7 @@ 5 | 6 | import Control.Applicative 7 | import Control.Exception (Exception) 8 | +import qualified Control.Monad.Fail as Fail 9 | import Control.Monad (MonadPlus (..), liftM, ap) 10 | import Control.Monad.Trans.Class (lift) 11 | import Control.Monad.Trans.Resource (MonadThrow, throwM) 12 | @@ -52,6 +53,10 @@ 13 | case f am of 14 | Left t -> Left t 15 | Right x -> unYamlParser (g x) am 16 | +#if !(MIN_VERSION_base(4,13,0)) 17 | + fail = Fail.fail 18 | +#endif 19 | +instance Fail.MonadFail YamlParser where 20 | fail = YamlParser . const . Left . pack 21 | instance MonadPlus YamlParser where 22 | mzero = fail "mzero" 23 | diff -ru yaml-0.11.0.0.orig/src/Data/Yaml.hs yaml-0.11.0.0/src/Data/Yaml.hs 24 | --- yaml-0.11.0.0.orig/src/Data/Yaml.hs 2018-10-12 02:00:28.000000000 -0400 25 | +++ yaml-0.11.0.0/src/Data/Yaml.hs 2019-03-15 20:17:18.483454743 -0400 26 | @@ -86,6 +86,7 @@ 27 | import Control.Applicative((<$>)) 28 | #endif 29 | import Control.Exception 30 | +import qualified Control.Monad.Fail as Fail 31 | import Control.Monad.IO.Class (MonadIO, liftIO) 32 | import Control.Monad.Trans.Resource (MonadThrow, throwM) 33 | import Data.Aeson 34 | @@ -296,5 +297,5 @@ 35 | array :: [Value] -> Value 36 | array = Array . V.fromList 37 | 38 | -parseMonad :: Monad m => (a -> Parser b) -> a -> m b 39 | +parseMonad :: Fail.MonadFail m => (a -> Parser b) -> a -> m b 40 | parseMonad p = either fail return . parseEither p 41 | -------------------------------------------------------------------------------- /patches/yesod-core-1.6.14.patch: -------------------------------------------------------------------------------- 1 | diff -ru yesod-core-1.6.14.orig/src/Yesod/Routes/TH/RenderRoute.hs yesod-core-1.6.14/src/Yesod/Routes/TH/RenderRoute.hs 2 | --- yesod-core-1.6.14.orig/src/Yesod/Routes/TH/RenderRoute.hs 2019-04-13 15:00:34.000000000 -0400 3 | +++ yesod-core-1.6.14/src/Yesod/Routes/TH/RenderRoute.hs 2019-04-19 17:51:14.736443751 -0400 4 | @@ -142,7 +142,11 @@ 5 | cls <- mkRenderRouteClauses ress 6 | (cons, decs) <- mkRouteCons ress 7 | #if MIN_VERSION_template_haskell(2,12,0) 8 | +# if MIN_VERSION_template_haskell(2,15,0) 9 | + did <- DataInstD [] Nothing (ConT ''Route `AppT` typ) Nothing cons <$> fmap (pure . DerivClause Nothing) (mapM conT (clazzes False)) 10 | +# else 11 | did <- DataInstD [] ''Route [typ] Nothing cons <$> fmap (pure . DerivClause Nothing) (mapM conT (clazzes False)) 12 | +# endif 13 | let sds = fmap (\t -> StandaloneDerivD Nothing cxt $ ConT t `AppT` ( ConT ''Route `AppT` typ)) (clazzes True) 14 | #else 15 | did <- DataInstD [] ''Route [typ] Nothing cons <$> mapM conT (clazzes False) 16 | -------------------------------------------------------------------------------- /patches/zlib-0.6.2.patch: -------------------------------------------------------------------------------- 1 | commit a36285782a438dd6b26282c027597bfd81473672 2 | Author: Ryan Scott 3 | Date: Fri Mar 15 08:43:45 2019 -0400 4 | 5 | Adapt to base-4.13.0.0 6 | 7 | diff --git a/Codec/Compression/Zlib/Stream.hsc b/Codec/Compression/Zlib/Stream.hsc 8 | index 04e1bbb..58d96e0 100644 9 | --- a/Codec/Compression/Zlib/Stream.hsc 10 | +++ b/Codec/Compression/Zlib/Stream.hsc 11 | @@ -26,7 +26,7 @@ module Codec.Compression.Zlib.Stream ( 12 | finalise, 13 | 14 | -- * Initialisation 15 | - deflateInit, 16 | + deflateInit, 17 | inflateInit, 18 | 19 | -- ** Initialisation parameters 20 | @@ -123,6 +123,7 @@ import Data.ByteString (ByteString) 21 | import Control.Applicative (Applicative(..)) 22 | #endif 23 | import Control.Monad (ap,liftM) 24 | +import qualified Control.Monad.Fail as Fail 25 | #if __GLASGOW_HASKELL__ >= 702 26 | #if __GLASGOW_HASKELL__ >= 708 27 | import Control.Monad.ST.Strict 28 | @@ -157,8 +158,8 @@ pushInputBuffer inBuf' offset length = do 29 | -- Now that we're setting a new input buffer, we can be sure that zlib no 30 | -- longer has a reference to the old one. Therefore this is the last point 31 | -- at which the old buffer had to be retained. It's safe to release now. 32 | - inBuf <- getInBuf 33 | - unsafeLiftIO $ touchForeignPtr inBuf 34 | + inBuf <- getInBuf 35 | + unsafeLiftIO $ touchForeignPtr inBuf 36 | 37 | -- now set the available input buffer ptr and length 38 | setInBuf inBuf' 39 | @@ -260,11 +261,11 @@ deflate flush = do 40 | 41 | result <- deflate_ flush 42 | outFree' <- getOutFree 43 | - 44 | + 45 | -- number of bytes of extra output there is available as a result of 46 | -- the call to deflate: 47 | let outExtra = outFree - outFree' 48 | - 49 | + 50 | outAvail <- getOutAvail 51 | setOutAvail (outAvail + outExtra) 52 | return result 53 | @@ -374,6 +375,11 @@ instance Monad Stream where 54 | -- m >>= f = (m `thenZ` \a -> consistencyCheck `thenZ_` returnZ a) `thenZ` f 55 | (>>) = (*>) 56 | return = pure 57 | +#if !(MIN_VERSION_base(4,13,0)) 58 | + fail = Fail.fail 59 | +#endif 60 | + 61 | +instance Fail.MonadFail Stream where 62 | fail = (finalise >>) . failZ 63 | 64 | returnZ :: a -> Stream a 65 | @@ -655,7 +661,7 @@ fromMethod Deflated = #{const Z_DEFLATED} 66 | -- is a trade-off between the amount of compression and the time required to do 67 | -- the compression. 68 | -- 69 | -data CompressionLevel = 70 | +data CompressionLevel = 71 | DefaultCompression 72 | | NoCompression 73 | | BestSpeed 74 | @@ -1025,7 +1031,7 @@ newtype StreamState = StreamState (Ptr StreamState) 75 | #if __GLASGOW_HASKELL__ >= 706 76 | foreign import capi unsafe "zlib.h inflateInit2" 77 | c_inflateInit2 :: StreamState -> CInt -> IO CInt 78 | - 79 | + 80 | foreign import capi unsafe "zlib.h deflateInit2" 81 | c_deflateInit2 :: StreamState 82 | -> CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt 83 | -------------------------------------------------------------------------------- /scripts/README.md: -------------------------------------------------------------------------------- 1 | # Using the nix overrides 2 | 3 | The most convenient way to use the nix script is to make a new top level 4 | attribute for the overriden package set. 5 | 6 | I achieve this using an overlay. 7 | 8 | `~/.config/nixpkgs/overlays.nix` contains a list of overlays which augment the 9 | main package set. I just have one which I keep in my home directory for convenience. 10 | 11 | ``` 12 | [ (import ~/overlay.nix) ] 13 | ``` 14 | 15 | Then in `~/overlay.nix`, I define a new attribute which contains the patch overrides. 16 | 17 | ```nix 18 | self: super: 19 | { 20 | # An attribute which contains the head overrides. 21 | patches = super.callPackage 22 | { patches = ; }; 23 | 24 | 25 | # A modified package set intented to be used with ghcHEAD 26 | ghcHEAD = super.haskell.packages.ghcHEAD.override 27 | { overrides = sel: sup: 28 | # The patches from the directory 29 | ((super.callPackage self.patches {} sel sup) 30 | # Any more local overrides you want. 31 | // { mkDerivation = drv: sup.mkDerivation 32 | ( drv // { jailbreak = true; doHaddock = false; }); 33 | generic-deriving = super.haskell.lib.dontCheck sup.generic-deriving; 34 | }); 35 | }; 36 | } 37 | ``` 38 | 39 | The `patches` attribute is the file which `generate-nix-overrides.hs` creates. 40 | You need to set the correct paths to `overrides.nix` and the patch folder. 41 | 42 | For example, if you have cloned `head.hackage` into your home directory, you would 43 | set them to `~/head.hackage/scripts/overrides.nix` and `~/head.hackage/patches` 44 | respectively. Having a local installation is desirable as when using `head.hackage` 45 | you have to commonly add new patches to `patches`. 46 | 47 | Once you have setup this overlay, you can test your new attribute by trying to build 48 | a package. 49 | 50 | ``` 51 | nix-shell -p "ghcHEAD.ghcWithPackages (ps: [ps.primitive])" 52 | ``` 53 | 54 | and it might work, or it might not :). If it doesn't work, add a patch to your 55 | patches directory and try again. 56 | -------------------------------------------------------------------------------- /scripts/generate-nix-overrides.hs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env nix-shell 2 | #! nix-shell -i runghc -p "haskellPackages.ghcWithPackages (ps: [])" 3 | {-# LANGUAGE ViewPatterns #-} 4 | {-# LANGUAGE LambdaCase #-} 5 | {-# LANGUAGE ScopedTypeVariables #-} 6 | {-# LANGUAGE RecordWildCards #-} 7 | {-# LANGUAGE TupleSections #-} 8 | 9 | import Data.List 10 | import Distribution.Package 11 | import Distribution.Text 12 | import Distribution.Version 13 | import System.Directory 14 | import System.Environment 15 | import System.FilePath 16 | import qualified Data.Map as Map 17 | import Data.Ord 18 | 19 | groupPatches :: Ord a => [(a, k)] -> [(a, [k])] 20 | groupPatches assocs = Map.toAscList $ Map.fromListWith (++) [(k, [v]) | (k, v) <- assocs] 21 | 22 | generateOverrides :: FilePath -> FilePath -> IO String 23 | generateOverrides prefix patchDir = do 24 | patches <- listDirectory patchDir 25 | override_groups <- groupPatches <$> mapM (generateOverride prefix patchDir) 26 | (groupPatches [ (dropExtension pf, decidePatchType pf) | pf <- patches ]) 27 | let overrides = map mkOverride override_groups 28 | return $ intercalate "\n" overrides 29 | 30 | mkOverride :: (PackageName, [([Int], String)]) -> String 31 | mkOverride (display -> pName, patches) = 32 | unlines $ 33 | [unwords [pName, "= if", superPname, "== null then", superPname]] 34 | ++ packages ++ 35 | [ "else", superPname, ";"] 36 | where 37 | superPname = "super." ++ pName 38 | quotes s = "\"" ++ s ++ "\"" 39 | packages :: [String] 40 | packages = map mkPackages (sortBy (comparing fst) patches) 41 | mkPackages (version, patch) = 42 | unwords ["else if", superPname ++ ".version == " 43 | , quotes (intercalate "." (map show version)) 44 | ," then (", patch, ")"] 45 | 46 | override :: FilePath -> FilePath -> FilePath -> String -> PatchType -> String 47 | override prefix patchDir extlessPath nixexpr ptype = 48 | unwords ["(", patchFunction ptype, nixexpr, prefix patchDir addExtension extlessPath (patchTypeExt ptype), ")"] 49 | 50 | generateOverride :: FilePath -> FilePath -> (FilePath, [PatchType]) -> IO (PackageName, ([Int], String)) 51 | generateOverride prefix patchDir (patchExtless, patchTypes) = do 52 | let pid' :: Maybe PackageId = simpleParse (takeFileName patchExtless) 53 | pid <- maybe (fail ("invalid patch file name: " ++ show patchExtless)) return pid' 54 | let pname = display (packageName pid) 55 | version = versionNumbers (packageVersion pid) 56 | return . (packageName pid,) . (version,) $ 57 | "dontRevise " 58 | ++ foldl' (override prefix patchDir patchExtless) ("super."++pname) patchTypes 59 | 60 | patchFunction :: PatchType -> String 61 | patchFunction = \case 62 | CabalPatch -> "setCabalFile" 63 | NormalPatch -> "haskell.lib.appendPatch" 64 | 65 | patchTypeExt :: PatchType -> String 66 | patchTypeExt = \case 67 | CabalPatch -> ".cabal" 68 | NormalPatch -> ".patch" 69 | 70 | decidePatchType :: FilePath -> PatchType 71 | decidePatchType patch = 72 | case takeExtension patch of 73 | ".cabal" -> CabalPatch 74 | ".patch" -> NormalPatch 75 | _ -> error $ "Unexpected patch extension: " ++ patch 76 | 77 | data PatchType = CabalPatch | NormalPatch deriving Eq 78 | 79 | main :: IO () 80 | main = do 81 | args <- getArgs 82 | (prefix, patchDir) <- case args of 83 | [] -> return ("", "patches") 84 | [dir] -> return ("", dir) 85 | [prefix, dir] -> return (prefix, dir) 86 | _ -> fail "Usage: generate-nix-overrides [, patchdir]" 87 | overrides <- generateOverrides prefix patchDir 88 | putStrLn "{haskell}:" 89 | putStrLn "let dontRevise = pkg: haskell.lib.overrideCabal pkg (old: { editedCabalFile = null; }); in" 90 | putStrLn "let setCabalFile = pkg: file: haskell.lib.overrideCabal pkg (old: { postPatch = ''cp ${file} ${old.pname}.cabal''; }); in" 91 | putStrLn "self: super: {\n" 92 | putStrLn overrides 93 | putStrLn "}" 94 | -------------------------------------------------------------------------------- /scripts/make-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | die () { 5 | echo "ERROR: $1" >& 2 6 | exit 1 7 | } 8 | 9 | usage () { 10 | echo "Usage: 11 | ${0##*/} - 12 | 13 | Will roughly perform the following operations: 14 | $ git fetch \$hvr/head.hackage 15 | $ git checkout -b - \$hvr/head.hackage/master 16 | $ mv - --patched 17 | $ cabal unpack --pristine - 18 | $ diff -ru - --patched > \$head.hackage/patches/-.patch 19 | $ mv -f --patched - 20 | $ git add patches/-.patch 21 | $ git commit -m \"Adds -.patch\" 22 | $ git push 23 | 24 | All that's left is opening the PR against \$hvr/head.hackage" 25 | exit 1 26 | } 27 | 28 | if [ -z "$1" ]; then 29 | usage 30 | fi 31 | 32 | if [ ! -f "$HOME/.head.hackage" ]; then 33 | die "$HOME/.head.hackage file not found." 34 | fi 35 | source "$HOME/.head.hackage" 36 | 37 | if [ -z "$HEAD_HACKAGE_CLONE_PATH" ]; then 38 | die "head.hackage local repository ('\$HEAD_HACKAGE_CLONE_PATH') not set; please edit $HOME/.head.hackage." 39 | fi 40 | if [ ! -d "$HEAD_HACKAGE_CLONE_PATH" ]; then 41 | die "head.hackage local repository ('\$HEAD_HACKAGE_CLONE_PATH') doesn't seem to exist; please edit $HOME/.head.hackage." 42 | fi 43 | if [ ! -d "$HEAD_HACKAGE_CLONE_PATH/.git" ]; then 44 | die "head.hackage local repository ('\$HEAD_HACKAGE_CLONE_PATH') doesn't seem to be a git repository; please edit $HOME/.head.hackage." 45 | fi 46 | 47 | UPSTREAM_FETCH_NAME=$(git -C "$HEAD_HACKAGE_CLONE_PATH" remote -v |grep "hvr/head.hackage.*fetch"|awk -F\ '{ print $1 }') 48 | 49 | if [ -z "$UPSTREAM_FETCH_NAME" ] ; then 50 | echo "no hvr/head.hackage remote found. Adding..." 51 | git -C "$HEAD_HACKAGE_CLONE_PATH" remote add hvr https://github.com/hvr/head.hackage.git 52 | UPSTREAM_FETCH_NAME="hvr" 53 | fi 54 | 55 | git -C "$HEAD_HACKAGE_CLONE_PATH" fetch "$UPSTREAM_FETCH_NAME" 56 | git -C "$HEAD_HACKAGE_CLONE_PATH" checkout -b "$1" "$UPSTREAM_FETCH_NAME/master" 57 | 58 | if [ ! -d "$HEAD_HACKAGE_CLONE_PATH/patches" ]; then 59 | die "$HEAD_HACKAGE_CLONE_PATH/patches does not exist!" 60 | fi 61 | 62 | if [ -f "$HEAD_HACKAGE_CLONE_PATH/patches/$1.patch" ]; then 63 | die "$HEAD_HACKAGE_CLONE_PATH/patches/$1.patch already exists!" 64 | fi 65 | 66 | echo "creating patch..." 67 | mv "$1" "$1-patched" 68 | cabal unpack --pristine "$1" 69 | 70 | # diff returns 0 for no changes; 1 for some changes; and 2 for trouble 71 | set +e 72 | diff -ru "$1" "$1-patched" > "$HEAD_HACKAGE_CLONE_PATH/patches/$1.patch" 73 | exit_status=$? 74 | set -e 75 | if [ $exit_status -eq 1 ]; then 76 | echo "creating commit..." 77 | git -C "$HEAD_HACKAGE_CLONE_PATH" add "patches/$1.patch" 78 | git -C "$HEAD_HACKAGE_CLONE_PATH" commit -m "Adds $1.patch" 79 | git -C "$HEAD_HACKAGE_CLONE_PATH" push origin 80 | 81 | echo "Please go to https://github.com/hvr/head.hackage" 82 | else 83 | echo "failed to create patch... exit: $?" 84 | "$HEAD_HACKAGE_CLONE_PATH/patches/$1.patch" 85 | git -C "$HEAD_HACKAGE_CLONE_PATH" checkout master 86 | git -C "$HEAD_HACKAGE_CLONE_PATH" branch -d "$1" 87 | fi 88 | echo "moving $1-patched to $1" 89 | rm -fR "$1" 90 | mv "$1-patched" "$1" 91 | 92 | -------------------------------------------------------------------------------- /scripts/overrides.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , haskell 3 | , patches # A directory containing patch files used to build packages 4 | # it can either be a local directory or fetched from the web 5 | }: 6 | let 7 | hpkgs = haskell.packages.ghc822.extend (self: super: 8 | { aeson = haskell.lib.addBuildDepends super.aeson [self.contravariant]; }); 9 | ghc = hpkgs.ghcWithPackages (ps: with ps; 10 | [ hopenssl distribution-nixpkgs ]); 11 | in 12 | 13 | stdenv.mkDerivation { 14 | 15 | name = "hs-generate-overrides-0.1"; 16 | 17 | src = ./generate-nix-overrides.hs; 18 | 19 | preUnpack = ''mkdir hs-generate-overrides''; 20 | buildInputs = [ ghc ]; 21 | 22 | unpackCmd = '' 23 | cp $curSrc ./hs-generate-overrides 24 | cp -r ${patches} ./hs-generate-overrides/patches 25 | sourceRoot=hs-generate-overrides; 26 | ''; 27 | 28 | buildPhase = '' 29 | ghc $src -o generate 30 | ./generate $script/patches patches > patches.nix 31 | ''; 32 | 33 | outputs = ["out" "script"]; 34 | 35 | installPhase = '' 36 | cp patches.nix $out 37 | mkdir -p $script/patches 38 | cp -r patches $script/patches 39 | ''; 40 | 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /scripts/patch-tool: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # patch-tool: A tool for maintaining the head.hackage patchset 4 | 5 | set -e 6 | 7 | patches_dir=$(realpath $(dirname $0)/../patches) 8 | 9 | split_pkg_version() { 10 | package=$(echo $1 | sed 's/\(.\+\)-\([0-9]\+\(\.[0-9]\+\)*\)/\1/') 11 | version=$(echo $1 | sed 's/\(.\+\)-\([0-9]\+\(\.[0-9]\+\)*\)/\2/') 12 | } 13 | 14 | # Return the version number of the most recent release of the given package 15 | latest_version() { 16 | pkg=$1 17 | curl -s -H "Accept: application/json" -L -X GET http://hackage.haskell.org/package/$pkg/preferred | jq '.["normal-version"] | .[0]' -r 18 | } 19 | 20 | drop_old() { 21 | for ext in patch cabal; do 22 | for file in patches/*.$ext; do 23 | split_pkg_version $(basename $file .$ext) 24 | latest=$(latest_version $package) 25 | #echo "$file $package $version $latest " 26 | if [ "$latest" != "$version" ]; then 27 | echo "$file is obsolete (latest version of $package is $latest), removed" 28 | git rm -q $file 29 | fi 30 | done 31 | done 32 | } 33 | 34 | add_pkg_dirs() { 35 | local dirs=$@ 36 | echo "optional-packages: $dirs" >> cabal.project.local 37 | echo "Added $dirs to cabal.project.local" 38 | } 39 | 40 | patch_pkg() { 41 | local pkg=$(basename $1 .patch) 42 | local pkg_dir=packages/$pkg 43 | local patch=$patches_dir/$pkg.patch 44 | local cabal=$patches_dir/$pkg.cabal 45 | 46 | local patched= 47 | if [ -f "$patch" ]; then 48 | echo "Applied patch $patch to $pkg" 49 | git -C $pkg_dir apply $patch 50 | patched=1 51 | fi 52 | 53 | if [ -f "$cabal" ]; then 54 | echo "Updated cabal file of $pkg with $cabal" 55 | cp "$cabal" $pkg_dir/*.cabal 56 | patched=1 57 | fi 58 | 59 | if [ -n "$patched" ]; then 60 | git -C $pkg_dir commit -q -a -m "head.hackage.org patch" 61 | fi 62 | } 63 | 64 | unpack_patch_pkg() { 65 | local patch=$(basename $1) 66 | local pkg=$(basename $patch .patch) 67 | unpack_pkg $pkg 68 | patch_pkg $patch 69 | } 70 | 71 | unpack_patch_all() { 72 | for p in $patches_dir/*.patch; do 73 | unpack_patch_pkg $p 74 | done 75 | } 76 | 77 | # Unpack the given package 78 | unpack_pkg() { 79 | local pkg=$1 80 | pushd packages 81 | cabal unpack $pkg 82 | local pkg_dir="$(ls -d $pkg* | head)" 83 | if [ -z "$pkg_dir" ]; then 84 | echo "failed to unpack $pkg" 85 | exit 1 86 | fi 87 | cd $pkg_dir 88 | git init 89 | git add . 90 | git commit -q -m "Initial commit of $pkg" 91 | git tag upstream 92 | popd 93 | add_pkg_dirs packages/$pkg_dir 94 | } 95 | 96 | update_patches() { 97 | for p in packages/*; do 98 | local patch_path=$patches_dir/$(basename $p).patch 99 | git -C $p diff upstream > $patch_path 100 | git -C $patches_dir add $patch_path 101 | done 102 | git -C $patches_dir status . 103 | } 104 | 105 | mkdir -p packages 106 | 107 | usage() { 108 | cat <