superconstraints 0.0.1 → 0.0.2
raw patch · 2 files changed
+9/−7 lines, 2 files
Files
src/Data/Constraint/Super.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeFamilies, ConstraintKinds, Rank2Types, TypeOperators, ScopedTypeVariables, GADTs, TemplateHaskell, LambdaCase #-}+{-# LANGUAGE TypeFamilies, ConstraintKinds, Rank2Types, TypeOperators, ScopedTypeVariables, GADTs, TemplateHaskell, LambdaCase, UndecidableInstances, UndecidableSuperClasses #-} module Data.Constraint.Super where import Data.Proxy (Proxy)@@ -14,11 +14,14 @@ import Language.Haskell.TH.Syntax hiding (lift) -class HasSuper c where+class Super c => HasSuper (c :: Constraint) where type Super c :: Constraint instantiate :: HasSuper c :- c- super :: Proxy c -> Dict (Super c) +{-# DEPRECATED super "super is no longer necessary; the superclasses of a class with HasSuper are now always available" #-}+super :: HasSuper c => Proxy c -> Dict (Super c)+super _ = Dict+ normalizeInstanceHead :: Type -> Q Type normalizeInstanceHead t = do let f :: forall d. Data d => d -> StateT (Integer, Map String Name) Q d@@ -64,7 +67,6 @@ [InstanceD _ cxt t2 _] -> return [InstanceD Nothing cxt (AppT (ConT ''HasSuper) t2) [ TySynInstD ''Super $ TySynEqn [t2] $ foldl AppT (TupleT $ length cxt) cxt- , FunD 'super [Clause [WildP] (NormalB (ConE 'Dict)) []] , FunD 'instantiate [Clause [] (NormalB (AppE (ConE 'Sub) (ConE 'Dict))) []] ] ]
superconstraints.cabal view
@@ -1,11 +1,11 @@ name: superconstraints category: Constraints-version: 0.0.1+version: 0.0.2 license: BSD3 license-file: LICENSE cabal-version: >= 1.10 author: Ryan Trinkle-maintainer: Ryan Trinkle <ryan.trinkle@gmail.com+maintainer: Ryan Trinkle <ryan.trinkle@gmail.com> stability: experimental homepage: http://github.com/ryantrinkle/superconstraints bug-reports: http://github.com/ryantrinkle/superconstraints/issues@@ -17,7 +17,7 @@ source-repository head type: git- location: git://github.com/ryantrinkle/superconstraints.git+ location: https://github.com/ryantrinkle/superconstraints library hs-source-dirs: src