packages feed

flexible-defaults-0.0.2: flexible-defaults.cabal

name:                   flexible-defaults
version:                0.0.2
stability:              provisional

cabal-version:          >= 1.6
build-type:             Simple

author:                 James Cook <mokus@deepbondi.net>
maintainer:             Peter Simons <simons@cryp.to>
license:                PublicDomain
homepage:               https://github.com/peti/flexible-defaults

category:               Code Generation, Template Haskell
synopsis:               Generate default function implementations for complex type classes.
description:            Template Haskell code to implement default implementations
                        for type-class functions based on which functions are
                        already implemented.  Currently extremely crude but
                        still fairly effective.
                        .
                        When defining a type class with many functions, each
                        of which can be implemented based on arbitrary subsets
                        of the others, the standard default-implementation
                        concept breaks down quite badly.  This library provides
                        a system by which more complex rules can be described
                        for choosing default implementations based on which
                        ones the user supplies.  These implementations can
                        additionally be given \"suitability scores\", so that
                        when multiple possible choices could be made, the
                        library can choose the \"best\" one.

extra-source-files:     examples/*.hs

tested-with:            GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3,
                        GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,
                        GHC == 8.4.3

source-repository head
  type:                 git
  location:             https://github.com/peti/flexible-defaults.git

Library
  hs-source-dirs:       src
  ghc-options:          -Wall
  exposed-modules:      Language.Haskell.TH.FlexibleDefaults
  other-modules:        Language.Haskell.TH.FlexibleDefaults.DSL
                        Language.Haskell.TH.FlexibleDefaults.Solve
  build-depends:        base >= 3 && <5,
                        containers,
                        template-haskell,
                        th-extras,
                        transformers
  if !impl(ghc >= 8.0)
    build-depends:      semigroups == 0.18.*