packages feed

generic-maybe-0.3.0.3: generic-maybe.cabal

-- Initial generic-maybe.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                generic-maybe
version:             0.3.0.3
synopsis:            A generic version of Data.Maybe
description:
 This module is a drop in replacement for 'Data.Maybe'. It generalizes
 the functions to any types that share the same \"sum of products\" view
 of 'Maybe'.
 .
 To use the module for your type, enable GHC's DeriveGeneric extension and
 derive a Generic instance for your type.
 .
 > import GHC.Generics
 > 
 > data Result a = Success a | Fail
 >    deriving (Show, Generic)
 .
 After which you can use the functions, like your type was 'Data.Maybe.Maybe'
 .
 >> fromMaybe 'a' Fail
 >'a'
 . 
 >> fromMaybe 'a' $ Success 'b'
 >'b'
homepage:            https://github.com/jfischoff/generic-maybe
license:             BSD3
license-file:        LICENSE
author:              Jonathan Fischoff
maintainer:          jonathangfischoff@gmail.com
-- copyright:           
category:            Generics
build-type:          Custom
-- extra-source-files:  
cabal-version:       >=1.10

-- You can disable the doctests test suite with -f-test-doctests
flag test-doctests
  default: True
  manual: True
    
-- You can disable the hlint test suite with -f-test-hlint
-- Disabled until the LambdaCase extension is added src-exts
flag test-hlint
  default: True
  manual: True
  
library
  exposed-modules : Data.Generics.Maybe 
  
  other-extensions: TypeOperators
                  , MultiParamTypeClasses
                  , FunctionalDependencies
                  , FlexibleContexts
                  , FlexibleInstances
                  , ScopedTypeVariables
                  
  build-depends: base >=4.5  && < 4.8
               , ghc-prim
               
  hs-source-dirs:      src
  default-language:    Haskell2010
  
  ghc-options: -Wall
  
test-suite doctests
  type:           exitcode-stdio-1.0
  main-is:        doctests.hs
  ghc-options:    -Wall -threaded
  hs-source-dirs: tests
  default-language:    Haskell2010

  if impl(ghc<7.6.1)
     buildable: False

  if !flag(test-doctests)
    buildable: False
  else
    build-depends:
      base,
      bytestring,
      containers,
      directory      >= 1.0,
      deepseq,
      doctest        >= 0.9.1,
      filepath,
      generic-deriving,
      mtl,
      nats,
      parallel,
      semigroups     >= 0.9,
      simple-reflect >= 0.3.1,
      split,
      text,
      unordered-containers,
      vector

  if impl(ghc<7.6.1)
    ghc-options: -Werror
    
test-suite hlint
   type: exitcode-stdio-1.0
   main-is: hlint.hs
--   ghc-options: -w -threaded -rtsopts -with-rtsopts=-N
   hs-source-dirs: tests
   default-language:    Haskell2010

   if !flag(test-hlint)
     buildable: False
   else
     build-depends:
       base,
       hlint >= 1.7
       
test-suite tasty
   type: exitcode-stdio-1.0
   main-is: tasty.hs
   hs-source-dirs: tests, src
   default-language: Haskell2010
   
   build-depends: base
                , ghc-prim
                , deepseq
                , tasty         >= 0.7   && < 0.8
                , tasty-th      >= 0.1.1 && < 0.2
                , tasty-hunit   >= 0.4.1 && < 0.5
                , HUnit         >= 1.2   && < 1.3
   
benchmark bench-builder-all
  type:             exitcode-stdio-1.0
  hs-source-dirs:   src, benchmarks
  main-is:          Reference.hs
  build-depends: base
               , deepseq
               , criterion
  ghc-options: -O2
               -fmax-simplifier-iterations=10
               -fdicts-cheap
               -fspec-constr-count=6