<commit_before>homepage: https://github.com/isomorphism/these
changelog-type: markdown
hash: 84f27d83c06f14bb1eb8532645075093935ed3c877bbe68c3eeb624a446286c4
test-bench-deps:
  these: -any
  base: -any
  unordered-containers: -any
  containers: -any
  lens: -any
  quickcheck-instances: ! '>=0.3.15 && <0.4'
  base-compat: -any
  bifunctors: -any
  binary: -any
  tasty-quickcheck: ! '>=0.10 && <0.11'
  hashable: -any
  transformers: -any
  tasty: ! '>=1.2 && <1.3'
  QuickCheck: -any
  aeson: -any
  vector: -any
maintainer: <EMAIL>
synopsis: An either-or-both data type & a generalized 'zip with padding' typeclass
changelog: |
  # 0.8.1

  - Add `Semialign` `Tree`, `Tagged`, `(->) e`; `Align` `Compose` and `Proxy` instances
  - Allow `semigroups-0.19` and `hashable-1.3`

  # 0.8.0

  - Split `align` and `alignWith` into own class: `Semialign`.
  - `ialign` has default implementation
  - Add `Semialign` `NonEmpty` and `Identity` instances
  - Add `Swap` and `Assoc` instances (type classes from `assoc` package)
  - Move optics into `Data.These.Lens` module,
    and and some combinators `Data.These.Combinators`.
    Also some combinators are renamed, so naming is now consistent.
    As the result `Data.These` has very minimal exports.
  - Change type of `partitionThese` (nested pairs to triple)
  - Add `partitionHereThere :: [These a b] -> ([a],[b])`

  # 0.7.6

  - Tigthen lower bounds
  - Add dependency on `lens`
  - Add `assoc`, `reassoc`, `swap` and `Swapped` instance
  - Add since annotations for things added in 0.7.x
  - Add `AlignWithKey ZipList` instance
  - Add `Data.Align.Indexed` module.
  - Add `Data.Functor.These` with `These1` data type.
  - Add associativity law
  - Add `toList` property to enforce "align"-feel.
  - `Map` and `IntMap` `Align` instances implemented using merge combinators
    (when available)

  # 0.7.5

  - Add `Compose` and `(,)` `Crosswalk` instances
  - Add `bitraverseThese`
  - GHC-8.6 support

  # 0.7.4

  - `QuickCheck-2.10` support: `Arbitrary1/2` instances
  - GHC-8.2 support

  # 0.7.3

  - Add `salign :: (Align f, Semigroup a) => f a -> f a -> f a`

  # 0.7.2

  - Support `aeson-1`: add `FromJSON1`, `FromJSON2` `ToJSON1`, and `ToJSON2` `These` instances.

  # 0.7.1

  - Add `AlignWithKey` in `Data.Align.Key` (added dependency `keys`)
  - Add `These` instances for
      - `binary`: `Binary`
      - `aeson`: `FromJSON`, `ToJSON`
      - `QuickCheck`: `Arbitrary`, `CoArbitrary`, `Function`
      - `deepseq`: `NFData`

  # 0.7

  - Breaking change: Generalized `Monad`, `Applicative` instances of `These` and `Chronicle` to require only a `Semigroup` constraint
  - More efficient `Align Seq` implementation
  - Add `Crosswalk Seq` and `Vector` instances

  # 0.6.2.1

  - Support quickcheck-instances-0.3.12 (tests)

  # 0.6.2.0

  - Add support to bifunctors-5.1
basic-deps:
  semigroupoids: ! '>=5.3.1 && <5.4'
  base: ! '>=4.5.1.0 && <4.13'
  data-default-class: ! '>=0.1.2.0 && <0.2'
  unordered-containers: ! '>=0.2.8.0 && <0.3'
  assoc: ! '>=1 && <1.1'
  vector-instances: ! '>=3.4 && <3.5'
  tagged: ! '>=0.8.6 && <0.9'
  containers: ! '>=0.4.2.1 && <0.7'
  keys: ! '>=3.12.1 && <3.13'
  lens: ! '>=4.17 && <4.18'
  base-compat: ! '>=0.10.5 && <0.11'
  bifunctors: ! '>=5.5.3 && <5.6'
  binary: ! '>=0.5.1.0 && <0.10'
  mtl: ! '>=2.1.3 && <2.3'
  hashable: ! '>=1.2.7.0 && <1.4'
  transformers: ! '>=0.4.2.0 && <0.6'
  deepseq: ! '>=1.3.0.0 && <1.5'
  QuickCheck: ! '>=2.12.6.1 && <2.14'
  aeson: ! '>=1.4.2.0 && <1.5'
  transformers-compat: ! '>=0.6.2 && <0.7'
  vector: ! '>=0.12.0.2 && <0.13'
all-versions:
- '0.2'
- '0.3'
- '0.4'
- 0.4.1
- 0.4.2
- 0.6.0.0
- 0.6.1.0
- 0.6.2.0
- 0.6.2.1
- '0.7'
- 0.7.1
- 0.7.2
- 0.7.3
- 0.7.4
- 0.7.5
- 0.7.6
- '0.8'
- 0.8.1
author: <NAME>
latest: 0.8.1
description-type: markdown
description: "These &mdash; an either-or-both data type\n====================================\n\n[![Build
  Status](https://secure.travis-ci.org/isomorphism/these.svg)](http://travis-ci.org/isomorphism/these)\n\n\nThe
  type `These a b` represents having either a value of type `a`, a value of type `b`,
  or values of both `a` and `b`:\n\n```haskell\ndata These a b = This a | That b |
  These a b\n```\n\nThis is equivalent to `Either (a, b) (Either a b)`. Or equivalent
  to `Either a (b, Maybe a)`. Or various other equally equivalent types. In terms
  of \"sum\" and \"product\" types, `These a b` is `a + b + ab` which can't be factored
  cleanly to get a type that mentions `a` and `b` only once each.\n\nThe fact that
  there's no single obvious way to express it as a combination of existing types is
  one primary motivation for this package.\n\nA variety of functions are provided
  in `Data.These` akin to those in `Data.Either`, except somewhat more numerous on
  account of having more cases to consider. Most should be self-explanatory if you're
  already familiar with the similarly-named functions in `Data.Either` and `Data.Maybe`.\n\n`here`
  and `there` are traversals over elements of the same type, suitable for use with
  `Control.Lens`. This has the dramatic benefit that if you're using `lens` you can
  ignore the dreadfully bland `mapThis` and `mapThat` functions in favor of saying
  `over here` and `over there`.\n\n\nAlign &mdash; structural unions\n==========================\n\nThere
  is a notion of \"zippy\" `Applicative`s where `liftA2 (,)` behaves like `zip` in
  the sense that if the `Functor` is regarded as a container with distinct locations,
  each element of the result is a pair of the values that occupied the same location
  in the two inputs. For this to be possible, the result can only contain values at
  locations where both inputs also contained values. In a sense, this is the intersection
  of the \"shapes\" of the two inputs.\n\nIn the case of the `zip` function itself,
  this means the length of the result is equal to the length of the shorter of the
  two inputs.\n\nOn many occasions it would be more useful to have a \"zip with padding\",
  where the length of the result is that of the *longer* input, with the other input
  extended by some means. The best way to do this is a recurring question, having
  been asked [at](http://stackoverflow.com/q/21349408/157360) [least](http://stackoverflow.com/q/22403029/157360)
  [four](http://stackoverflow.com/q/3015962/157360) [times](http://stackoverflow.com/q/9198410/157360)
  on Stack Overflow. \n\nProbably the most obvious general-purpose solution is use
  `Maybe` so that the result is of type `[(Maybe a, Maybe b)]`, but this forces any
  code using that result to consider the possibility of the list containing the value
  `(Nothing, Nothing)`, which we don't want.\n\nThe type class `Align` is here because
  `f (These a b)` is the natural result type of a generic \"zip with padding\" operation--i.e.
  a structural union rather than intersection. \n\nI believe the name \"Align\" was
  borrowed from [a blog post by <NAME>](http://pchiusano.blogspot.com/2010/06/alignable-functors-typeclass-for-zippy.html),
  though he used `Alignable` instead.\n\n\nUnalign\n-------\n\n`unalign` is to `align`
  as `unzip` is to `zip`. The `Unalign` class itself does nothing, as `unalign` can
  be defined for any `Functor`; an instance just documents that `unalign` behaves
  properly as an inverse to `align`.\n\nCrosswalk\n---------\n\n`Crosswalk` is to
  `Align` as `Traversable` is to `Applicative`. That's really all there is to say
  on the matter.\n\n\nBicrosswalk\n-----------\n\n```\n<cmccann> elliott, you should
  think of some more instances for Bicrosswalk one of these days\n<shachaf> cmccann:
  Does it have any instances?\n<elliott> cmccann: unfortunately it is too perfect
  an abstraction to be useful.\n```\n\nChronicleT &mdash; a.k.a. These as a monad\n=====================================\n\n`These
  a` has an obvious `Monad` instance, provided here in monad transformer form.\n\nThe
  expected use case is for computations with a notion of fatal vs. non-fatal errors,
  like a hybrid writer/exception monad. While running successfully a computation carries
  a \"record\" of type `c`, which accumulates using a `Monoid` instance (as with the
  writer monad); if a computation fails completely, the result is its record up to
  the point where it ended.\n\nA more specific example would be something like parsing
  ill-formed input with the goal of extracting as much as you can and throwing out
  anything you can't interpret.\n\n\n\n"
license-name: BSD-3-Clause<commit_msg>Update from Hackage at 2019-06-02T10:51:44Z<commit_after>homepage: https://github.com/isomorphism/these
changelog-type: markdown
hash: 1b4255898c5ebb8ad93a831eed84025c090b50a0af6bb5b7a05b540cbd6b377f
test-bench-deps: {}
maintainer: <NAME> <<EMAIL>>
synopsis: An either-or-both data type.
changelog: |
  # 1

  This is major package reogranisation. Old `these` were split into

  - `these` providing only `These` type and some combinators
  - `these-lens` providing *lens* combinators
  - `semialign` providing `Semialign`, `Align`, `Zip`, `Unalign` and `Unzip` classes
  - `semialign-indexed` providing `SemialignWithIndex` (`izipWith` and `ialignWith` members).
  - `monad-chronicle` providing `ChronicleT` and `MonadChronicle`

  Also noticeable change is `unalign :: f (These a b) -> (f a, f b)`.
  For the old `f (These a b) -> (f (Maybe a), f (Maybe b))` use `unzipWith (unalign . Just)`.

  - Many instances are added.
  - Since annotations are removed for all but `these` package.

  # 0.8.1

  - Add `Semialign` `Tree`, `Tagged`, `(->) e`; `Align` `Compose` and `Proxy` instances
  - Allow `semigroups-0.19` and `hashable-1.3`

  # 0.8.0

  - Split `align` and `alignWith` into own class: `Semialign`.
  - `ialign` has default implementation
  - Add `Semialign` `NonEmpty` and `Identity` instances
  - Add `Swap` and `Assoc` instances (type classes from `assoc` package)
  - Move optics into `Data.These.Lens` module,
    and and some combinators `Data.These.Combinators`.
    Also some combinators are renamed, so naming is now consistent.
    As the result `Data.These` has very minimal exports.
  - Change type of `partitionThese` (nested pairs to triple)
  - Add `partitionHereThere :: [These a b] -> ([a],[b])`

  # 0.7.6

  - Tigthen lower bounds
  - Add dependency on `lens`
  - Add `assoc`, `reassoc`, `swap` and `Swapped` instance
  - Add since annotations for things added in 0.7.x
  - Add `AlignWithKey ZipList` instance
  - Add `Data.Align.Indexed` module.
  - Add `Data.Functor.These` with `These1` data type.
  - Add associativity law
  - Add `toList` property to enforce "align"-feel.
  - `Map` and `IntMap` `Align` instances implemented using merge combinators
    (when available)

  # 0.7.5

  - Add `Compose` and `(,)` `Crosswalk` instances
  - Add `bitraverseThese`
  - GHC-8.6 support

  # 0.7.4

  - `QuickCheck-2.10` support: `Arbitrary1/2` instances
  - GHC-8.2 support

  # 0.7.3

  - Add `salign :: (Align f, Semigroup a) => f a -> f a -> f a`

  # 0.7.2

  - Support `aeson-1`: add `FromJSON1`, `FromJSON2` `ToJSON1`, and `ToJSON2` `These` instances.

  # 0.7.1

  - Add `AlignWithKey` in `Data.Align.Key` (added dependency `keys`)
  - Add `These` instances for
      - `binary`: `Binary`
      - `aeson`: `FromJSON`, `ToJSON`
      - `QuickCheck`: `Arbitrary`, `CoArbitrary`, `Function`
      - `deepseq`: `NFData`

  # 0.7

  - Breaking change: Generalized `Monad`, `Applicative` instances of `These` and `Chronicle` to require only a `Semigroup` constraint
  - More efficient `Align Seq` implementation
  - Add `Crosswalk Seq` and `Vector` instances

  # 0.6.2.1

  - Support quickcheck-instances-0.3.12 (tests)

  # 0.6.2.0

  - Add support to bifunctors-5.1
basic-deps:
  semigroupoids: ! '>=5.3.2 && <5.4'
  base: ! '>=4.5.1.0 && <4.13'
  unordered-containers: ! '>=0.2.8.0 && <0.3'
  assoc: ! '>=1 && <1.1'
  base-compat: ! '>=0.10.5 && <0.11'
  bifunctors: ! '>=5.5.4 && <5.6'
  binary: ! '>=0.5.1.0 && <0.10'
  hashable: ! '>=1.2.7.0 && <1.4'
  deepseq: ! '>=1.3.0.0 && <1.5'
  QuickCheck: ! '>=2.12.6.1 && <2.14'
  aeson: ! '>=1.4.2.0 && <1.5'
all-versions:
- '0.2'
- '0.3'
- '0.4'
- 0.4.1
- 0.4.2
- 0.6.0.0
- 0.6.1.0
- 0.6.2.0
- 0.6.2.1
- '0.7'
- 0.7.1
- 0.7.2
- 0.7.3
- 0.7.4
- 0.7.5
- 0.7.6
- '0.8'
- 0.8.1
- '1'
author: <NAME>, <NAME>
latest: '1'
description-type: haddock
description: |-
  This package provides a data type @These a b@ which can hold a value of either
  type or values of each type. This is usually thought of as an "inclusive or"
  type (contrasting @Either a b@ as "exclusive or") or as an "outer join" type
  (contrasting @(a, b)@ as "inner join").

  @
  data These a b = This a | That b | These a b
  @

  Since version 1, this package was split into parts:

  * <https://hackage.haskell.org/package/semialign semialign> For @Align@ and @Zip@ type-classes.

  * <https://hackage.haskell.org/package/semialign-indexed semialign-indexed> For @SemialignWithIndex@ class, providing @ialignWith@ and @izipWith@.

  * <https://hackage.haskell.org/package/these-lens these-lens> For lens combinators.

  * <http://hackage.haskell.org/package/monad-chronicle monad-chronicle> For transformers variant of @These@.
license-name: BSD-3-Clause
{'fraction_non_alphanumeric': 0.15722937168811507, 'fraction_numerical': 0.045571536714610145, 'mean_word_length': 3.2520115867396204, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 65, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 30, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '200027', 'n_tokens_mistral': 5164, 'n_tokens_neox': 4832, 'n_words': 1543}