mirror of
https://github.com/qfpl/applied-fp-course.git
synced 2024-11-26 06:38:40 +03:00
Merge pull request #50 from gwils/support-ghc-8.4.1
Add support for GHC 8.4.1
This commit is contained in:
commit
4dbbf4cc1b
@ -100,7 +100,6 @@ matrix:
|
||||
os: osx
|
||||
|
||||
allow_failures:
|
||||
- env: BUILD=cabal GHCVER=8.4.1 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
- env: BUILD=stack ARGS="--resolver nightly"
|
||||
|
||||
|
@ -60,7 +60,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -82,7 +82,7 @@ executable level01-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level01
|
||||
|
||||
-- Directories containing source files.
|
||||
|
@ -61,7 +61,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -86,7 +86,7 @@ executable level02-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level02
|
||||
|
||||
-- Directories containing source files.
|
||||
|
@ -63,7 +63,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -87,7 +87,7 @@ executable level03-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level03
|
||||
|
||||
-- Directories containing source files.
|
||||
@ -104,7 +104,7 @@ test-suite level03-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Test.hs
|
||||
build-depends: base >= 4.7 && <4.12
|
||||
build-depends: base >= 4.8 && <4.12
|
||||
, level03
|
||||
, wai == 3.2.*
|
||||
, wai-extra == 3.0.*
|
||||
|
@ -69,7 +69,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -101,7 +101,7 @@ executable level04-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level04
|
||||
|
||||
-- Base language which the package is written in.
|
||||
@ -112,7 +112,7 @@ test-suite level04-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Test.hs
|
||||
build-depends: base >= 4.7 && <4.12
|
||||
build-depends: base >= 4.8 && <4.12
|
||||
, level04
|
||||
, wai == 3.2.*
|
||||
, wai-extra == 3.0.*
|
||||
|
@ -69,7 +69,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -93,7 +93,7 @@ executable level05-exe
|
||||
main-is: Main.hs
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level05
|
||||
|
||||
-- Directories containing source files.
|
||||
@ -107,7 +107,7 @@ test-suite level05-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Test.hs
|
||||
build-depends: base >= 4.7 && <4.12
|
||||
build-depends: base >= 4.8 && <4.12
|
||||
, level05
|
||||
, wai == 3.2.*
|
||||
, wai-extra == 3.0.*
|
||||
|
@ -33,6 +33,7 @@ import System.IO.Error (IOError)
|
||||
|
||||
import Data.Monoid (Last,
|
||||
Monoid (mappend, mempty))
|
||||
import Data.Semigroup (Semigroup ((<>)))
|
||||
|
||||
import Data.List (stripPrefix)
|
||||
import Data.Maybe (fromMaybe)
|
||||
@ -214,17 +215,21 @@ data PartialConf = PartialConf
|
||||
, pcDBFilePath :: Last DBFilePath
|
||||
}
|
||||
|
||||
-- Before we can define our ``Monoid`` instance for ``PartialConf``, we'll have
|
||||
-- to define a Semigroup instance. We define our ``(<>)`` function to lean
|
||||
-- on the ``Semigroup`` instance for Last to always get the last value.
|
||||
instance Semigroup PartialConf where
|
||||
_a <> _b = PartialConf
|
||||
{ pcPort = error "pcPort (<>) not implemented"
|
||||
, pcDBFilePath = error "pcDBFilePath (<>) not implemented"
|
||||
}
|
||||
|
||||
-- We now define our ``Monoid`` instance for ``PartialConf``. Allowing us to
|
||||
-- define our always empty configuration, which would always fail our
|
||||
-- requirements. More interestingly, we define our ``mappend`` function to lean
|
||||
-- on the ``Monoid`` instance for Last to always get the last value.
|
||||
-- requirements. We just define `mappend` to be an alias of ``(<>)``
|
||||
instance Monoid PartialConf where
|
||||
mempty = PartialConf mempty mempty
|
||||
|
||||
mappend _a _b = PartialConf
|
||||
{ pcPort = error "pcPort mappend not implemented"
|
||||
, pcDBFilePath = error "pcDBFilePath mappend not implemented"
|
||||
}
|
||||
mappend = (<>)
|
||||
|
||||
-- When it comes to reading the configuration options from the command-line, we
|
||||
-- use the 'optparse-applicative' package. This part of the exercise has already
|
||||
|
@ -72,7 +72,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -105,7 +105,7 @@ executable level06-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level06
|
||||
|
||||
-- Base language which the package is written in.
|
||||
@ -116,7 +116,7 @@ test-suite level06-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Test.hs
|
||||
build-depends: base >= 4.7 && <4.12
|
||||
build-depends: base >= 4.8 && <4.12
|
||||
, level06
|
||||
, mtl == 2.2.*
|
||||
, wai == 3.2.*
|
||||
|
@ -33,7 +33,8 @@ import Data.Text (Text)
|
||||
|
||||
import Data.List (stripPrefix)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Monoid (Last (Last), (<>))
|
||||
import Data.Monoid (Last (Last))
|
||||
import Data.Semigroup (Semigroup ((<>)))
|
||||
|
||||
import Data.Aeson (FromJSON (..), ToJSON,
|
||||
(.:?))
|
||||
@ -206,18 +207,22 @@ data PartialConf = PartialConf
|
||||
, pcDBFilePath :: Last DBFilePath
|
||||
}
|
||||
|
||||
-- We now define our ``Monoid`` instance for ``PartialConf``. Allowing us to
|
||||
-- define our always empty configuration, which would always fail our
|
||||
-- requirements. More interestingly, we define our ``mappend`` function to lean
|
||||
-- on the ``Monoid`` instance for Last to always get the last value.
|
||||
instance Monoid PartialConf where
|
||||
mempty = PartialConf mempty mempty
|
||||
|
||||
mappend a b = PartialConf
|
||||
-- Before we can define our ``Monoid`` instance for ``PartialConf``, we'll have
|
||||
-- to define a Semigroup instance. We define our ``(<>)`` function to lean
|
||||
-- on the ``Semigroup`` instance for Last to always get the last value.
|
||||
instance Semigroup PartialConf where
|
||||
a <> b = PartialConf
|
||||
{ pcPort = pcPort a <> pcPort b
|
||||
, pcDBFilePath = pcDBFilePath a <> pcDBFilePath b
|
||||
}
|
||||
|
||||
-- We now define our ``Monoid`` instance for ``PartialConf``. Allowing us to
|
||||
-- define our always empty configuration, which would always fail our
|
||||
-- requirements. We just define `mappend` to be an alias of ``(<>)``
|
||||
instance Monoid PartialConf where
|
||||
mempty = PartialConf mempty mempty
|
||||
mappend = (<>)
|
||||
|
||||
-- When it comes to reading the configuration options from the command-line, we
|
||||
-- use the 'optparse-applicative' package. This part of the exercise has already
|
||||
-- been completed for you, feel free to have a look through the 'CommandLine'
|
||||
|
@ -72,7 +72,7 @@ library
|
||||
-ferror-spans
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, wai == 3.2.*
|
||||
, warp == 3.2.*
|
||||
, http-types == 0.9.*
|
||||
@ -104,7 +104,7 @@ executable level07-exe
|
||||
-- other-extensions:
|
||||
|
||||
-- Other library packages from which modules are imported.
|
||||
build-depends: base >=4.7 && <4.12
|
||||
build-depends: base >=4.8 && <4.12
|
||||
, level07
|
||||
|
||||
-- Base language which the package is written in.
|
||||
@ -115,7 +115,7 @@ test-suite level07-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: tests
|
||||
main-is: Test.hs
|
||||
build-depends: base >= 4.7 && <4.12
|
||||
build-depends: base >= 4.8 && <4.12
|
||||
, level07
|
||||
, wai == 3.2.*
|
||||
, wai-extra == 3.0.*
|
||||
|
@ -33,7 +33,8 @@ import Data.Text (Text)
|
||||
|
||||
import Data.List (stripPrefix)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Monoid (Last (..), (<>))
|
||||
import Data.Monoid (Last (..))
|
||||
import Data.Semigroup (Semigroup ((<>)))
|
||||
|
||||
import Data.Aeson (ToJSON, FromJSON (..), (.:?))
|
||||
import qualified Data.Aeson as A
|
||||
@ -205,17 +206,21 @@ data PartialConf = PartialConf
|
||||
, pcDBFilePath :: Last DBFilePath
|
||||
}
|
||||
|
||||
-- Before we can define our ``Monoid`` instance for ``PartialConf``, we'll have
|
||||
-- to define a Semigroup instance. We define our ``(<>)`` function to lean
|
||||
-- on the ``Semigroup`` instance for Last to always get the last value.
|
||||
instance Semigroup PartialConf where
|
||||
_a <> _b = PartialConf
|
||||
{ pcPort = error "pcPort (<>) not implemented"
|
||||
, pcDBFilePath = error "pcDBFilePath (<>) not implemented"
|
||||
}
|
||||
|
||||
-- We now define our ``Monoid`` instance for ``PartialConf``. Allowing us to
|
||||
-- define our always empty configuration, which would always fail our
|
||||
-- requirements. More interestingly, we define our ``mappend`` function to lean
|
||||
-- on the ``Monoid`` instance for Last to always get the last value.
|
||||
-- requirements. We just define `mappend` to be an alias of ``(<>)``
|
||||
instance Monoid PartialConf where
|
||||
mempty = PartialConf mempty mempty
|
||||
|
||||
mappend a b = PartialConf
|
||||
{ pcPort = pcPort a <> pcPort b
|
||||
, pcDBFilePath = pcDBFilePath a <> pcDBFilePath b
|
||||
}
|
||||
mappend = (<>)
|
||||
|
||||
-- When it comes to reading the configuration options from the command-line, we
|
||||
-- use the 'optparse-applicative' package. This part of the exercise has already
|
||||
|
Loading…
Reference in New Issue
Block a user