either-n-0.1.0.0: either-n.cabal
cabal-version: 2.4
name: either-n
version: 0.1.0.0
license: BSD-3-Clause
license-file: LICENCE
author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>
copyright: Copyright (c) 2026 Tony Morris
synopsis: Data types like Either but with more constructors
category: Data
description:
<<https://logo.systemf.com.au/systemf-450x450.png>>
.
Data types like @Either@ but with more constructors, and optics for the
constructors of any sum type.
.
== @Either3@
.
@Either3 a b c@ is a value of one of three types, with the constructors
@First3@, @Second3@ and @Third3@. The @Functor@, @Applicative@ and @Monad@
instances act on the third type parameter, so @First3@ and @Second3@
short-circuit, in the same way @Left@ does for @Either@.
.
== @Either3T@
.
@Either3T f a b c@ is an @Either3@ inside a type constructor @f@, in the
same way that @ExceptT e m a@ is @m (Either e a)@. Use @_Wrapped@ to convert
between @Either3T f a b c@ and @f (Either3 a b c)@. The @mtl@ classes are
lifted from @f@.
.
== Injections
.
@Data.Lens.Injection@ provides the classes @Injection1@ to @Injection19@,
the sum-type duals of @Field1@ to @Field19@ from @lens@. Where @_1@ is a lens
to the first field of a product, @_I1@ is a prism to the first constructor
of a sum. Each class has a default implementation for any type with a
@Generic@ instance.
homepage: https://gitlab.com/tonymorris/either-n
bug-reports: https://gitlab.com/tonymorris/either-n/issues
build-type: Simple
extra-doc-files: README.md
changelog.md
tested-with: GHC == 9.14.1, GHC == 9.12.4, GHC == 9.10.3, GHC == 9.8.4, GHC == 9.6.7
source-repository head
type: git
location: https://gitlab.com/tonymorris/either-n.git
flag doctest
description: Build the doctest test suite, which runs doctest through cabal. It is enabled in cabal.project, and disabled by default so that builds from the source distribution do not need cabal or doctest at test time.
default: False
manual: True
library
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, assoc >= 1.1 && < 2
, deepseq >= 1.4.8.1 && < 2
, selective >= 0.7 && < 1
, semigroupoids >= 6.0.0.1 && < 7
, lens >= 5.2.1 && < 6
, mtl >= 2.3.1 && < 2.4
ghc-options:
-Wall
hs-source-dirs:
src
exposed-modules:
Data.Either3
Data.Either3.Either3
Data.Either3.Either3T
Data.Lens.Injection
Data.Lens.Injection.Generic
Data.Lens.Injection.Generic.Internal
Data.Lens.Injection.Injection1
Data.Lens.Injection.Injection2
Data.Lens.Injection.Injection3
Data.Lens.Injection.Injection4
Data.Lens.Injection.Injection5
Data.Lens.Injection.Injection6
Data.Lens.Injection.Injection7
Data.Lens.Injection.Injection8
Data.Lens.Injection.Injection9
Data.Lens.Injection.Injection10
Data.Lens.Injection.Injection11
Data.Lens.Injection.Injection12
Data.Lens.Injection.Injection13
Data.Lens.Injection.Injection14
Data.Lens.Injection.Injection15
Data.Lens.Injection.Injection16
Data.Lens.Injection.Injection17
Data.Lens.Injection.Injection18
Data.Lens.Injection.Injection19
test-suite hedgehog
type:
exitcode-stdio-1.0
main-is:
hedgehog_tests.hs
other-modules:
Either3Tests
Either3TTests
Gens
Laws
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, assoc >= 1.1 && < 2
, deepseq >= 1.4.8.1 && < 2
, hedgehog >= 1.2 && < 2
, hedgehog-fn >= 1.1 && < 2
, lens >= 5.2.1 && < 6
, mtl >= 2.3.1 && < 2.4
, selective >= 0.7 && < 1
, semigroupoids >= 6.0.0.1 && < 7
, either-n
ghc-options:
-Wall
-threaded
hs-source-dirs:
test
test-suite doctest
type:
exitcode-stdio-1.0
if !flag(doctest)
buildable: False
main-is:
doctest_tests.hs
default-language:
Haskell2010
build-depends:
base >= 4.18 && < 5
, process >= 1.6.19.0 && < 2
, either-n
ghc-options:
-Wall
-threaded
hs-source-dirs:
test