name: constraints-emerge
version: 0.1.2
synopsis: Defer instance lookups until runtime
description:
This plugin allows you to write
.
@
{-\# OPTIONS_GHC -fplugin Data.Constraint.Emerge.Plugin \#-}
module Test where
.
import Data.Constraint.Emerge
.
showAnything :: forall c. Emerge (Show c) => c -> String
showAnything c =
case emerge @(Show c) of
Just Dict -> show c
Nothing -> "{{unshowable}}"
@
.
where the 'Emerge (Show c)' will automatically be discharged for any monomorphic 'c'.
.
See <https://github.com/isovector/constraints-emerge/blob/master/test/EmergeSpec.hs test/EmergeSpec.hs>
for a few examples of what this plugin can do for you.
homepage: https://github.com/isovector/constraints-emerge
license: MIT
license-file: LICENSE
author: Sandy Maguire
maintainer: sandy@sandymaguire.me
copyright: 2018 Sandy Maguire
category: Constraints
build-type: Simple
extra-source-files: ChangeLog.md, README.md
cabal-version: >=1.10
tested-with: GHC ==8.0.1, GHC ==8.0.2, GHC ==8.2.2
library
exposed-modules: Data.Constraint.Emerge.Plugin
exposed-modules: Data.Constraint.Emerge
build-depends: base >=4.9 && <5
build-depends: hashable
build-depends: ghc >=8.0.1
build-depends: constraints
build-depends: containers
default-language: Haskell2010
Test-Suite tests
type: exitcode-stdio-1.0
default-language: Haskell2010
other-modules: EmergeSpec
hs-Source-Dirs: test
main-is: Main.hs
build-depends: base >=4.9 && <5, constraints, hspec, constraints-emerge, transformers
source-repository head
type: git
location: git://github.com/isovector/constraints-emerge.git