homepage: ''
changelog-type: markdown
hash: 05d070908879b36e612657ce2c3731533d23ba8cc3bbc88802b1464ffccc5012
test-bench-deps:
  base: -any
  matchable: -any
  containers: -any
  matchable-th: -any
maintainer: viercc@gmail.com
synopsis: Generates Matchable instances using TemplateHaskell
changelog: |
  # 0.1.0.0

  - Initial release.
basic-deps:
  base: ! '>=4.9 && <5'
  th-abstraction: -any
  matchable: ! '>=0.1.2'
  template-haskell: ! '>=2.4 && <2.15'
all-versions:
- 0.1.0.0
author: Koji Miyazato
latest: 0.1.0.0
description-type: markdown
description: |
  ## matchable-th

  This package provides TemplateHaskell functions to
  generate instances of `Matchable` and `Bimatchable` type classes,
  which are from `matchable` package.

  ### Example

  ``` haskell
  {-# LANGUAGE DeriveFunctor #-}
  {-# LANGUAGE TemplateHaskell #-}

  import Data.Functor.Classes (Eq1(..))
  import Data.Matchable
  import Data.Matchable.TH

  newtype G a = G [(a, Int, a)]
    deriving (Show, Eq, Functor)

  $(deriveMatchable ''G)

  -- @deriveMatchable@ generates a @Matchable@ instance only,
  -- so you also have to declare @Functor G@ and @Eq1 G@.
  -- There is a handy @DeriveFunctor@ extension.
  -- Also, you can use @liftEqDefault@ to easily implement @liftEq@.
  instance Eq1 G where
    liftEq = liftEqDefault
  ```

  ``` haskell
  {-# LANGUAGE TemplateHaskell #-}

  import Data.Functor.Classes (Eq2(..))
  import Data.Bimatchable
  import Data.Matchable.TH

  data BiG a b = BiG0 | BiG1 [a] [b] | BiG2 (Int, BiF a b)

  instance Eq2 BiG where
    liftEq2 = liftEq2Default

  instance Bifunctor BiG where
    bimap = bimapRecovered

  $(deriveBimatchable ''BiG)
  ```
license-name: BSD-3-Clause

Update from Hackage at 2019-01-07T09:41:51Z
Update from Hackage at 2019-01-07T09:41:51Z
