poly-arity 0.0.7 → 0.1.0
raw patch · 2 files changed
+9/−4 lines, 2 filesdep −HListPVP ok
version bump matches the API change (PVP)
Dependencies removed: HList
API changes (from Hackage documentation)
+ Data.Function.Poly: [HCons] :: (x :: *) -> HList xs -> HList (x : xs)
+ Data.Function.Poly: [HNil] :: HList '[]
+ Data.Function.Poly: data HList (xs :: [*])
Files
- poly-arity.cabal +1/−2
- src/Data/Function/Poly.hs +8/−2
poly-arity.cabal view
@@ -1,5 +1,5 @@ Name: poly-arity-Version: 0.0.7+Version: 0.1.0 Author: Athan Clark <athan.clark@gmail.com> Maintainer: Athan Clark <athan.clark@gmail.com> License: BSD3@@ -17,7 +17,6 @@ Exposed-Modules: Data.Function.Poly Build-Depends: base >= 4.6 && < 5 , constraints- , HList >= 0.4 Source-Repository head Type: git
src/Data/Function/Poly.hs view
@@ -10,12 +10,12 @@ , PolyKinds , FlexibleInstances , UndecidableInstances+ , UndecidableSuperClasses #-} module Data.Function.Poly where import Data.Constraint-import Data.HList -- | Provide a type-level list of /types/ @xs@, and a final result type @r@, -- construct a chain of arrows @->@ / n-ary function (which is right-associative)@@ -79,6 +79,11 @@ Tail (x ': xs) = xs +data HList (xs :: [*]) where+ HNil :: HList '[]+ HCons :: (x :: *) -> HList xs -> HList (x ': xs)++ -- | Lift the @HList@'s internal type-level list of types to a constraint context. class ExpectArity xs f => ConsumeArity (xs :: [*]) (f :: *) result | xs f -> result where -- | Use a /heterogeneously-typed/ list of values as input to an n-ary function,@@ -89,7 +94,8 @@ appN r _ = r instance ( ConsumeArity xs f r- , ExpectArity (x ': xs) (x -> f) )=> ConsumeArity (x ': xs) (x -> f) r where+ , ExpectArity (x ': xs) (x -> f)+ ) => ConsumeArity (x ': xs) (x -> f) r where appN f (HCons x xs) = appN (f x) xs