homepage: http://github.com/isovector/th-dict-discovery/
changelog-type: markdown
hash: 843559520147efdc8af639022bf91bf806c1b65754091141d58a773ad973381b
test-bench-deps: {}
maintainer: sandy@sandymaguire.me
synopsis: Automatically discover available dictionaries at compile time.
changelog: ! '# Revision history for th-dict-discovery


  ## 0.1.0.0  -- YYYY-mm-dd


  * First version. Released on an unsuspecting world.

'
basic-deps:
  base: ! '>=4.9 && <4.10'
  constraints: -any
  template-haskell: -any
all-versions:
- '0.1.0.0'
author: Sandy Maguire
latest: '0.1.0.0'
description-type: haddock
description: ! 'th-dict-discovery is a library to get your hands on the in-scope,
  concrete

  instances of a class. The motivating use-case is to generate property tests to

  automatically prove new instances of a class follow the laws.


  This library uses Template Haskell to provide a list of existentialized ''Dict''s

  for each concrete (entirely monomorphic) instance in scope.


  > defInstances :: [SomeDict1 Default]

  > defInstances = $(someDicts ''''Default)


  These lists can be consumed via

  @withSomeDict1 :: (forall a. c a => Proxy a -> r) -> SomeDict1 c -> r@, for

  example, we can generate hspec tests:


  > spec :: Spec

  > spec = describe "each default instance" .

  >   forM_ defInstances $ withSomeDict1 $ \(_ :: Proxy a) ->

  >     it "shouldn''t be undefined" $

  >       seq (def @a) True `shouldBe` True


  The library also defines up to ''SomeDict8'', with eliminators up to

  ''withSomeDict8''. These correspond to multi-parameter typeclasses with

  first-order, potentially polykinded parameters.


  The TH function ''someDicts'' is smart enough to generate the correct arity of

  ''SomeDictN'' for the class under inspection, but at this time, you''re responsible

  for using the correct ''withSomeDictN'' to consume it.'
license-name: BSD3

Update from Hackage at 2017-12-27T10:04:30Z
Update from Hackage at 2017-12-27T10:04:30Z
