-- 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) > "<>" Running this function in ghci, we get: . >>> cxtShow (1 :: Int) "1" . >>> cxtShow (id :: a -> a) "<>" . 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: mike@izbicki.me -- 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, Rank2Types, FlexibleInstances, FlexibleContexts, TemplateHaskell build-depends: base >=4.8 && <4.9, template-haskell >=2.10 && <2.11 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