on 10ecfd7 help sign in
7 files changed+149−323
since splitsnapshots
unifiedsplit
.travis.yml+92−26 ChangeLog.md+2−16 README.md−75 src/Control/Monad/Validation.hs+42−167 stack.yaml+2−2 test/Doc.hs−6 validationt.cabal+11−31
.travis.yml+92−26
@@ -1,38 +1,104 @@
1−sudo: true
2−language: haskell
1+# This Travis job script has been generated by a script via
2+#
3+# runghc make_travis_yml_2.hs 'validationt.cabal'
4+#
5+# For more information, see https://github.com/hvr/multi-ghc-travis
6+#
7+language: c
8+sudo: false
39
410git:
5− depth: 5
11+ submodules: false # whether to recursively clone submodules
612
713cache:
814 directories:
9− - "$HOME/.cabal/store"
10− - "$HOME/.stack"
11− - "$TRAVIS_BUILD_DIR/.stack-work"
15+ - $HOME/.cabal/packages
16+ - $HOME/.cabal/store
1217
13−jobs:
18+before_cache:
19+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20+ # remove files that are regenerated by 'cabal update'
21+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
26+
27+ - rm -rfv $HOME/.cabal/packages/head.hackage
28+
29+matrix:
1430 include:
15− - ghc: 8.6.5
16− env: SNAPSHOT="lts-14.22"
17− - ghc: 8.6.4
18− env: SNAPSHOT="lts-13.19"
19− - ghc: 8.6.3
20− env: SNAPSHOT="lts-13.11"
21− - ghc: 8.4.4
22− env: SNAPSHOT="lts-12.26"
31+ - compiler: "ghc-7.10.3"
32+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
33+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
34+ - compiler: "ghc-8.0.2"
35+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
36+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
37+ - compiler: "ghc-8.2.2"
38+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
39+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
40+ - compiler: "ghc-8.4.1"
41+ # env: TEST=--disable-tests BENCH=--disable-benchmarks
42+ addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
2343
24−install:
25− - |
26− # install stack
27− curl -sSL https://get.haskellstack.org/ | sh
44+before_install:
45+ - HC=${CC}
46+ - HCPKG=${HC/ghc/ghc-pkg}
47+ - unset CC
48+ - ROOTDIR=$(pwd)
49+ - mkdir -p $HOME/.local/bin
50+ - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
51+ - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
52+ - echo $HCNUMVER
2853
29− # build project with stack
30− stack --version
31− stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --resolver=$SNAPSHOT
54+install:
55+ - cabal --version
56+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
57+ - BENCH=${BENCH---enable-benchmarks}
58+ - TEST=${TEST---enable-tests}
59+ - HADDOCK=${HADDOCK-true}
60+ - INSTALLED=${INSTALLED-true}
61+ - GHCHEAD=${GHCHEAD-false}
62+ - travis_retry cabal update -v
63+ - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
64+ - rm -fv cabal.project cabal.project.local
65+ - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
66+ - "printf 'packages: \".\"\\n' > cabal.project"
67+ - cat cabal.project
68+ - if [ -f "./configure.ac" ]; then
69+ (cd "." && autoreconf -i);
70+ fi
71+ - rm -f cabal.project.freeze
72+ - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
73+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
74+ - rm -rf .ghc.environment.* "."/dist
75+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
3276
77+# Here starts the actual work to be performed for the package under test;
78+# any command which exits with a non-zero exit code causes the build to fail.
3379script:
34− - |
35− stack test --system-ghc
80+ # test that source-distributions can be generated
81+ - (cd "." && cabal sdist)
82+ - mv "."/dist/validationt-*.tar.gz ${DISTDIR}/
83+ - cd ${DISTDIR} || false
84+ - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
85+ - "printf 'packages: validationt-*/*.cabal\\n' > cabal.project"
86+ - cat cabal.project
87+ # this builds all libraries and executables (without tests/benchmarks)
88+ - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
89+
90+ # Build with installed constraints for packages in global-db
91+ - if $INSTALLED; then echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh; else echo "Not building with installed constraints"; fi
92+
93+ # build & run tests, build benchmarks
94+ - cabal new-build -w ${HC} ${TEST} ${BENCH} all
95+
96+ # cabal check
97+ - (cd validationt-* && cabal check)
98+
99+ # haddock
100+ - rm -rf ./dist-newstyle
101+ - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
36102
37−notifications:
38− email: false
103+# REGENDATA ["validationt.cabal"]
104+# EOF
ChangeLog.md+2−16
@@ -1,19 +1,5 @@
11# Revision history for validationt
22
3−## 0.3.0
3+## 0.1.0.0 -- YYYY-mm-dd
44
5−* Added documentation.
6−* Fixed `textErrors` behaviour.
7−* Dropped `transformers-lift` dependency.
8−
9−## 0.2.1.0
10−
11−* GHC 8.4 support
12−
13−## 0.2.0.0
14−
15−* Fixes
16−
17−## 0.1.0.0
18−
19−* Initial release
5+* First version. Released on an unsuspecting world.
README.mddeleted−75
@@ -1,75 +0,0 @@
1−![Travis CI Badge](https://img.shields.io/travis/typeable/validationt)
2−
3−# ValidationT
4−
5−A very small validation data library.
6−
7−## Usage
8−
9−Suppose you want to validate some data from the user. Say, that the password adheres to some rules.
10−
11−You might do something like this:
12−
13−```haskell
14−validatePassword :: Monad m => String -> ValidationT [String] m ()
15−validatePassword password = do
16− vLength password
17− vAlpha password
18− vNum password
19− where
20− vLength p = when (length p < 8)
21− $ vWarning ["The password should be at least 8 characters long."]
22− vAlpha p = unless (any isAlpha p)
23− $ vWarning ["The password should contain at least one alphabetic character."]
24− vNum p = unless (any isDigit p)
25− $ vWarning ["The password should contain at least one numeric character."]
26−```
27−
28−`ValidationT e m a` essentially just gathers the errors thrown by `vWarning`.
29−
30−```haskell
31−vWarning :: (Monad m, Monoid e) => e -> ValidationT e m ()
32−```
33−
34−`vWarning` `mappend`s the given `e` to the already collected errors. This is why the warnings are contained inside a list.
35−
36−There is also `vError`. The only difference between `vWarning` and `vError` is that `vError` stops further execution (and further collection of errors and warnings).
37−
38−You would use the validation like this:
39−
40−```haskell
41−main :: IO ()
42−main = do
43− password <- getLine
44− result <- runValidationTEither . validatePassword $ password
45− putStrLn $ case result of
46− Left errs -> unlines err
47− Right () -> "You are fine."
48−```
49−
50−You could, of course, do more complicated things like use `vWarningL` and `vErrorL` to add an error to a `mempty` structure, which gets `mappend`ed with other errors.
51−
52−The library comes with a `MonoidMap` `newtype` wrapper around `Map`, which `mappend`s the values themselves on conflict. This can be useful if you have a multiple points of failure and you want to distinguich between them -- validating a username and a password for example:
53−
54−```haskell
55−data Piece
56− = Password
57− | UserName
58− deriving (Eq, Show, Ord)
59−
60−validatePassword :: Monad m => String -> ValidationT (MonoidMap Piece [String]) m ()
61−validatePassword password = do
62− vLength password
63− vAlpha password
64− vNum password
65− where
66− warning = mmSingleton UserName
67− vLength p = when (length p < 8)
68− $ warning ["The password should be at least 8 characters long."]
69− vAlpha p = unless (any isAlpha p)
70− $ warning ["The password should contain at least one alphabetic character."]
71− vNum p = unless (any isDigit p)
72− $ warning ["The password should contain at least one numeric character."]
73−```
74−
75−(`mmSingleton` is a covenience initializer for `MonoidMap`.)
src/Control/Monad/Validation.hs+42−167
@@ -1,73 +1,43 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE GeneralizedNewtypeDeriving #-}
32{-# LANGUAGE OverloadedStrings #-}
43{-# LANGUAGE TemplateHaskell #-}
54{-# LANGUAGE TypeFamilies #-}
6−{-# LANGUAGE UndecidableInstances #-}
75
8−module Control.Monad.Validation
9− ( ValidationT(..)
10− , runValidationT
11− , runValidationTEither
12− , handleValidationT
13− , vError
14− , vWarning
15− , vErrorL
16− , vWarningL
17− , vZoom
18− , vZoomL
19− , mmSingleton
20− , setMempty
21− , neConcat
22− , textErrors
23− , _MonoidMap
24− , MonoidMap(..)
25− ) where
6+module Control.Monad.Validation where
267
27−import Control.Applicative
288import Control.Lens hiding ((.=))
299import Control.Monad.Base
3010import Control.Monad.Catch
3111import Control.Monad.Except
32−import Control.Monad.Fail
3312import Control.Monad.State.Strict
34−import Control.Monad.Trans.Control
13+import Control.Monad.Trans.Lift.Local
3514import Data.Aeson
3615import Data.Foldable as F
37−import Data.Functor
3816import Data.List as L
3917import Data.Map.Strict as M
4018import Data.Monoid
19+import qualified Data.Semigroup as S
4120import Data.Text as T
4221import Data.Vector as V
4322import Test.QuickCheck
4423
45−
46−-- | Collects all thrown warnings in 'StateT' and errors
47−-- in 'ExceptT' into a single value using 'Monoid'.
24+-- | Collects all throwed "warnings" throwed through StateT and "errors" throwed
25+-- through ExceptT to single value using Monoid
26+-- FIXME: give more instances like HReaderT and MonadBaseControl/MonadMask
4827newtype ValidationT e m a = ValidationT
4928 { unValidationT :: ExceptT e (StateT e m) a
5029 } deriving ( Functor, Applicative, Monad, MonadThrow, MonadCatch
51− , MonadBase b, Alternative, MonadFix, MonadFail, Contravariant
52− , MonadIO, MonadPlus, MonadBaseControl b, MonadMask )
30+ , MonadBase b )
5331
5432instance MonadTrans (ValidationT e) where
5533 lift = ValidationT . lift . lift
5634
35+instance LiftLocal (ValidationT e) where
36+ liftLocal _ l f = ValidationT . mapExceptT (mapStateT $ l f) . unValidationT
37+
5738-- | Map with 'Monoid' instance which 'mappend' its values
58−--
59−-- This can be used as the `e` in `ValidationT e m a` to provide different
60−-- sets of errors and warnings for different keys.
61−--
62−-- >>> :{
63−-- mconcat
64−-- [ MonoidMap $ M.fromList [(1, "foo"), (2, "hello, "), (3, "oh no")]
65−-- , MonoidMap $ M.fromList [(1, "bar"), (2, "world")]
66−-- ]
67−-- :}
68−-- MonoidMap (fromList [(1,"foobar"),(2,"hello, world"),(3,"oh no")])
6939newtype MonoidMap k v = MonoidMap (Map k v)
70− deriving (Eq, Ord, Show, Arbitrary, Foldable)
40+ deriving (Eq, Ord, Show, Arbitrary)
7141
7242makePrisms ''MonoidMap
7343
@@ -78,14 +48,14 @@ instance (Ord k) => Ixed (MonoidMap k v) where
7848instance (Ord k) => At (MonoidMap k v) where
7949 at key = _MonoidMap . at key
8050
81−#if MIN_VERSION_base(4,11,0)
82−instance (Ord k, Semigroup v) => Semigroup (MonoidMap k v) where
83− (<>) = mmAppend
84−#endif
51+instance (Ord k, S.Semigroup v) => S.Semigroup (MonoidMap k v) where
52+ (MonoidMap a) <> (MonoidMap b) =
53+ MonoidMap $ M.unionWith (S.<>) a b
8554
8655instance (Ord k, Monoid v) => Monoid (MonoidMap k v) where
8756 mempty = MonoidMap M.empty
88− mappend = mmAppend
57+ mappend (MonoidMap a) (MonoidMap b) =
58+ MonoidMap $ M.unionWith (<>) a b
8959
9060instance (ToJSON k, ToJSON v) => ToJSON (MonoidMap k v) where
9161 toJSON (MonoidMap m) = toJSON $ L.map toObj $ M.toList m
@@ -95,7 +65,7 @@ instance (ToJSON k, ToJSON v) => ToJSON (MonoidMap k v) where
9565 , "value" .= v ]
9666
9767instance (Ord k, FromJSON k, FromJSON v) => FromJSON (MonoidMap k v) where
98− parseJSON = withArray "MonoidMap" go
68+ parseJSON v = withArray "MonoidMap" go v
9969 where
10070 go arr = do
10171 keyvals <- traverse fromObj arr
@@ -105,67 +75,35 @@ instance (Ord k, FromJSON k, FromJSON v) => FromJSON (MonoidMap k v) where
10575 val <- obj .: "value"
10676 return (key, val)
10777
108−#if MIN_VERSION_base(4,11,0)
109−mmAppend :: (Ord k, Semigroup v) => MonoidMap k v -> MonoidMap k v -> MonoidMap k v
110−#else
111−mmAppend :: (Ord k, Monoid v) => MonoidMap k v -> MonoidMap k v -> MonoidMap k v
112−#endif
113−mmAppend (MonoidMap a) (MonoidMap b) = MonoidMap $ M.unionWith (<>) a b
114−
115−-- | Convenient for 'vZoom' as first argument. Will prevent generation
116−-- of map with 'mempty' values.
78+-- | Convenient for 'vZoom' as first artument. Will prevent generation
79+-- of map with 'mempty' values
11780mmSingleton :: (Eq v, Monoid v, Ord k) => k -> v -> MonoidMap k v
118−mmSingleton k v
119− | v == mempty = mempty
120− | otherwise = MonoidMap . M.singleton k $ v
81+mmSingleton k = memptyWrap mempty $ MonoidMap . M.singleton k
12182
122−-- | Sets given value to 'mempty'.
83+-- | Set given value to 'mempty'
12384setMempty :: (Monoid s) => ASetter' s a -> a -> s
12485setMempty setter a = set setter a mempty
12586
126−neConcat :: Foldable f => (a -> a -> a) -> f a -> Maybe a
127−neConcat f a
128− | F.null a = Nothing
129− | otherwise = Just $ F.foldr1 f a
87+memptyWrap :: (Eq a, Monoid a) => b -> (a -> b) -> a -> b
88+memptyWrap b f a
89+ | a == mempty = b
90+ | otherwise = f a
91+
92+-- | If given container is not 'mempty', then use given function to
93+-- append all its elements and return 'Just' result
94+neConcat
95+ :: (Foldable f, Eq (f a), Monoid a, Monoid (f a))
96+ => (a -> a -> a)
97+ -> f a
98+ -> Maybe a
99+neConcat f = memptyWrap Nothing (Just . F.foldl' f mempty)
130100
131−-- | Returns the strings, concatanated with @", "@ if the list is not empty.
132−--
133−-- Returns Nothing if the list is empty
134−--
135−-- >>> textErrors ["foo", "bar"]
136−-- Just "foo, bar"
137−--
138−-- >>> textErrors ["foo"]
139−-- Just "foo"
140−--
141−-- >>> textErrors []
142−-- Nothing
143101textErrors :: [Text] -> Maybe Text
144102textErrors = neConcat (\a b -> a <> ", " <> b)
145103
146−-- | Returns 'mempty' instead of error if no warnings have occured.
147−-- Returns 'Nothing' as the second element of tuple if computation was
148−-- interrupted by 'vError'.
149−--
150−-- Returns all concatenated errors and warnings and the result if no
151−-- errors have occured (warnings could have occured).
152−--
153−-- >>> :{
154−-- runValidationT $ do
155−-- vWarning ["warning1"]
156−-- vError ["error"]
157−-- vWarning ["warning2"]
158−-- return 8
159−-- :}
160−-- (["error","warning1"],Nothing)
161−--
162−-- >>> :{
163−-- runValidationT $ do
164−-- vWarning ["warning1"]
165−-- vWarning ["warning2"]
166−-- return 8
167−-- :}
168−-- (["warning1","warning2"],Just 8)
104+-- | Returns `mempty` instead of error if no warnings was occured. So, your
105+-- error should have `Eq` instance to detect that any error was occured. Returns
106+-- Nothing for second element of tuple if compuration was interruped by 'vError'
169107runValidationT :: (Monoid e, Monad m) => ValidationT e m a -> m (e, Maybe a)
170108runValidationT (ValidationT m) = do
171109 (res, warnings) <- runStateT (runExceptT m) mempty
@@ -173,25 +111,6 @@ runValidationT (ValidationT m) = do
173111 Left err -> (err <> warnings, Nothing)
174112 Right a -> (warnings, Just a)
175113
176−-- | Like 'runValidationT' but doesn't return the result
177−-- if any warning has occured.
178−--
179−-- >>> :{
180−-- runValidationTEither $ do
181−-- vWarning ["warning1"]
182−-- vError ["error"]
183−-- vWarning ["warning2"]
184−-- return 8
185−-- :}
186−-- Left ["error","warning1"]
187−--
188−-- >>> :{
189−-- runValidationTEither $ do
190−-- vWarning ["warning1"]
191−-- vWarning ["warning2"]
192−-- return 8
193−-- :}
194−-- Left ["warning1","warning2"]
195114runValidationTEither
196115 :: (Monoid e, Eq e, Monad m)
197116 => ValidationT e m a
@@ -202,71 +121,28 @@ runValidationTEither action = do
202121 Just a | err == mempty -> Right a
203122 _ -> Left err
204123
205−-- | Like 'runValidationTEither', but takes an error handler instead of
206−-- returning errors and warnings.
207−--
208−-- >>> :{
209−-- handleValidationT (\_ -> return 11) $ do
210−-- vWarning ["warning1"]
211−-- vError ["error"]
212−-- vWarning ["warning2"]
213−-- return 8
214−-- :}
215−-- 11
216−--
217−-- >>> :{
218−-- handleValidationT (\_ -> return 11) $ do
219−-- vWarning ["warning1"]
220−-- vWarning ["warning2"]
221−-- return 8
222−-- :}
223−-- 11
224124handleValidationT
225125 :: (Monoid e, Monad m, Eq e)
226126 => (e -> m a)
227127 -> ValidationT e m a
228128 -> m a
229−handleValidationT handler action =
129+handleValidationT handler action = do
230130 runValidationTEither action >>= either handler return
231131
232−-- | Stops further execution and appends the given error.
132+-- | Stops further execution of validation
233133vError :: (Monad m) => e -> ValidationT e m a
234134vError e = ValidationT $ throwError e
235135
236−-- | Does not stop further execution and appends the given warning.
136+-- | Does not stop further execution, append warning to
237137vWarning :: (Monad m, Monoid e) => e -> ValidationT e m ()
238138vWarning e = ValidationT $ modify' (<> e)
239139
240−-- | Like 'vError' but allows you to use a setter to insert an error somewhere
241−-- deeper into an empty ('mempty') "e" from "ValidationT e m x", which is then
242−-- combined with all gathered warnings.
243140vErrorL :: (Monad m, Monoid e) => ASetter' e a -> a -> ValidationT e m x
244141vErrorL l a = vError $ setMempty l a
245142
246−-- | Like 'vWarning' but allows you to use a setter to insert an error somewhere
247−-- deeper into an empty ('mempty') "e" from "ValidationT e m x", which is then
248−-- combined with all gathered warnings.
249143vWarningL :: (Monad m, Monoid e) => ASetter' e a -> a -> ValidationT e m ()
250144vWarningL l a = vWarning $ setMempty l a
251145
252−-- | Allows you apply a transformation to the "e" in "ValidationT e m x".
253−--
254−-- >>> :{
255−--runValidationT . vZoom (Data.Map.singleton "password errors") $ do
256−-- vWarning ["warning1"]
257−-- vError ["error"]
258−-- vWarning ["warning2"]
259−-- return 8
260−-- :}
261−-- (fromList [("password errors",["error","warning1"])],Nothing)
262−--
263−-- >>> :{
264−-- runValidationT . vZoom (Data.Map.singleton "password errors") $ do
265−-- vWarning ["warning1"]
266−-- vWarning ["warning2"]
267−-- return 8
268−-- :}
269−-- (fromList [("password errors",["warning1","warning2"])],Just 8)
270146vZoom
271147 :: (Monad m, Monoid a, Monoid b)
272148 => (a -> b)
@@ -276,12 +152,11 @@ vZoom up action = do
276152 (err, res) <- lift $ runValidationT action
277153 case res of
278154 Nothing -> vError $ up err
279− Just a -> vWarning (up err) $> a
155+ Just a -> vWarning (up err) *> return a
280156
281−-- | Like 'vZoom' but takes a setter instead of a function.
282157vZoomL
283158 :: (Monad m, Monoid a, Monoid b)
284159 => ASetter' b a
285160 -> ValidationT a m x
286161 -> ValidationT b m x
287−vZoomL l = vZoom (setMempty l)
162+vZoomL l action = vZoom (setMempty l) action
stack.yaml+2−2
@@ -15,7 +15,7 @@
1515# resolver:
1616# name: custom-snapshot
1717# location: "./custom-snapshot.yaml"
18−resolver: lts-14.21
18+resolver: lts-8.14
1919
2020# User packages to be built.
2121# Various formats can be used as shown in the example below.
@@ -63,4 +63,4 @@ extra-package-dbs: []
6363# extra-lib-dirs: [/path/to/dir]
6464#
6565# Allow a newer minor version of GHC than the snapshot specifies
66−# compiler-check: newer-minor
66+# compiler-check: newer-minor
test/Doc.hsdeleted−6
@@ -1,6 +0,0 @@
1−module Main (main) where
2−
3−import Test.DocTest
4−
5−main :: IO ()
6−main = doctest [ "-XOverloadedStrings", "-isrc", "src" ]
validationt.cabal+11−31
@@ -2,10 +2,10 @@
22-- documentation, see http://haskell.org/cabal/users-guide/
33
44name: validationt
5−version: 0.3.0
6−synopsis: Straightforward validation monad.
7−description: Convenient solution for validating web forms and APIs.
8−homepage: https://github.com/typeable/validationt
5+version: 0.2.0.0
6+synopsis: Straightforward validation monad. Convenient solution for validating web forms and APIs.
7+-- description:
8+homepage: typeable.io
99license: BSD3
1010license-file: LICENSE
1111author: Typeable.io contributors
@@ -15,12 +15,10 @@ category: Control
1515build-type: Simple
1616extra-source-files: ChangeLog.md
1717cabal-version: >=1.10
18−tested-with: GHC == 8.4.4
19− , GHC == 8.6.5
20−
21−source-repository head
22− type: git
23− location: git@github.com:typeable/validationt.git
18+tested-with: GHC == 7.10.3
19+ , GHC == 8.0.2
20+ , GHC == 8.2.2
21+ , GHC == 8.4.1
2422
2523library
2624 exposed-modules: Control.Monad.Validation
@@ -35,27 +33,9 @@ library
3533 , text
3634 , transformers
3735 , transformers-base
36+ , transformers-lift
3837 , vector
38+ if impl(ghc < 8.0)
39+ build-depends: semigroups == 0.18.*
3940 hs-source-dirs: src
4041 default-language: Haskell2010
41− ghc-options: -fwarn-unused-binds
42− -Wall
43− -Wincomplete-uni-patterns
44− -Wincomplete-record-updates
45− -Wpartial-fields
46− -Werror=missing-home-modules
47− -Wmissing-home-modules
48− -Widentities
49− -Wredundant-constraints
50− -Wmissing-export-lists
51−
52−test-suite doctest
53− default-language: Haskell2010
54− type: exitcode-stdio-1.0
55− hs-source-dirs: test
56− ghc-options: -Wall
57− main-is: Doc.hs
58− build-depends:
59− base >= 4.10.0.0
60− , doctest >= 0.11.4
61− , validationt