packages feed

open-adt-1.0: open-adt.cabal

name:          open-adt
version:       1.0
cabal-version: >= 1.10
category:      Data
build-type:    Simple
license:       BSD3
license-file:  LICENSE
copyright:     Copyright (c) 2018 Jordan Woehr
maintainer:    Jordan Woehr
homepage:      https://github.com/woehr/open-adt
bug-reports:   https://github.com/woehr/open-adt/issues

synopsis:      Open algebraic data types.

description:   This library, built upon row-types, provides types and functions
               for variants of various functors that all have the same type
               applied to them. This is very similar to, and inspired by,
               <https://github.com/haskus/haskus-utils haskus-utils-variant>.
               At the time of writing, the compile-time performance of
               haskus-utils-variant is poor for variants with many fields, which
               should be improved in this package by using row-types.
               .
               The main types of interest in this package are 'VarF' and
               'OpenADT'. 'VarF' wraps a variant of functors, all over the same
               type, and provides a functor instance that fmaps over whatever
               the variant is. 'OpenADT' is the fixed-point type of 'VarF',
               which allows for recursive structures to be created.
               .
               A convenience function, 'mkVarPattern' from 'Data.OpenADT.TH',
               generates patterns that can be used as constructors for variants.
               The key aspect of these patterns is that they are polymorphic
               in the type of the row, allowing them to be used as constructors
               for any open algebraic data type that includes a particular
               constructor.
               .
               For examples, see the 'Data.OpenADT.Tutorial' module.

tested-with:   GHC == 8.2.1, GHC == 8.2.2,
               GHC == 8.4.1, GHC == 8.4.2, GHC == 8.4.3

source-repository head
  type:     git
  location: https://github.com/woehr/open-adt

library
  build-depends: base              >= 4.9   && < 5
               , constraints       >= 0.8   && < 1
               , recursion-schemes >= 5     && < 6
               , row-types         >= 0.2.3 && < 1
               , template-haskell  >= 2.12  && < 3

  exposed-modules:  Data.OpenADT
                    Data.OpenADT.TH
                    Data.OpenADT.VarF
                    Data.OpenADT.VariantsF

  default-language: Haskell2010
  hs-source-dirs:   lib
  ghc-options:      -Wall
                    -Wcompat
                    -Wincomplete-uni-patterns
                    -Wincomplete-record-updates