1-- Initial ifcxt.cabal generated by cabal init. For further documentation,
2-- see http://haskell.org/cabal/users-guide/
6synopsis: put if statements within type constraints
9 This package introduces the @ifCxt@ function,
10 which lets your write if statements that depend on a polymorphic variable's class instances.
11 For example, we can make a version of 'show' that can be called on any type:
15 > cxtShow :: forall a. IfCxt (Show a) => a -> String
16 > cxtShow a = ifCxt (Proxy::Proxy (Show a))
20 Running this function in ghci, we get:
24 >>> cxtShow (1 :: Int)
29 >>> cxtShow (id :: a -> a)
34 See the project webpage http://github.com/mikeizbicki/ifcxt for more details.
36homepage: http://github.com/mikeizbicki/ifcxt
40maintainer: mike@izbicki.me
49 location: http://github.com/mikeizbicki/ifcxt
52 exposed-modules: IfCxt, IfCxt.Examples
61 build-depends: base >=4.8, template-haskell >=2.10
63 default-language: Haskell2010
66 default-language: Haskell2010
67 type: exitcode-stdio-1.0
70 build-depends: base >= 4.8
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list