-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathifcxt.cabal
74 lines (59 loc) · 1.88 KB
/
ifcxt.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
-- Initial ifcxt.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/
name: ifcxt
version: 0.1.1
synopsis: put if statements within type constraints
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
license: BSD3
license-file: LICENSE
author: Mike Izbicki
maintainer: [email protected]
-- copyright:
category: Control
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
source-repository head
type: git
location: http://github.com/mikeizbicki/ifcxt
library
exposed-modules: IfCxt, IfCxt.Examples
-- other-modules:
default-extensions:
ConstraintKinds,
CPP,
Rank2Types,
FlexibleInstances,
FlexibleContexts,
TemplateHaskell
build-depends: base >=4.8, template-haskell >=2.10
hs-source-dirs: src
default-language: Haskell2010
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