ifcxt/ifcxt.cabal

75 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-09-03 00:56:13 +03:00
-- Initial ifcxt.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/
name: ifcxt
2016-08-04 00:49:53 +03:00
version: 0.1.1
2015-09-03 00:56:13 +03:00
synopsis: put if statements within type constraints
2015-09-03 01:43:16 +03:00
description:
This package introduces the @ifCxt@ function,
which lets your write if statements that depend on a polymorphic variable's class instances.
For example, we can make a version of 'show' that can be called on any type:
.
> cxtShow :: forall a. IfCxt (Show a) => a -> String
> cxtShow a = ifCxt (Proxy::Proxy (Show a))
> (show a)
> "<<unshowable>>"
Running this function in ghci, we get:
.
>>> cxtShow (1 :: Int)
"1"
.
>>> cxtShow (id :: a -> a)
"<<unshowable>>"
.
See the project webpage http://github.com/mikeizbicki/ifcxt for more details.
homepage: http://github.com/mikeizbicki/ifcxt
2015-09-03 00:56:13 +03:00
license: BSD3
license-file: LICENSE
author: Mike Izbicki
maintainer: mike@izbicki.me
-- copyright:
category: Control
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
2015-09-03 01:43:16 +03:00
source-repository head
type: git
location: http://github.com/mikeizbicki/ifcxt
2015-09-03 00:56:13 +03:00
library
exposed-modules: IfCxt, IfCxt.Examples
-- other-modules:
2015-09-03 01:43:16 +03:00
default-extensions:
2015-09-03 00:56:13 +03:00
ConstraintKinds,
2017-11-29 03:00:13 +03:00
CPP,
2015-09-03 00:56:13 +03:00
Rank2Types,
FlexibleInstances,
FlexibleContexts,
TemplateHaskell
2017-11-29 03:00:13 +03:00
build-depends: base >=4.8, template-haskell >=2.10
2015-09-03 00:56:13 +03:00
hs-source-dirs: src
default-language: Haskell2010
2016-02-02 18:18:16 +03:00
test-suite test
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
build-depends: base >= 4.8
, ifcxt
, QuickCheck
, tasty >= 0.7
, tasty-quickcheck