packages feed

generic-maybe-0.1.0.0: 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.1.0.0
synopsis:            A generic version of Data.Maybe
description:
 This module is a drop in replacement for 'Data.Maybe.Maybe'. It generalizes
 the functions to any types that share the same \"sum of products\" view
 of 'Data.Maybe.Maybe'.
 .
 To use the module for you 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
 >Success 'a'
 . 
 >> fromMaybe 'a' $ Success 'b'
 >Success '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: False
  manual: False
  
library
  exposed-modules:     Generics.Maybe
  -- other-modules:       
  other-extensions: DeriveGeneric
                  , TypeFamilies
                  , TypeOperators
                  , MultiParamTypeClasses
                  , FunctionalDependencies
                  , FlexibleContexts
                  , LambdaCase
                  , FlexibleInstances
                  , ConstraintKinds
  build-depends: base >=4.6 && <4.7
               , lens >=3.10 && < 5.0
  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 !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