Browse files

cabalized

  • Loading branch information...
1 parent 2a07dee commit 57f4dfe39555d5d5e2f3fb41ba80d66a56779ae3 @ekmett committed Nov 6, 2011
Showing with 83 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +11 −0 Data/Constraint.hs
  3. +30 −0 LICENSE
  4. +40 −0 constraints.cabal
View
2 .gitignore
@@ -0,0 +1,2 @@
+dist
+.git
View
11 Data/Constraint.hs
@@ -29,6 +29,9 @@ module Data.Constraint
-- * Reflection
, Class(..)
, (:=>)(..)
+ -- * Quantification
+ , Forall
+ , inst
-- * Sugar
, applicative
, alternative
@@ -120,6 +123,14 @@ top = Sub Dict
evil :: a :- b
evil = unsafeCoerce refl
+-- skolem variables, do not export!
+data A
+data B
+type Forall (p :: * -> Constraint) = (p A, p B)
+
+inst :: Forall p :- p a
+inst = trans (evil :: p A :- p a) weaken1
+
class Class b h | h -> b where
cls :: h :- b
View
30 LICENSE
@@ -0,0 +1,30 @@
+Copyright 2011 Edward Kmett
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the author nor the names of his contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
View
40 constraints.cabal
@@ -0,0 +1,40 @@
+name: constraints
+category: Constraints
+version: 0.1
+license: BSD3
+cabal-version: >= 1.6
+license-file: LICENSE
+author: Edward A. Kmett
+maintainer: Edward A. Kmett <ekmett@gmail.com>
+stability: experimental
+homepage: http://github.com/ekmett/constraints/
+copyright: Copyright (C) 2011 Edward A. Kmett
+synopsis: Constraint manipulation
+description: Constraint manipulation
+build-type: Simple
+
+source-repository head
+ type: git
+ location: git://github.com/ekmett/constraints.git
+
+library
+ default-language: Haskell2010
+ other-extensions
+ FunctionalDependencies,
+ ScopedTypeVariables,
+ StandaloneDeriving,
+ FlexibleInstances,
+ FlexibleContexts,
+ ConstraintKinds,
+ KindSignatures,
+ TypeOperators,
+ Rank2Types,
+ GADTs
+
+ build-depends:
+ base >= 4.4 && < 5
+
+ exposed-modules:
+ Data.Constraint
+
+ ghc-options: -Wall

0 comments on commit 57f4dfe

Please sign in to comment.