Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/head.hackage
  • RyanGlScott/head.hackage
  • vaibhavsagar/head.hackage
  • phadej/head.hackage
  • jessoune29/head.hackage
  • alanz/head.hackage
  • clint/head.hackage
  • osa1/head.hackage
  • supersven/head.hackage
  • fendor/head.hackage
  • hsyl20/head.hackage
  • adinapoli/head.hackage
  • alexbiehl/head.hackage
  • mimi.vx/head.hackage
  • Kleidukos/head.hackage
  • wz1000/head.hackage
  • alinab/head.hackage
  • teo/head.hackage
  • duog/head.hackage
  • sheaf/head.hackage
  • expipiplus1/head.hackage
  • drsooch/head.hackage
  • tobias/head.hackage
  • brandonchinn178/head.hackage
  • mpickering/hooks-setup-testing
  • Mikolaj/head.hackage
  • RandomMoonwalker/head.hackage
  • facundominguez/head.hackage
  • trac-fizzixnerd/head.hackage
  • neil.mayhew/head.hackage
  • jappeace/head.hackage
31 results
Show changes
Showing
with 456 additions and 614 deletions
diff -ru bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs bencode-0.6.0.0/src/Data/BEncode/Parser.hs
--- bencode-0.6.0.0.orig/src/Data/BEncode/Parser.hs 2015-05-09 15:56:43.000000000 -0400
+++ bencode-0.6.0.0/src/Data/BEncode/Parser.hs 2019-05-17 14:32:05.074495583 -0400
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : BParser
@@ -26,6 +28,7 @@
import Control.Applicative hiding (optional)
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Data.BEncode
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as Map
@@ -61,6 +64,11 @@
Ok a b' -> runB (f a) b'
Error str -> Error str
return val = BParser $ Ok val
+#if !(MIN_VERSION_base(4,13,0))
+ fail = Fail.fail
+#endif
+
+instance Fail.MonadFail BParser where
fail str = BParser $ \_ -> Error str
instance Functor BParser where
diff --git a/src/Data/Tuple/Unboxed.hs b/src/Data/Tuple/Unboxed.hs
index c27e1db..49720e2 100644
--- a/src/Data/Tuple/Unboxed.hs
+++ b/src/Data/Tuple/Unboxed.hs
@@ -76,7 +76,7 @@
-------------------------------------------------------------------------------
module Data.Tuple.Unboxed where
-import GHC.Prim
+import GHC.Exts
#if WORD_SIZE_IN_BITS >= 32
#define INT32 Int#
diff --git a/src/Data/Tuple/Unboxed/Rep.hs b/src/Data/Tuple/Unboxed/Rep.hs
index fd4796a..342f784 100644
--- a/src/Data/Tuple/Unboxed/Rep.hs
+++ b/src/Data/Tuple/Unboxed/Rep.hs
@@ -12,7 +12,7 @@
-- Stability : experimental
-- Portability : non-portable
--
--- This module provides an ad-hoc polymorphic alternative to the functions in
+-- This module provides an ad-hoc polymorphic alternative to the functions in
-- "Data.Tuple.Unboxed". The functions have the same basic signature, but using
-- GHC 8.0+ features they are made parametrically polymorphic within each fixed
-- representation/calling convention.
@@ -30,6 +30,9 @@ module Data.Tuple.Unboxed.Rep
import Data.Kind
import GHC.Prim
import GHC.Exts
+#if MIN_VERSION_ghc_prim(0,8,0)
+import GHC.Types (UnliftedRep)
+#endif
#if __GLASGOW_HASKELL__ >= 802
type VoidRep = TupleRep '[]
diff --git a/bv-sized.cabal b/bv-sized.cabal
index 5ff840f..9a6222c 100644
--- a/bv-sized.cabal
+++ b/bv-sized.cabal
@@ -32,7 +32,7 @@ library
deepseq >= 1.4.0 && < 1.5.0,
panic >= 0.4.0 && < 0.5,
parameterized-utils >= 2.0.2 && < 2.2,
- random >= 1.2.0 && < 1.3,
+ random >= 1.3.0 && < 1.4,
th-lift >= 0.8.1 && < 0.9
hs-source-dirs: src
default-language: Haskell2010
diff --git a/src/Data/BitVector/Sized/Signed.hs b/src/Data/BitVector/Sized/Signed.hs
index 691d248..05c8ade 100644
--- a/src/Data/BitVector/Sized/Signed.hs
+++ b/src/Data/BitVector/Sized/Signed.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
@@ -141,6 +142,10 @@ instance KnownNat w => Uniform (SignedBV w) where
instance (KnownNat w, 1 <= w) => UniformRange (SignedBV w) where
uniformRM (SignedBV lo, SignedBV hi) g =
SignedBV <$> BV.sUniformRM knownNat (lo, hi) g
+#if MIN_VERSION_random(1,3,0)
+ isInRange (lo, hi) x =
+ lo <= x && x <= hi
+#endif
instance (KnownNat w, 1 <= w) => Random (SignedBV w)
diff --git a/src/Data/BitVector/Sized/Unsigned.hs b/src/Data/BitVector/Sized/Unsigned.hs
index 65f3ece..f9cb94f 100644
--- a/src/Data/BitVector/Sized/Unsigned.hs
+++ b/src/Data/BitVector/Sized/Unsigned.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
@@ -132,6 +133,10 @@ instance KnownNat w => Uniform (UnsignedBV w) where
instance UniformRange (UnsignedBV w) where
uniformRM (UnsignedBV lo, UnsignedBV hi) g =
UnsignedBV <$> BV.uUniformRM (lo, hi) g
+#if MIN_VERSION_random(1,3,0)
+ isInRange (lo, hi) x =
+ lo <= x && x <= hi
+#endif
instance KnownNat w => Random (UnsignedBV w)
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
--- bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap/Lazy.hs 2011-04-29 15:58:05.000000000 -0400
+++ bytestring-mmap-0.2.2/System/IO/Posix/MMap/Lazy.hs 2018-05-20 14:44:47.123915525 -0400
@@ -91,7 +91,11 @@
--
unsafeMMapFile :: FilePath -> IO ByteString
unsafeMMapFile path = do
- fd <- openFd path ReadOnly Nothing defaultFileFlags
+ fd <- openFd path ReadOnly
+#if !(MIN_VERSION_unix(2,8,0))
+ Nothing
+#endif
+ defaultFileFlags
always (closeFd fd) $ do
stat <- getFdStatus fd
let size = fromIntegral (fileSize stat)
diff -ru bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap.hs bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs
--- bytestring-mmap-0.2.2.orig/System/IO/Posix/MMap.hs 2011-04-29 15:58:05.000000000 -0400
+++ bytestring-mmap-0.2.2/System/IO/Posix/MMap.hs 2018-05-20 14:44:17.671914783 -0400
@@ -1,4 +1,4 @@
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE CPP, ForeignFunctionInterface #-}
--------------------------------------------------------------------
-- |
-- Module : System.IO.Posix.MMap
@@ -98,7 +98,11 @@
--
unsafeMMapFile :: FilePath -> IO ByteString
unsafeMMapFile f = do
- fd <- openFd f ReadOnly Nothing defaultFileFlags
+ fd <- openFd f ReadOnly
+#if !(MIN_VERSION_unix(2,8,0))
+ Nothing
+#endif
+ defaultFileFlags
always (closeFd fd) $ do
stat <- getFdStatus fd
let size = fromIntegral (fileSize stat)
cabal-version: 1.12
Name: cassava
Version: 0.5.2.0
Synopsis: A CSV parsing and encoding library
Description: {
@cassava@ is a library for parsing and encoding [RFC 4180](https://tools.ietf.org/html/rfc4180)
compliant [comma-separated values (CSV)](https://en.wikipedia.org/wiki/Comma-separated_values) data,
which is a textual line-oriented format commonly used for exchanging tabular data.
.
@cassava@'s API includes support for
.
- Index-based record-conversion
- Name-based record-conversion
- Typeclass directed conversion of fields and records
- Built-in field-conversion instances for standard types
- Customizable record-conversion instance derivation via GHC generics
- Low-level [bytestring](https://hackage.haskell.org/package/bytestring) builders (see "Data.Csv.Builder")
- Incremental decoding and encoding API (see "Data.Csv.Incremental")
- Streaming API for constant-space decoding (see "Data.Csv.Streaming")
.
Moreover, this library is designed to be easy to use; for instance, here's a
very simple example of encoding CSV data:
.
>>> Data.Csv.encode [("John",27),("Jane",28)]
"John,27\r\nJane,28\r\n"
.
Please refer to the documentation in "Data.Csv" and the included [README](#readme) for more usage examples.
}
Homepage: https://github.com/hvr/cassava
License: BSD3
License-file: LICENSE
Bug-reports: https://github.com/hvr/cassava/issues
Copyright: (c) 2012 Johan Tibell
(c) 2012 Bryan O'Sullivan
(c) 2011 MailRank, Inc.
Author: Johan Tibell
Maintainer: hvr@gnu.org
Category: Text, Web, CSV
Build-type: Simple
Extra-source-files: examples/*.hs,
CHANGES.md,
README.md
Tested-with: GHC==8.8.1, GHC==8.6.5, GHC==8.4.4, GHC ==8.2.2, GHC ==8.0.2, GHC ==7.10.3, GHC ==7.8.4, GHC ==7.6.3, GHC ==7.4.2
----------------------------------------------------------------------------
source-repository head
type: git
location: https://github.com/hvr/cassava.git
flag bytestring--LT-0_10_4
description: [bytestring](https://hackage.haskell.org/haskell/package/bytestring) < 0.10.4
-- Work around https://github.com/haskell-CI/haskell-ci/issues/171
manual: True
default: False
Library
default-language: Haskell2010
other-extensions:
BangPatterns
CPP
DataKinds
DefaultSignatures
DeriveFunctor
FlexibleContexts
FlexibleInstances
KindSignatures
MultiParamTypeClasses
OverloadedStrings
PolyKinds
Rank2Types
ScopedTypeVariables
TypeOperators
UndecidableInstances
if impl(ghc >= 8.0)
other-extensions:
DataKinds
PolyKinds
hs-source-dirs: src
Exposed-modules:
Data.Csv
Data.Csv.Builder
Data.Csv.Incremental
Data.Csv.Parser
Data.Csv.Streaming
Other-modules:
Data.Csv.Conversion
Data.Csv.Conversion.Internal
Data.Csv.Encoding
Data.Csv.Types
Data.Csv.Util
Build-depends:
array >= 0.4 && < 0.6,
attoparsec >= 0.11.3.0 && < 0.14,
base >= 4.5 && < 4.14,
bytestring >= 0.9.2 && < 0.11,
containers >= 0.4.2 && < 0.7,
deepseq >= 1.1 && < 1.5,
hashable < 1.4,
scientific >= 0.3.4.7 && < 0.4,
text < 1.3,
transformers >= 0.2 && < 0.6,
unordered-containers < 0.3,
vector >= 0.8 && < 0.13,
Only >= 0.1 && < 0.1.1
if flag(bytestring--LT-0_10_4)
build-depends: bytestring < 0.10.4
, bytestring-builder >= 0.10.8 && < 0.11
else
build-depends: bytestring >= 0.10.4
, text-short == 0.1.*
-- GHC.Generics lived in `ghc-prim` for GHC 7.2 & GHC 7.4 only
if impl(ghc < 7.6)
build-depends: ghc-prim == 0.2.*
-- For Numeric.Natural
if impl(ghc < 7.10)
build-depends: nats >= 1 && < 1.2
-- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#Recommendationsforforward-compatibility
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances
if impl(ghc >= 8.8)
ghc-options: -Wno-star-is-type
else
ghc-options: -Wnoncanonical-monadfail-instances
else
-- provide/emulate `Control.Monad.Fail` and `Data.Semigroups` API for pre-GHC8
build-depends: fail == 4.9.*, semigroups >= 0.18.2 && <0.20
if impl(ghc >= 8.2)
ghc-options: -Wcpp-undef
ghc-options: -Wall -O2
----------------------------------------------------------------------------
Test-suite unit-tests
default-language: Haskell2010
Type: exitcode-stdio-1.0
Main-is: UnitTests.hs
-- dependencies with version constraints inherited via lib:cassava
Build-depends: attoparsec
, base
, bytestring
, cassava
, hashable
, scientific
, text
, unordered-containers
, vector
-- extra dependencies not already used by lib:cassava
build-depends: HUnit < 1.7
, QuickCheck == 2.13.*
, quickcheck-instances >= 0.3.12 && < 0.4
, test-framework == 0.8.*
, test-framework-hunit == 0.3.*
, test-framework-quickcheck2 == 0.3.*
hs-source-dirs: tests
-- GHC.Generics lived in `ghc-prim` for GHC 7.2 & GHC 7.4 only
if impl(ghc < 7.6)
build-depends: ghc-prim == 0.2.*
-- For Numeric.Natural
if impl(ghc < 7.10)
build-depends: nats
-- https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#Recommendationsforforward-compatibility
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
else
-- provide/emulate `Control.Monad.Fail` and `Data.Semigroups` API for pre-GHC8
build-depends: fail, semigroups
if impl(ghc >= 8.2)
ghc-options: -Wcpp-undef
ghc-options: -Wall
diff --git a/charsetdetect.cabal b/charsetdetect.cabal
index 4c765ef..6e1565f 100644
--- a/charsetdetect.cabal
+++ b/charsetdetect.cabal
@@ -76,7 +76,10 @@ Library
cc-options: -fno-weak
c-sources: cbits/dso_handle.c
- extra-libraries: stdc++
+ if impl(ghc >= 9.4)
+ build-depends: system-cxx-std-lib
+ else
+ extra-libraries: stdc++
Include-Dirs: libcharsetdetect
libcharsetdetect/mozilla/extensions/universalchardet/src/base
diff --git a/charsetdetect-ae.cabal b/charsetdetect-ae.cabal
index 7655545..da839db 100644
--- a/charsetdetect-ae.cabal
+++ b/charsetdetect-ae.cabal
@@ -80,17 +80,20 @@ Library
cc-options: -fno-weak
c-sources: cbits/dso_handle.c
- -- This is a bit dodgy since g++ might link in more stuff, but will probably work in practice:
- if os(windows)
- if arch(x86_64)
- extra-libraries: stdc++-6 gcc_s_seh-1
- else
- extra-libraries: stdc++-6 gcc_s_dw2-1
+ if impl(ghc >= 9.4)
+ build-depends: system-cxx-std-lib
else
- if os(darwin)
- extra-libraries: c++
+ -- This is a bit dodgy since g++ might link in more stuff, but will probably work in practice:
+ if os(windows)
+ if arch(x86_64)
+ extra-libraries: stdc++-6 gcc_s_seh-1
+ else
+ extra-libraries: stdc++-6 gcc_s_dw2-1
else
- extra-libraries: stdc++
+ if os(darwin)
+ extra-libraries: c++
+ else
+ extra-libraries: stdc++
Include-Dirs: libcharsetdetect
libcharsetdetect/mozilla/extensions/universalchardet/src/base
diff --git a/Data/Concurrent/Deque/ChaseLev.hs b/Data/Concurrent/Deque/ChaseLev.hs
index 5a21a5b..071f4b7 100644
--- a/Data/Concurrent/Deque/ChaseLev.hs
+++ b/Data/Concurrent/Deque/ChaseLev.hs
@@ -40,7 +40,7 @@ import System.IO.Unsafe (unsafePerformIO)
import Text.Printf (printf)
import System.Mem.StableName (makeStableName, hashStableName)
import GHC.Exts (Int(I#))
-import GHC.Prim (reallyUnsafePtrEquality#, unsafeCoerce#)
+import GHC.Exts (reallyUnsafePtrEquality#, unsafeCoerce#)
--------------------------------------------------------------------------------
-- Instances
diff --git a/Data/Concurrent/Deque/ChaseLevUnboxed.hs b/Data/Concurrent/Deque/ChaseLevUnboxed.hs
index 2817f7a..ef268a0 100644
--- a/Data/Concurrent/Deque/ChaseLevUnboxed.hs
+++ b/Data/Concurrent/Deque/ChaseLevUnboxed.hs
@@ -42,7 +42,7 @@ import System.IO.Unsafe (unsafePerformIO)
import Text.Printf (printf)
import System.Mem.StableName (makeStableName, hashStableName)
import GHC.Exts (Int(I#))
-import GHC.Prim (reallyUnsafePtrEquality#, unsafeCoerce#)
+import GHC.Exts (reallyUnsafePtrEquality#, unsafeCoerce#)
--------------------------------------------------------------------------------
-- Instances
name: cheapskate
version: 0.1.1.1
x-revision: 1
synopsis: Experimental markdown processor.
description: This is an experimental Markdown processor in pure
Haskell. It aims to process Markdown efficiently and in
the most forgiving possible way. It is designed to deal
with any input, including garbage, with linear
performance. Output is sanitized by default for
protection against XSS attacks.
.
Several markdown extensions are implemented, including
fenced code blocks, significant list start numbers, and
autolinked URLs. See README.markdown for details.
homepage: http://github.com/jgm/cheapskate
license: BSD3
license-file: LICENSE
author: John MacFarlane
maintainer: jgm@berkeley.edu
copyright: (C) 2012-2013 John MacFarlane
category: Text
build-type: Simple
extra-source-files: README.markdown
changelog
man/man1/cheapskate.1
cabal-version: >=1.10
Source-repository head
type: git
location: git://github.com/jgm/cheapskate.git
Flag dingus
Description: Build cheapskate-dingus cgi script.
Default: False
library
hs-source-dirs: .
exposed-modules: Cheapskate
Cheapskate.Parse
Cheapskate.Types
Cheapskate.Html
other-modules: Cheapskate.Util
Cheapskate.Inlines
Cheapskate.ParserCombinators
Paths_cheapskate
build-depends: base >=4.6 && <5,
containers >=0.4 && <0.7,
mtl >=2.1 && <2.3,
text >= 0.9 && < 1.3,
blaze-html >=0.6 && < 0.10,
xss-sanitize >= 0.3 && < 0.4,
data-default >= 0.5 && < 0.8,
syb,
uniplate >= 1.6 && < 1.7,
deepseq
default-language: Haskell2010
ghc-options: -Wall -fno-warn-unused-do-bind
executable cheapskate
main-is: main.hs
hs-source-dirs: bin
build-depends: base >=4.4 && <5,
cheapskate,
bytestring,
blaze-html >=0.6 && < 0.10,
text >= 0.9 && < 1.3
default-language: Haskell2010
ghc-options: -Wall -fno-warn-unused-do-bind
executable cheapskate-dingus
main-is: cheapskate-dingus.hs
hs-source-dirs: bin
if flag(dingus)
build-depends: base, aeson, cheapskate, blaze-html,
text, wai-extra, wai >= 0.3, http-types
default-language: Haskell2010
if flag(dingus)
Buildable: True
else
Buildable: False
ghc-options: -Wall -fno-warn-unused-do-bind
commit e0686e310c948fbcbde9e64421563c91a42dc0b3
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Fri Apr 19 09:25:00 2019 -0400
Adapt to base-4.13.0.0
diff --git a/Cheapskate/ParserCombinators.hs b/Cheapskate/ParserCombinators.hs
index d60699d..77efb09 100644
--- a/Cheapskate/ParserCombinators.hs
+++ b/Cheapskate/ParserCombinators.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
module Cheapskate.ParserCombinators (
Position(..)
, Parser
@@ -35,6 +36,7 @@ import Prelude hiding (takeWhile)
import Data.Text (Text)
import qualified Data.Text as T
import Control.Monad
+import qualified Control.Monad.Fail as Fail
import Control.Applicative
import qualified Data.Set as Set
@@ -109,7 +111,9 @@ instance Alternative Parser where
instance Monad Parser where
return x = Parser $ \st -> Right (st, x)
- fail e = Parser $ \st -> Left $ ParseError (position st) e
+#if !(MIN_VERSION_base(4,13,0))
+ fail = Fail.fail
+#endif
p >>= g = Parser $ \st ->
case evalParser p st of
Left e -> Left e
@@ -117,6 +121,9 @@ instance Monad Parser where
{-# INLINE return #-}
{-# INLINE (>>=) #-}
+instance Fail.MonadFail Parser where
+ fail e = Parser $ \st -> Left $ ParseError (position st) e
+
instance MonadPlus Parser where
mzero = Parser $ \st -> Left $ ParseError (position st) "(mzero)"
mplus p1 p2 = Parser $ \st ->
diff --git a/containers.cabal b/containers.cabal
index e601943..c176468 100644
--- a/containers.cabal
+++ b/containers.cabal
@@ -33,7 +33,7 @@ source-repository head
Library
default-language: Haskell2010
- build-depends: base >= 4.9.1 && < 5, array >= 0.4.0.0, deepseq >= 1.2 && < 1.5, template-haskell
+ build-depends: base >= 4.9.1 && < 5, array >= 0.4.0.0, deepseq >= 1.2 && < 1.6, template-haskell
hs-source-dirs: src
ghc-options: -O2 -Wall -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
diff --git a/src/Data/IntMap/Internal.hs b/src/Data/IntMap/Internal.hs
index 75d0264..c771259 100644
--- a/src/Data/IntMap/Internal.hs
+++ b/src/Data/IntMap/Internal.hs
@@ -311,7 +311,7 @@ import Data.Bits
import qualified Data.Foldable as Foldable
import Data.Maybe (fromMaybe)
import Utils.Containers.Internal.Prelude hiding
- (lookup, map, filter, foldr, foldl, null)
+ (lookup, map, filter, foldr, foldl, foldl', null)
import Prelude ()
import Data.IntSet.Internal (Key)
diff --git a/src/Data/IntMap/Lazy.hs b/src/Data/IntMap/Lazy.hs
index ef5a1c0..6158f87 100644
--- a/src/Data/IntMap/Lazy.hs
+++ b/src/Data/IntMap/Lazy.hs
@@ -172,8 +172,8 @@ module Data.IntMap.Lazy (
, foldMapWithKey
-- ** Strict folds
- , foldr'
- , foldl'
+ , IM.foldr'
+ , IM.foldl'
, foldrWithKey'
, foldlWithKey'
diff --git a/src/Data/IntMap/Strict/Internal.hs b/src/Data/IntMap/Strict/Internal.hs
index a20c49a..bfae645 100644
--- a/src/Data/IntMap/Strict/Internal.hs
+++ b/src/Data/IntMap/Strict/Internal.hs
@@ -260,7 +260,7 @@ module Data.IntMap.Strict.Internal (
) where
import Utils.Containers.Internal.Prelude hiding
- (lookup,map,filter,foldr,foldl,null)
+ (lookup,map,filter,foldr,foldl,foldl',null)
import Prelude ()
import Data.Bits
diff --git a/src/Data/IntSet.hs b/src/Data/IntSet.hs
index a7b36b3..4a08fd5 100644
--- a/src/Data/IntSet.hs
+++ b/src/Data/IntSet.hs
@@ -128,8 +128,8 @@ module Data.IntSet (
, IS.foldr
, IS.foldl
-- ** Strict folds
- , foldr'
- , foldl'
+ , IS.foldr'
+ , IS.foldl'
-- ** Legacy folds
, fold
diff --git a/src/Data/IntSet/Internal.hs b/src/Data/IntSet/Internal.hs
index 740a4ec..7d613a2 100644
--- a/src/Data/IntSet/Internal.hs
+++ b/src/Data/IntSet/Internal.hs
@@ -204,7 +204,7 @@ import Data.Semigroup (Semigroup((<>)))
#endif
import Data.Semigroup (stimesIdempotentMonoid)
import Utils.Containers.Internal.Prelude hiding
- (filter, foldr, foldl, null, map)
+ (filter, foldr, foldl, foldl', null, map)
import Prelude ()
import Utils.Containers.Internal.BitUtil
diff --git a/src/Data/Map/Internal.hs b/src/Data/Map/Internal.hs
index b45288e..f801b1a 100644
--- a/src/Data/Map/Internal.hs
+++ b/src/Data/Map/Internal.hs
@@ -384,7 +384,7 @@ import qualified Data.Foldable as Foldable
import Data.Bifoldable
#endif
import Utils.Containers.Internal.Prelude hiding
- (lookup, map, filter, foldr, foldl, null, splitAt, take, drop)
+ (lookup, map, filter, foldr, foldl, foldl', null, splitAt, take, drop)
import Prelude ()
import qualified Data.Set.Internal as Set
diff --git a/src/Data/Map/Strict/Internal.hs b/src/Data/Map/Strict/Internal.hs
index 9ef3fab..18a8293 100644
--- a/src/Data/Map/Strict/Internal.hs
+++ b/src/Data/Map/Strict/Internal.hs
@@ -308,7 +308,9 @@ module Data.Map.Strict.Internal
, valid
) where
-import Prelude hiding (lookup,map,filter,foldr,foldl,null,take,drop,splitAt)
+import Utils.Containers.Internal.Prelude hiding
+ (lookup,map,filter,foldr,foldl,foldl',null,take,drop,splitAt)
+import Prelude ()
import Data.Map.Internal
( Map (..)
diff --git a/src/Data/Sequence/Internal.hs b/src/Data/Sequence/Internal.hs
index 8d58920..29c827b 100644
--- a/src/Data/Sequence/Internal.hs
+++ b/src/Data/Sequence/Internal.hs
@@ -199,8 +199,8 @@ import Utils.Containers.Internal.Prelude hiding (
#if MIN_VERSION_base(4,11,0)
(<>),
#endif
- (<$>), foldMap, Monoid,
- null, length, lookup, take, drop, splitAt, foldl, foldl1, foldr, foldr1,
+ (<$>), Monoid,
+ null, length, lookup, take, drop, splitAt,
scanl, scanl1, scanr, scanr1, replicate, zip, zipWith, zip3, zipWith3,
unzip, takeWhile, dropWhile, iterate, reverse, filter, mapM, sum, all)
import Prelude ()
@@ -212,7 +212,7 @@ import Control.Monad (MonadPlus(..))
import Data.Monoid (Monoid(..))
import Data.Functor (Functor(..))
import Utils.Containers.Internal.State (State(..), execState)
-import Data.Foldable (Foldable(foldl, foldl1, foldr, foldr1, foldMap, foldl', foldr'), toList)
+import Data.Foldable (foldr', toList)
import qualified Data.Foldable as F
import qualified Data.Semigroup as Semigroup
diff --git a/src/Data/Set.hs b/src/Data/Set.hs
index 0b4bc57..a946eb5 100644
--- a/src/Data/Set.hs
+++ b/src/Data/Set.hs
@@ -141,8 +141,8 @@ module Data.Set (
, S.foldr
, S.foldl
-- ** Strict folds
- , foldr'
- , foldl'
+ , S.foldr'
+ , S.foldl'
-- ** Legacy folds
, fold
diff --git a/src/Data/Set/Internal.hs b/src/Data/Set/Internal.hs
index 1748a87..4501c08 100644
--- a/src/Data/Set/Internal.hs
+++ b/src/Data/Set/Internal.hs
@@ -233,7 +233,7 @@ module Data.Set.Internal (
) where
import Utils.Containers.Internal.Prelude hiding
- (filter,foldl,foldr,null,map,take,drop,splitAt)
+ (filter,foldl,foldl',foldr,null,map,take,drop,splitAt)
import Prelude ()
import Control.Applicative (Const(..))
import qualified Data.List as List
diff --git a/src/Data/Tree.hs b/src/Data/Tree.hs
index 3f174fc..18f690f 100644
--- a/src/Data/Tree.hs
+++ b/src/Data/Tree.hs
@@ -55,7 +55,7 @@ module Data.Tree(
import Utils.Containers.Internal.Prelude as Prelude
import Prelude ()
-import Data.Foldable (fold, foldl', toList)
+import Data.Foldable (fold, toList)
import Data.Traversable (foldMapDefault)
import Control.Monad (liftM)
import Control.Monad.Fix (MonadFix (..), fix)
diff --git a/src/Utils/Containers/Internal/Prelude.hs b/src/Utils/Containers/Internal/Prelude.hs
index 8c19bbf..30bf0ea 100644
--- a/src/Utils/Containers/Internal/Prelude.hs
+++ b/src/Utils/Containers/Internal/Prelude.hs
@@ -4,14 +4,16 @@
module Utils.Containers.Internal.Prelude
( module Prelude
, Applicative (..)
+ , Foldable (..)
#if !MIN_VERSION_base(4,10,0)
, liftA2
#endif
)
where
-import Prelude hiding (Applicative(..))
+import Prelude hiding (Applicative(..), Foldable(..))
import Control.Applicative(Applicative(..))
+import Data.Foldable (Foldable(elem, foldMap, foldr, foldl, foldl', foldr1, foldl1, maximum, minimum, product, sum, null, length))
#if !MIN_VERSION_base(4,10,0)
import Control.Applicative(liftA2)
commit 1138d062235185f05d76d3ce701662c0d22ab345
Author: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Sat Dec 29 22:22:52 2018 -0500
Allow building with template-haskell-2.15.0.0
diff --git a/src/Database/CQL/Protocol/Record.hs b/src/Database/CQL/Protocol/Record.hs
index c69e454..d4ad7f2 100644
--- a/src/Database/CQL/Protocol/Record.hs
+++ b/src/Database/CQL/Protocol/Record.hs
@@ -13,8 +13,10 @@ import Language.Haskell.TH
typeSynDecl :: Name -> [Type] -> Type -> Dec
#if __GLASGOW_HASKELL__ < 708
typeSynDecl = TySynInstD
-#else
+#elif __GLASGOW_HASKELL__ < 807
typeSynDecl x y z = TySynInstD x (TySynEqn y z)
+#else
+typeSynDecl x y z = TySynInstD (TySynEqn Nothing (foldl AppT (ConT x) y) z)
#endif
type family TupleType a
diff -ru critbit-0.2.0.0.orig/Data/CritBit/Set.hs critbit-0.2.0.0/Data/CritBit/Set.hs diff --git a/Data/CritBit/Set.hs b/Data/CritBit/Set.hs
--- critbit-0.2.0.0.orig/Data/CritBit/Set.hs 2014-07-04 01:40:10.000000000 -0400 index 0039925..0bfc74d 100644
+++ critbit-0.2.0.0/Data/CritBit/Set.hs 2018-01-07 18:44:32.747084107 -0500 --- a/Data/CritBit/Set.hs
@@ -1,3 +1,4 @@ +++ b/Data/CritBit/Set.hs
+{-# LANGUAGE CPP #-} @@ -90,16 +90,20 @@ import Data.CritBit.Types.Internal (CritBit(..), Set(..), CritBitKey, Node(..))
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
@@ -90,6 +91,9 @@
import Data.Foldable (Foldable, foldMap) import Data.Foldable (Foldable, foldMap)
import Data.Maybe (isJust) import Data.Maybe (isJust)
import Data.Monoid (Monoid(..)) import Data.Monoid (Monoid(..))
+#if MIN_VERSION_base(4,9,0) -import Prelude hiding (null, filter, map, foldl, foldr)
+import Data.Semigroup (Semigroup(..)) +import Data.Semigroup (Semigroup(..))
+#endif +import Prelude hiding (null, filter, map, foldl, foldr, foldl')
import Prelude hiding (null, filter, map, foldl, foldr)
import qualified Data.CritBit.Tree as T import qualified Data.CritBit.Tree as T
import qualified Data.List as List import qualified Data.List as List
@@ -97,9 +101,16 @@
instance (Show a) => Show (Set a) where instance (Show a) => Show (Set a) where
show s = "fromList " ++ show (toList s) show s = "fromList " ++ show (toList s)
+#if MIN_VERSION_base(4,9,0)
+instance CritBitKey k => Semigroup (Set k) where +instance CritBitKey k => Semigroup (Set k) where
+ (<>) = union + (<>) = union
+#endif
+ +
instance CritBitKey k => Monoid (Set k) where instance CritBitKey k => Monoid (Set k) where
mempty = empty mempty = empty
+#if !(MIN_VERSION_base(4,11,0)) - mappend = union
mappend = union + mappend = (<>)
+#endif
mconcat = unions mconcat = unions
instance Foldable Set where instance Foldable Set where
diff -ru critbit-0.2.0.0.orig/Data/CritBit/Tree.hs critbit-0.2.0.0/Data/CritBit/Tree.hs diff --git a/Data/CritBit/Tree.hs b/Data/CritBit/Tree.hs
--- critbit-0.2.0.0.orig/Data/CritBit/Tree.hs 2014-07-04 01:40:10.000000000 -0400 index e50738b..7c1b205 100644
+++ critbit-0.2.0.0/Data/CritBit/Tree.hs 2018-01-07 18:43:26.219082431 -0500 --- a/Data/CritBit/Tree.hs
@@ -1,4 +1,4 @@ +++ b/Data/CritBit/Tree.hs
-{-# LANGUAGE BangPatterns, RecordWildCards, ScopedTypeVariables #-} @@ -153,15 +153,19 @@ import Data.CritBit.Core
+{-# LANGUAGE CPP, BangPatterns, RecordWildCards, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
@@ -153,21 +153,31 @@
import Data.CritBit.Types.Internal import Data.CritBit.Types.Internal
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Data.Monoid (Monoid(..)) import Data.Monoid (Monoid(..))
+#if MIN_VERSION_base(4,9,0)
+import Data.Semigroup (Semigroup(..)) +import Data.Semigroup (Semigroup(..))
+#endif
import Data.Traversable (Traversable(traverse)) import Data.Traversable (Traversable(traverse))
import Prelude hiding (foldl, foldr, lookup, null, map, filter) -import Prelude hiding (foldl, foldr, lookup, null, map, filter)
+import Prelude hiding (foldl, foldr, lookup, null, map, filter, foldl')
import qualified Data.Array as A import qualified Data.Array as A
import qualified Data.Foldable as Foldable import qualified Data.Foldable as Foldable
import qualified Data.List as List import qualified Data.List as List
+#if MIN_VERSION_base(4,9,0)
+instance CritBitKey k => Semigroup (CritBit k v) where +instance CritBitKey k => Semigroup (CritBit k v) where
+ (<>) = union + (<>) = union
+#endif
+ +
instance CritBitKey k => Monoid (CritBit k v) where instance CritBitKey k => Monoid (CritBit k v) where
mempty = empty mempty = empty
+#if !(MIN_VERSION_base(4,11,0)) - mappend = union
mappend = union + mappend = (<>)
+#endif
mconcat = unions mconcat = unions
instance CritBitKey k => Traversable (CritBit k) where instance CritBitKey k => Traversable (CritBit k) where
traverse f m = traverseWithKey (\_ v -> f v) m diff --git a/Data/CritBit/Types/Internal.hs b/Data/CritBit/Types/Internal.hs
index d278b5a..d537ad6 100644
--- a/Data/CritBit/Types/Internal.hs
+++ b/Data/CritBit/Types/Internal.hs
@@ -185,15 +185,25 @@ instance CritBitKey ByteString where
{-# INLINE getByte #-}
-infixl 9 !, \\ instance CritBitKey Text where
+infixl 9 !, \\ -- Comment needed here to avoid CPP bug +#if MIN_VERSION_text(2,0,0)
+ byteCount (Text _ _ len) = len
-- | /O(k)/. Find the value at a key. +#else
-- Calls 'error' when the element can not be found. byteCount (Text _ _ len) = len `shiftL` 1
@@ -1248,8 +1258,7 @@ +#endif
-- > deleteFindMin Error: can not return the minimal element of an empty map {-# INLINE byteCount #-}
deleteFindMin :: CritBit k v -> ((k, v), CritBit k v)
deleteFindMin = fromMaybe (error msg) . minViewWithKey
- where msg = "CritBit.deleteFindMin: cannot return the minimal \
- \element of an empty map"
+ where msg = "CritBit.deleteFindMin: cannot return the minimal element of an empty map"
{-# INLINABLE deleteFindMin #-}
-- | /O(k)/. Delete and find the maximal element. +#if MIN_VERSION_text(2,0,0)
@@ -1258,8 +1267,7 @@ + getByte (Text arr off len) n
-- > deleteFindMax Error: can not return the maximal element of an empty map + | n < len = fromIntegral (T.unsafeIndex arr (off + n)) .|. 256
deleteFindMax :: CritBit k v -> ((k, v), CritBit k v) + | otherwise = 0
deleteFindMax = fromMaybe (error msg) . maxViewWithKey +#else
- where msg = "CritBit.deleteFindMax: cannot return the minimal \ getByte (Text arr off len) n
- \element of an empty map" | n < len `shiftL` 1 =
+ where msg = "CritBit.deleteFindMax: cannot return the minimal element of an empty map" let word = T.unsafeIndex arr (off + (n `shiftR` 1))
{-# INLINABLE deleteFindMax #-} byteInWord = (word `shiftR` ((n .&. 1) `shiftL` 3)) .&. 0xff
in byteInWord .|. 256
| otherwise = 0
+#endif
{-# INLINE getByte #-}
-- | /O(k')/. Retrieves the value associated with minimal key of the #if WORD_SIZE_IN_BITS == 64
diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0.0.9/Crypto/Random/Entropy/Unix.hs diff --git a/Crypto/Random/Entropy/Unix.hs b/Crypto/Random/Entropy/Unix.hs
--- crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs 2015-03-18 09:42:48.000000000 -0400 index 42e7d8c..7777952 100644
+++ crypto-random-0.0.9/Crypto/Random/Entropy/Unix.hs 2018-05-07 10:10:49.039215536 -0400 --- a/Crypto/Random/Entropy/Unix.hs
+++ b/Crypto/Random/Entropy/Unix.hs
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
-- Stability : experimental -- Stability : experimental
-- Portability : Good -- Portability : Good
...@@ -9,7 +10,7 @@ diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0. ...@@ -9,7 +10,7 @@ diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0.
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ScopedTypeVariables #-}
module Crypto.Random.Entropy.Unix module Crypto.Random.Entropy.Unix
( DevRandom ( DevRandom
@@ -22,10 +23,10 @@ @@ -22,10 +23,10 @@ import System.Posix.IO
type H = Fd type H = Fd
type DeviceName = String type DeviceName = String
...@@ -22,7 +23,7 @@ diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0. ...@@ -22,7 +23,7 @@ diff -ru crypto-random-0.0.9.orig/Crypto/Random/Entropy/Unix.hs crypto-random-0.
newtype DevURandom = DevURandom DeviceName newtype DevURandom = DevURandom DeviceName
instance EntropySource DevRandom where instance EntropySource DevRandom where
@@ -48,7 +49,11 @@ @@ -48,7 +49,11 @@ testOpen filepath = do
Just h -> closeDev h >> return (Just filepath) Just h -> closeDev h >> return (Just filepath)
openDev :: String -> IO (Maybe H) openDev :: String -> IO (Maybe H)
......
diff --git a/src/Cryptol/Eval/FFI/GenHeader.hs b/src/Cryptol/Eval/FFI/GenHeader.hs
index b02388f..036b584 100644
--- a/src/Cryptol/Eval/FFI/GenHeader.hs
+++ b/src/Cryptol/Eval/FFI/GenHeader.hs
@@ -9,9 +9,9 @@ module Cryptol.Eval.FFI.GenHeader
) where
import Control.Monad.Writer.Strict
-import Data.Functor
+import Data.Functor ((<&>))
import Data.Char(isAlphaNum)
-import Data.List
+import Data.List (mapAccumL)
import Data.Set (Set)
import qualified Data.Set as Set
import Language.C99.Pretty as C
diff --git a/src/Data/Default/Instances/Base/New.hs b/src/Data/Default/Instances/Base/New.hs
index 52b0a28..a1feb23 100644
--- a/src/Data/Default/Instances/Base/New.hs
+++ b/src/Data/Default/Instances/Base/New.hs
@@ -52,7 +52,9 @@ import Data.Maybe (Maybe(Nothing))
import Data.Semigroup
( Min
, Max
+# if !(MIN_VERSION_base(4,16,0))
, Option(Option)
+# endif
)
#else
import Control.Applicative (Const(Const))
@@ -127,9 +129,11 @@ instance Bounded a => Default (Min a) where
instance Bounded a => Default (Max a) where
def = maxBound
+# if !(MIN_VERSION_base(4,16,0))
-- | @'def' = 'Option' 'Nothing'@
instance Default (Option a) where
def = Option Nothing
+# endif
#endif
-- $providedInstances
diff -ru data-dword-0.3.1.2.orig/src/Data/DoubleWord/TH.hs data-dword-0.3.1.2/src/Data/DoubleWord/TH.hs
--- data-dword-0.3.1.2.orig/src/Data/DoubleWord/TH.hs 2018-01-13 13:49:48.000000000 -0500
+++ data-dword-0.3.1.2/src/Data/DoubleWord/TH.hs 2019-05-02 16:32:16.395011833 -0400
@@ -25,6 +25,9 @@
import Language.Haskell.TH hiding (unpacked, match)
import Data.BinaryWord (BinaryWord(..))
import Data.DoubleWord.Base
+#if MIN_VERSION_template_haskell(2,15,0)
+import Data.List (foldl')
+#endif
-- | Declare signed and unsigned binary word types built from
-- the specified low and high halves. The high halves /must/ have
@@ -1378,8 +1381,12 @@
hi' = mkName "hi'"
lo' = mkName "lo'"
tpT = ConT tp
+
+ tySynInst :: Name -> [Type] -> Type -> Dec
tySynInst n ps t =
-#if MIN_VERSION_template_haskell(2,9,0)
+#if MIN_VERSION_template_haskell(2,15,0)
+ TySynInstD (TySynEqn Nothing (foldl' AppT (ConT n) ps) t)
+#elif MIN_VERSION_template_haskell(2,9,0)
TySynInstD n (TySynEqn ps t)
#else
TySynInstD n ps t
@@ -1448,11 +1455,19 @@
#endif
singE e = appC '(:) [e, ConE '[]]
mkRules = do
- let idRule = RuleP ("fromIntegral/" ++ show tp ++ "->" ++ show tp) []
+ let idRule = RuleP ("fromIntegral/" ++ show tp ++ "->" ++ show tp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
+ []
(VarE 'fromIntegral)
(SigE (VarE 'id) (AppT (AppT ArrowT tpT) tpT))
AllPhases
- signRule = RuleP ("fromIntegral/" ++ show tp ++ "->" ++ show otp) []
+ signRule = RuleP ("fromIntegral/" ++ show tp ++ "->" ++ show otp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
+ []
(VarE 'fromIntegral)
(SigE (VarE (if signed then 'unsignedWord
else 'signedWord))
@@ -1464,11 +1479,17 @@
(VarE 'signExtendLo)
mkRules' rules t narrowE extE signExtE = do
let narrowRule = RuleP ("fromIntegral/" ++ show tp ++ "->" ++ showT t)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE narrowE (AppT (AppT ArrowT tpT) t))
AllPhases
extRule = RuleP ("fromIntegral/" ++ showT t ++ "->" ++ show tp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE extE (AppT (AppT ArrowT t) tpT))
@@ -1476,18 +1497,26 @@
signedRules ← do
insts ← reifyInstances ''SignedWord [t]
case insts of
-#if MIN_VERSION_template_haskell(2,9,0)
+#if MIN_VERSION_template_haskell(2,15,0)
+ [TySynInstD (TySynEqn _ _ signT)] -> return $
+#elif MIN_VERSION_template_haskell(2,9,0)
[TySynInstD _ (TySynEqn _ signT)] → return $
#else
[TySynInstD _ _ signT] → return $
#endif
[ RuleP ("fromIntegral/" ++ show tp ++ "->" ++ showT signT)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE (AppE (appVN '(.) ['signedWord]) narrowE)
(AppT (AppT ArrowT tpT) signT))
AllPhases
, RuleP ("fromIntegral/" ++ showT signT ++ "->" ++ show tp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE signExtE (AppT (AppT ArrowT signT) tpT))
@@ -1501,6 +1530,9 @@
sSmallT = ConT sSmallName in
[ RuleP ("fromIntegral/" ++
show tp ++ "->" ++ show uSmallName)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE (appV '(.) [VarE 'fromIntegral, narrowE])
@@ -1508,6 +1540,9 @@
AllPhases
, RuleP ("fromIntegral/" ++
show uSmallName ++ "->" ++ show tp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE (appV '(.) [extE, VarE 'fromIntegral])
@@ -1515,6 +1550,9 @@
AllPhases
, RuleP ("fromIntegral/" ++
show tp ++ "->" ++ show sSmallName)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE (appV '(.) [VarE 'fromIntegral, narrowE])
@@ -1522,6 +1560,9 @@
AllPhases
, RuleP ("fromIntegral/" ++
show sSmallName ++ "->" ++ show tp)
+#if MIN_VERSION_template_haskell(2,15,0)
+ Nothing
+#endif
[]
(VarE 'fromIntegral)
(SigE (appV '(.) [signExtE, VarE 'fromIntegral])
@@ -1532,7 +1573,9 @@
_ → do
insts ← reifyInstances ''LoWord [t]
case insts of
-#if MIN_VERSION_template_haskell(2,9,0)
+#if MIN_VERSION_template_haskell(2,15,0)
+ [TySynInstD (TySynEqn _ _ t')] ->
+#elif MIN_VERSION_template_haskell(2,9,0)
[TySynInstD _ (TySynEqn _ t')] →
#else
[TySynInstD _ _ t'] →