either-both 0.1.0.0 → 0.1.1.0
raw patch · 4 files changed
+41/−3 lines, 4 filesdep +either-primedep +smallcheckdep +tastydep ~basesetup-changed
Dependencies added: either-prime, smallcheck, tasty, tasty-smallcheck
Dependency ranges changed: base
Files
- Data/Either/Both.hs +6/−0
- Setup.hs +0/−2
- either-both.cabal +27/−1
- test/Main.hs +8/−0
Data/Either/Both.hs view
@@ -8,6 +8,12 @@ data Either' a b = JustLeft a | JustRight b | Both a b deriving (Read, Show) +either' :: (a -> c) -> (b -> c) -> (a -> b -> c) -> Either' a b -> c+either' f g h = \ case+ JustLeft a -> f a+ JustRight b -> g b+ Both a b -> h a b+ instance Bifunctor Either' where bimap f g = \ case JustLeft a -> JustLeft (f a) JustRight b -> JustRight (g b)
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
either-both.cabal view
@@ -1,5 +1,5 @@ name: either-both-version: 0.1.0.0+version: 0.1.1.0 synopsis: Either or both -- description: license: BSD3@@ -16,6 +16,32 @@ hs-source-dirs: . exposed-modules: Data.Either.Both build-depends: base >= 4.7 && < 5+ default-language: Haskell2010+ default-extensions: UnicodeSyntax+ , LambdaCase+ , InstanceSigs+ , PartialTypeSignatures+ , PolyKinds+ , ConstraintKinds+ , FlexibleContexts+ , FlexibleInstances+ , StandaloneDeriving+ , DeriveFunctor+ , DeriveFoldable+ , DeriveTraversable+ , OverloadedStrings+ ghc-options: -Wall -Wcompat -Wredundant-constraints -Wno-name-shadowing+ -Wincomplete-record-updates -Wincomplete-uni-patterns++test-suite test+ type: exitcode-stdio-1.0+ hs-source-dirs: test+ main-is: Main.hs+ build-depends: base >=4.11 && <5+ , smallcheck >=1.1.3+ , tasty >=1.0+ , tasty-smallcheck >=0.8+ , either-prime default-language: Haskell2010 default-extensions: UnicodeSyntax , LambdaCase
+ test/Main.hs view
@@ -0,0 +1,8 @@+module Main where++import Test.SmallCheck+import Test.Tasty+import Test.Tasty.SmallCheck++main :: IO ()+main = pure ()