ifcxt/ifcxt.cabal

63 lines
1.6 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
version: 0.1.0.0
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,
Rank2Types,
FlexibleInstances,
FlexibleContexts,
TemplateHaskell
build-depends: base >=4.8 && <4.9, template-haskell >=2.10 && <2.11
hs-source-dirs: src
default-language: Haskell2010