<commit_before>homepage: https://github.com/parsonsmatt/annotated-exception#readme
changelog-type: markdown
hash: f12cc797f10bf4bf214c8bcbf6db94bd5985a84677e9cd8e067539efa1934d7f
test-bench-deps:
  base: '>=4.7 && <5'
  hspec: -any
  text: -any
  safe-exceptions: -any
  containers: -any
  unliftio-core: -any
  annotated-exception: -any
maintainer: <EMAIL>
synopsis: Exceptions, with checkpoints and context.
changelog: |
  # Changelog for located-exception

  ## Unreleased changes

  ## 0.2.0.0

  - [#12](https://github.com/parsonsmatt/annotated-exception/pull/12)
      - Removed the `Eq` instance for `Annotation` as well as the `Eq` constraint
        in `AnnC`. These instances were only used for testing, and prevented the
        natural use of `CallStack` in a `[Annotation]`.
      - Removed the `Eq` instance for `AnnotatedException` as a consequence of
        dropping the `Eq` instance on `Annotation`.
      - Removed the `new` function. Use `pure` or `exceptionWithCallStack` instead.
      - Fixed a double-annotation bug in `checkpointCallStackWith`.
      - `checkpointCallStack` appends to the call-site list.
      - Pretty much everything now merges the `CallStack`s together. `throw`
        includes a `CallStack`, as do `checkpoint` and `checkpointMany`.

  ## 0.1.2.1

  - [#8](https://github.com/parsonsmatt/annotated-exception/pull/8)
      - There was a bug where catching or trying to catch an exception of the
        wrong type would trigger an infinite loop as the `fromException` method
        kept digging and digging and would be unable to make things work out. The
        `fromException` code no longer tries to flatten out these exceptions.
        However, `toException` *does* flatten it, so all tests still pass.

  ## 0.1.2.0

  - [#6](https://github.com/parsonsmatt/annotated-exception/pull/6)
      - Add `Control.Exception.Annotated.UnliftIO` that uses `MonadUnliftIO`
        instead of `MonadCatch` and `MonadThrow`.
      - Actually expose `catches`

  ## 0.1.1.0

  - [#4](https://github.com/parsonsmatt/annotated-exception/pull/4)
      - Add `catches`
      - Replace `Control.Exception.Safe.try` with `try` that can get an
        `AnnotatedException e` or a regular, un-`Annotated` `e`.

  ## 0.1.0.0

  - Initial Release
basic-deps:
  base: '>=4.7 && <5'
  text: -any
  safe-exceptions: -any
  containers: -any
  unliftio-core: -any
all-versions:
- 0.1.2.1
- 0.2.0.0
author: <NAME>
latest: 0.2.0.0
description-type: markdown
description: |
  # `annotated-exception`

  This library provides a special `AnnotatedException` type which allows you to decorate Haskell exceptions with additional information.
  This decoration is totally transparent, and even works with exceptions thrown outside of your application code.

  To provide an annotation, you'd use the function `checkpoint`.
  This will attach the provided value to any exception that bubbles up through it.

  ```haskell
  import Control.Exception.Annotated

  data MyException = MyException
      deriving (Show, Exception)

  main :: IO ()
  main = do
      checkpoint "Foo" $ do
          throw MyException
  ```

  When this program crashes, it will crash with an `AnnotatedException` that contains the annotation `"Foo"`.

  ```
  λ> checkpoint "Foo" $ throw MyException
  *** Exception: AnnotatedException {annotations = ["Foo"], exception = MyException}
  ```

  These annotations survive, even if you catch and rethrow with a different exception.

  ```haskell
  data OtherException = OtherException
      deriving (Show, Exception)

  woah :: IO ()
  woah = do
      let
          checkpointed =
              checkpoint "Foo" (throw MyException)
          handler MyException =
              throw OtherException

      checkpointed
          `catch`
              handler

  ```

  Notice how the `checkpoint` call doesn't cover the `throw OtherException` - the exception `[Annotation]` lives on the thrown exception itself, and this library's `catch` function ensures that we don't lose that context.

  ```
  λ> (checkpoint "Foo" (throw MyException)) `catch` \MyException -> throw OtherException
  *** Exception: AnnotatedException {annotations = ["Foo"], exception = OtherException}
  ```

  You can also attach a `CallStack` to any exception using `throwWithCallStack`.

  Now, you're about to report your exceptions, up near `main`.
  We can use `try` in this module to always get the annotations.

  ```haskell
  main = do
      eresult <- try $ myProgram
      case eresult of
          Left (AnnotatedException annotations exception) ->
              reportException annotations exception
          Right a ->
              pure a
  ```
license-name: BSD-3-Clause
<commit_msg>Update from Hackage at 2022-04-19T15:30:05Z<commit_after>homepage: https://github.com/parsonsmatt/annotated-exception#readme
changelog-type: markdown
hash: bd6a6d00103c73ec091957f74365a1f619246361af4bd9b9051e7b77f9ced8dd
test-bench-deps:
  base: '>=4.7 && <5'
  hspec: -any
  text: -any
  safe-exceptions: -any
  containers: -any
  unliftio-core: -any
  annotated-exception: -any
maintainer: <EMAIL>
synopsis: Exceptions, with checkpoints and context.
changelog: |
  # Changelog for located-exception

  ## Unreleased changes

  ## 0.2.0.1

  - [#13](https://github.com/parsonsmatt/annotated-exception/pull/13)
      - Fixed a bug in `UnliftIO.catches` where it would infinitely recurse.

  ## 0.2.0.0

  - [#12](https://github.com/parsonsmatt/annotated-exception/pull/12)
      - Removed the `Eq` instance for `Annotation` as well as the `Eq` constraint
        in `AnnC`. These instances were only used for testing, and prevented the
        natural use of `CallStack` in a `[Annotation]`.
      - Removed the `Eq` instance for `AnnotatedException` as a consequence of
        dropping the `Eq` instance on `Annotation`.
      - Removed the `new` function. Use `pure` or `exceptionWithCallStack` instead.
      - Fixed a double-annotation bug in `checkpointCallStackWith`.
      - `checkpointCallStack` appends to the call-site list.
      - Pretty much everything now merges the `CallStack`s together. `throw`
        includes a `CallStack`, as do `checkpoint` and `checkpointMany`.

  ## 0.1.2.1

  - [#8](https://github.com/parsonsmatt/annotated-exception/pull/8)
      - There was a bug where catching or trying to catch an exception of the
        wrong type would trigger an infinite loop as the `fromException` method
        kept digging and digging and would be unable to make things work out. The
        `fromException` code no longer tries to flatten out these exceptions.
        However, `toException` *does* flatten it, so all tests still pass.

  ## 0.1.2.0

  - [#6](https://github.com/parsonsmatt/annotated-exception/pull/6)
      - Add `Control.Exception.Annotated.UnliftIO` that uses `MonadUnliftIO`
        instead of `MonadCatch` and `MonadThrow`.
      - Actually expose `catches`

  ## 0.1.1.0

  - [#4](https://github.com/parsonsmatt/annotated-exception/pull/4)
      - Add `catches`
      - Replace `Control.Exception.Safe.try` with `try` that can get an
        `AnnotatedException e` or a regular, un-`Annotated` `e`.

  ## 0.1.0.0

  - Initial Release
basic-deps:
  base: '>=4.7 && <5'
  text: -any
  safe-exceptions: -any
  containers: -any
  unliftio-core: -any
all-versions:
- 0.1.2.1
- 0.2.0.0
- 0.2.0.1
author: <NAME>
latest: 0.2.0.1
description-type: markdown
description: |
  # `annotated-exception`

  This library provides a special `AnnotatedException` type which allows you to decorate Haskell exceptions with additional information.
  This decoration is totally transparent, and even works with exceptions thrown outside of your application code.

  To provide an annotation, you'd use the function `checkpoint`.
  This will attach the provided value to any exception that bubbles up through it.

  ```haskell
  import Control.Exception.Annotated

  data MyException = MyException
      deriving (Show, Exception)

  main :: IO ()
  main = do
      checkpoint "Foo" $ do
          throw MyException
  ```

  When this program crashes, it will crash with an `AnnotatedException` that contains the annotation `"Foo"`.

  ```
  λ> checkpoint "Foo" $ throw MyException
  *** Exception: AnnotatedException {annotations = ["Foo"], exception = MyException}
  ```

  These annotations survive, even if you catch and rethrow with a different exception.

  ```haskell
  data OtherException = OtherException
      deriving (Show, Exception)

  woah :: IO ()
  woah = do
      let
          checkpointed =
              checkpoint "Foo" (throw MyException)
          handler MyException =
              throw OtherException

      checkpointed
          `catch`
              handler

  ```

  Notice how the `checkpoint` call doesn't cover the `throw OtherException` - the exception `[Annotation]` lives on the thrown exception itself, and this library's `catch` function ensures that we don't lose that context.

  ```
  λ> (checkpoint "Foo" (throw MyException)) `catch` \MyException -> throw OtherException
  *** Exception: AnnotatedException {annotations = ["Foo"], exception = OtherException}
  ```

  You can also attach a `CallStack` to any exception using `throwWithCallStack`.

  Now, you're about to report your exceptions, up near `main`.
  We can use `try` in this module to always get the annotations.

  ```haskell
  main = do
      eresult <- try $ myProgram
      case eresult of
          Left (AnnotatedException annotations exception) ->
              reportException annotations exception
          Right a ->
              pure a
  ```
license-name: BSD-3-Clause

{'fraction_non_alphanumeric': 0.10002077274615705, 'fraction_numerical': 0.02098047361861238, 'mean_word_length': 3.0749047820567075, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 18, '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': '112247', 'n_tokens_mistral': 3035, 'n_tokens_neox': 2824, 'n_words': 981}