extensible 0.4.10 → 0.4.10.1
raw patch · 7 files changed
+62/−36 lines, 7 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Extensible.Bits: instance (Data.Extensible.Bits.FromBits r a, Data.Extensible.Bits.FromBits r b, n ~ (Data.Extensible.Bits.BitWidth a GHC.TypeNats.+ Data.Extensible.Bits.BitWidth b), n GHC.TypeNats.<= Data.Extensible.Bits.BitWidth r, GHC.TypeNats.KnownNat n) => Data.Extensible.Bits.FromBits r (a, b)
- Data.Extensible.Class: -> *) (xs :: [k]) (x :: k) :: Constraint;
- Data.Extensible.Class: type >: = '(:>)
- Data.Extensible.Inclusion: instance forall k1 v1 (xs :: [Data.Extensible.Internal.Assoc k1 v1]) (t :: Data.Extensible.Internal.Assoc k1 v1) (k2 :: k1) (v2 :: v1). (Data.Extensible.Inclusion.Associated' xs t, t ~ (k2 'Data.Extensible.Internal.:> v2)) => Data.Extensible.Inclusion.Associated xs t
- Data.Extensible.Internal: instance forall k (x :: k) (xs :: [k]) (pos :: GHC.Types.Nat). (Data.Extensible.Internal.Elaborate x (Data.Extensible.Internal.FindType x xs) ~ 'Data.Extensible.Internal.Expecting pos, GHC.TypeNats.KnownNat pos) => Data.Extensible.Internal.Member xs x
- Data.Extensible.Internal: instance forall v1 k1 (k2 :: k1) (xs :: [Data.Extensible.Internal.Assoc k1 v1]) (n :: GHC.Types.Nat) (v2 :: v1). (Data.Extensible.Internal.Elaborate k2 (Data.Extensible.Internal.FindAssoc 0 k2 xs) ~ 'Data.Extensible.Internal.Expecting (n 'Data.Extensible.Internal.:> v2), GHC.TypeNats.KnownNat n) => Data.Extensible.Internal.Associate k2 v2 xs
- Data.Extensible.Internal: type >: = '(:>)
- Data.Extensible.Label: instance (k ~ l) => GHC.OverloadedLabels.IsLabel k (Data.Proxy.Proxy l)
- Data.Extensible.Label: instance forall v1 (f :: * -> *) (p :: * -> * -> *) (e :: (Data.Extensible.Internal.Assoc GHC.Types.Symbol v1 -> *) -> [Data.Extensible.Internal.Assoc GHC.Types.Symbol v1] -> *) (k :: GHC.Types.Symbol) (v2 :: v1) (xs :: [Data.Extensible.Internal.Assoc GHC.Types.Symbol v1]) (h :: v1 -> *) rep s t rep'. (Data.Extensible.Class.Extensible f p e, Data.Extensible.Internal.Associate k v2 xs, Data.Extensible.Field.Labelling k p, Data.Extensible.Wrapper.Wrapper h, Data.Extensible.Class.ExtensibleConstr e (Data.Extensible.Field.Field h) xs (k 'Data.Extensible.Internal.:> v2), rep ~ Data.Extensible.Wrapper.Repr h v2, s ~ e (Data.Extensible.Field.Field h) xs, s ~ t, rep ~ rep') => GHC.OverloadedLabels.IsLabel k (p rep (f rep') -> p s (f t))
- Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s ~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasGetter (Data.Extensible.Struct.WrappedPointer s h a) a
- Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s ~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasSetter (Data.Extensible.Struct.WrappedPointer s h a) a
- Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s ~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasUpdate (Data.Extensible.Struct.WrappedPointer s h a) a a
- Data.Extensible.Wrapper: instance Data.Extensible.Wrapper.Wrapper GHC.Base.Maybe
+ Data.Extensible.Bits: instance (Data.Extensible.Bits.FromBits r a, Data.Extensible.Bits.FromBits r b, n Data.Type.Equality.~ (Data.Extensible.Bits.BitWidth a GHC.TypeNats.+ Data.Extensible.Bits.BitWidth b), n GHC.TypeNats.<= Data.Extensible.Bits.BitWidth r, GHC.TypeNats.KnownNat n) => Data.Extensible.Bits.FromBits r (a, b)
+ Data.Extensible.Class: infix 0 :>
+ Data.Extensible.Class: type (>:) = '(:>)
+ Data.Extensible.Effect: type family Function args r :: *
+ Data.Extensible.Field: type family Labelling s p :: Constraint
+ Data.Extensible.HList: infixr 5 `HCons`
+ Data.Extensible.Inclusion: instance forall k1 v1 (xs :: [Data.Extensible.Internal.Assoc k1 v1]) (t :: Data.Extensible.Internal.Assoc k1 v1) (k2 :: k1) (v2 :: v1). (Data.Extensible.Inclusion.Associated' xs t, t Data.Type.Equality.~ (k2 'Data.Extensible.Internal.:> v2)) => Data.Extensible.Inclusion.Associated xs t
+ Data.Extensible.Inclusion: type family Associated' (xs :: [Assoc k v]) (t :: Assoc k v) :: Constraint
+ Data.Extensible.Internal: infix 0 :>
+ Data.Extensible.Internal: instance forall k (x :: k) (xs :: [k]) (pos :: GHC.Types.Nat). (Data.Extensible.Internal.Elaborate x (Data.Extensible.Internal.FindType x xs) Data.Type.Equality.~ 'Data.Extensible.Internal.Expecting pos, GHC.TypeNats.KnownNat pos) => Data.Extensible.Internal.Member xs x
+ Data.Extensible.Internal: instance forall v1 k1 (k2 :: k1) (xs :: [Data.Extensible.Internal.Assoc k1 v1]) (n :: GHC.Types.Nat) (v2 :: v1). (Data.Extensible.Internal.Elaborate k2 (Data.Extensible.Internal.FindAssoc 0 k2 xs) Data.Type.Equality.~ 'Data.Extensible.Internal.Expecting (n 'Data.Extensible.Internal.:> v2), GHC.TypeNats.KnownNat n) => Data.Extensible.Internal.Associate k2 v2 xs
+ Data.Extensible.Internal: type (>:) = '(:>)
+ Data.Extensible.Internal: type family Last (x :: [k]) :: k
+ Data.Extensible.Label: instance (k Data.Type.Equality.~ l) => GHC.OverloadedLabels.IsLabel k (Data.Proxy.Proxy l)
+ Data.Extensible.Label: instance forall v1 (f :: * -> *) (p :: * -> * -> *) (e :: (Data.Extensible.Internal.Assoc GHC.Types.Symbol v1 -> *) -> [Data.Extensible.Internal.Assoc GHC.Types.Symbol v1] -> *) (k :: GHC.Types.Symbol) (v2 :: v1) (xs :: [Data.Extensible.Internal.Assoc GHC.Types.Symbol v1]) (h :: v1 -> *) rep s t rep'. (Data.Extensible.Class.Extensible f p e, Data.Extensible.Internal.Associate k v2 xs, Data.Extensible.Field.Labelling k p, Data.Extensible.Wrapper.Wrapper h, Data.Extensible.Class.ExtensibleConstr e (Data.Extensible.Field.Field h) xs (k 'Data.Extensible.Internal.:> v2), rep Data.Type.Equality.~ Data.Extensible.Wrapper.Repr h v2, s Data.Type.Equality.~ e (Data.Extensible.Field.Field h) xs, s Data.Type.Equality.~ t, rep Data.Type.Equality.~ rep') => GHC.OverloadedLabels.IsLabel k (p rep (f rep') -> p s (f t))
+ Data.Extensible.Product: infixr 5 ++
+ Data.Extensible.Product: type family (++) (xs :: [k]) (ys :: [k]) :: [k]
+ Data.Extensible.Struct: infixr 5 ++
+ Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasGetter (Data.Extensible.Struct.WrappedPointer s h a) a
+ Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasSetter (Data.Extensible.Struct.WrappedPointer s h a) a
+ Data.Extensible.Struct: instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasUpdate (Data.Extensible.Struct.WrappedPointer s h a) a a
+ Data.Extensible.Struct: type family (++) (xs :: [k]) (ys :: [k]) :: [k]
+ Data.Extensible.Wrapper: -- | <tt><a>Repr</a> h v</tt> is the actual representation of <tt>h v</tt>.
+ Data.Extensible.Wrapper: instance Data.Extensible.Wrapper.Wrapper GHC.Maybe.Maybe
- Data.Extensible: data Proxy (t :: k) :: forall k. () => k -> *
+ Data.Extensible: data Proxy (t :: k) :: forall k. () => k -> Type
- Data.Extensible.Bits: toBitProd :: forall r h xs. BitFields r h xs => h :* xs -> BitProd r h xs
+ Data.Extensible.Bits: toBitProd :: forall r h xs. BitFields r h xs => (h :* xs) -> BitProd r h xs
- Data.Extensible.Bits: type family BitWidth a :: Nat;
+ Data.Extensible.Bits: type family TotalBits h xs
- Data.Extensible.Class: leadership :: Membership (y : xs) x -> (x :~: y -> r) -> (Membership xs x -> r) -> r
+ Data.Extensible.Class: leadership :: Membership (y : xs) x -> ((x :~: y) -> r) -> (Membership xs x -> r) -> r
- Data.Extensible.Class: type family ExtensibleConstr t (h :: k
+ Data.Extensible.Class: type family Elaborate (key :: k) (xs :: [v]) :: Elaborated k v
- Data.Extensible.Effect: Interpreter :: forall a. g a -> f a -> Interpreter f g
+ Data.Extensible.Effect: Interpreter :: (forall a. g a -> f a) -> Interpreter f g
- Data.Extensible.Effect: [Instruction] :: !(Membership xs kv) -> AssocValue kv a -> Instruction xs a
+ Data.Extensible.Effect: [Instruction] :: !Membership xs kv -> AssocValue kv a -> Instruction xs a
- Data.Extensible.Effect: catchEff :: forall k e xs a. (Associate k (EitherEff e) xs) => Proxy k -> Eff xs a -> (e -> Eff xs a) -> Eff xs a
+ Data.Extensible.Effect: catchEff :: forall k e xs a. Associate k (EitherEff e) xs => Proxy k -> Eff xs a -> (e -> Eff xs a) -> Eff xs a
- Data.Extensible.Effect: data ContT (r :: k) (m :: k -> *) a :: forall k. () => k -> k -> * -> * -> *
+ Data.Extensible.Effect: data ContT (r :: k) (m :: k -> Type) a :: forall k. () => k -> k -> Type -> Type -> Type
- Data.Extensible.Effect: evalStateEff :: forall k s xs a. Eff (k >: State s : xs) a -> s -> Eff xs a
+ Data.Extensible.Effect: evalStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs a
- Data.Extensible.Effect: execStateEff :: forall k s xs a. Eff (k >: State s : xs) a -> s -> Eff xs s
+ Data.Extensible.Effect: execStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs s
- Data.Extensible.Effect: execWriterEff :: forall k w xs a. Monoid w => Eff (k >: WriterEff w : xs) a -> Eff xs w
+ Data.Extensible.Effect: execWriterEff :: forall k w xs a. Monoid w => Eff ((k >: WriterEff w) : xs) a -> Eff xs w
- Data.Extensible.Effect: peelAction :: forall k ps q xs a r. (forall x. Instruction xs x -> (x -> r) -> r) -> (a -> r) -> Function ps ((q -> r) -> r) -> Eff (k >: Action ps q : xs) a -> r
+ Data.Extensible.Effect: peelAction :: forall k ps q xs a r. (forall x. Instruction xs x -> (x -> r) -> r) -> (a -> r) -> Function ps ((q -> r) -> r) -> Eff ((k >: Action ps q) : xs) a -> r
- Data.Extensible.Effect: peelAction0 :: forall k ps q xs a. Function ps (Eff xs q) -> Eff (k >: Action ps q : xs) a -> Eff xs a
+ Data.Extensible.Effect: peelAction0 :: forall k ps q xs a. Function ps (Eff xs q) -> Eff ((k >: Action ps q) : xs) a -> Eff xs a
- Data.Extensible.Effect: peelEff :: forall k t xs a r. Rebinder xs r -> (a -> r) -> (forall x. t x -> (x -> r) -> r) -> Eff (k >: t : xs) a -> r
+ Data.Extensible.Effect: peelEff :: forall k t xs a r. Rebinder xs r -> (a -> r) -> (forall x. t x -> (x -> r) -> r) -> Eff ((k >: t) : xs) a -> r
- Data.Extensible.Effect: peelEff0 :: forall k t xs a r. (a -> Eff xs r) -> (forall x. t x -> (x -> Eff xs r) -> Eff xs r) -> Eff (k >: t : xs) a -> Eff xs r
+ Data.Extensible.Effect: peelEff0 :: forall k t xs a r. (a -> Eff xs r) -> (forall x. t x -> (x -> Eff xs r) -> Eff xs r) -> Eff ((k >: t) : xs) a -> Eff xs r
- Data.Extensible.Effect: peelEff1 :: forall k t xs a b r. (a -> b -> Eff xs r) -> (forall x. t x -> (x -> b -> Eff xs r) -> b -> Eff xs r) -> Eff (k >: t : xs) a -> b -> Eff xs r
+ Data.Extensible.Effect: peelEff1 :: forall k t xs a b r. (a -> b -> Eff xs r) -> (forall x. t x -> (x -> b -> Eff xs r) -> b -> Eff xs r) -> Eff ((k >: t) : xs) a -> b -> Eff xs r
- Data.Extensible.Effect: runContEff :: forall k r xs a. Eff (k >: ContT r (Eff xs) : xs) a -> (a -> Eff xs r) -> Eff xs r
+ Data.Extensible.Effect: runContEff :: forall k r xs a. Eff ((k >: ContT r (Eff xs)) : xs) a -> (a -> Eff xs r) -> Eff xs r
- Data.Extensible.Effect: runEitherEff :: forall k e xs a. Eff (k >: EitherEff e : xs) a -> Eff xs (Either e a)
+ Data.Extensible.Effect: runEitherEff :: forall k e xs a. Eff ((k >: EitherEff e) : xs) a -> Eff xs (Either e a)
- Data.Extensible.Effect: runIterEff :: Eff (k >: Identity : xs) a -> Eff xs (Either a (Eff (k >: Identity : xs) a))
+ Data.Extensible.Effect: runIterEff :: Eff ((k >: Identity) : xs) a -> Eff xs (Either a (Eff ((k >: Identity) : xs) a))
- Data.Extensible.Effect: runMaybeEff :: forall k xs a. Eff (k >: MaybeEff : xs) a -> Eff xs (Maybe a)
+ Data.Extensible.Effect: runMaybeEff :: forall k xs a. Eff ((k >: MaybeEff) : xs) a -> Eff xs (Maybe a)
- Data.Extensible.Effect: runReaderEff :: forall k r xs a. Eff (k >: ReaderEff r : xs) a -> r -> Eff xs a
+ Data.Extensible.Effect: runReaderEff :: forall k r xs a. Eff ((k >: ReaderEff r) : xs) a -> r -> Eff xs a
- Data.Extensible.Effect: runStateEff :: forall k s xs a. Eff (k >: State s : xs) a -> s -> Eff xs (a, s)
+ Data.Extensible.Effect: runStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs (a, s)
- Data.Extensible.Effect: runWriterEff :: forall k w xs a. Monoid w => Eff (k >: WriterEff w : xs) a -> Eff xs (a, w)
+ Data.Extensible.Effect: runWriterEff :: forall k w xs a. Monoid w => Eff ((k >: WriterEff w) : xs) a -> Eff xs (a, w)
- Data.Extensible.Effect: tellEff :: forall k w xs. (Associate k (WriterEff w) xs) => Proxy k -> w -> Eff xs ()
+ Data.Extensible.Effect: tellEff :: forall k w xs. Associate k (WriterEff w) xs => Proxy k -> w -> Eff xs ()
- Data.Extensible.Effect: writerEff :: forall k w xs a. (Associate k (WriterEff w) xs) => Proxy k -> (a, w) -> Eff xs a
+ Data.Extensible.Effect: writerEff :: forall k w xs a. Associate k (WriterEff w) xs => Proxy k -> (a, w) -> Eff xs a
- Data.Extensible.GetOpt: OptionDescr :: (s -> h a) -> !s -> (OptDescr (s -> s)) -> OptionDescr h a
+ Data.Extensible.GetOpt: OptionDescr :: (s -> h a) -> !s -> OptDescr (s -> s) -> OptionDescr h a
- Data.Extensible.Inclusion: shrink :: (xs ⊆ ys) => h :* ys -> h :* xs
+ Data.Extensible.Inclusion: shrink :: xs ⊆ ys => (h :* ys) -> h :* xs
- Data.Extensible.Inclusion: shrinkAssoc :: (IncludeAssoc ys xs) => h :* ys -> h :* xs
+ Data.Extensible.Inclusion: shrinkAssoc :: IncludeAssoc ys xs => (h :* ys) -> h :* xs
- Data.Extensible.Inclusion: spread :: (xs ⊆ ys) => h :| xs -> h :| ys
+ Data.Extensible.Inclusion: spread :: xs ⊆ ys => (h :| xs) -> h :| ys
- Data.Extensible.Inclusion: spreadAssoc :: (IncludeAssoc ys xs) => h :| xs -> h :| ys
+ Data.Extensible.Inclusion: spreadAssoc :: IncludeAssoc ys xs => (h :| xs) -> h :| ys
- Data.Extensible.Internal: leadership :: Membership (y : xs) x -> (x :~: y -> r) -> (Membership xs x -> r) -> r
+ Data.Extensible.Internal: leadership :: Membership (y : xs) x -> ((x :~: y) -> r) -> (Membership xs x -> r) -> r
- Data.Extensible.Match: Match :: h x -> r -> Match h r x
+ Data.Extensible.Match: Match :: (h x -> r) -> Match h r x
- Data.Extensible.Match: caseOf :: h :| xs -> Match h a :* xs -> a
+ Data.Extensible.Match: caseOf :: (h :| xs) -> (Match h a :* xs) -> a
- Data.Extensible.Match: match :: Match h a :* xs -> h :| xs -> a
+ Data.Extensible.Match: match :: (Match h a :* xs) -> (h :| xs) -> a
- Data.Extensible.Match: matchWith :: (forall x. f x -> g x -> r) -> f :* xs -> g :| xs -> r
+ Data.Extensible.Match: matchWith :: (forall x. f x -> g x -> r) -> (f :* xs) -> (g :| xs) -> r
- Data.Extensible.Nullable: retrench :: (Generate ys, xs ⊆ ys) => h :| ys -> Nullable ((:|) h) xs
+ Data.Extensible.Nullable: retrench :: (Generate ys, xs ⊆ ys) => (h :| ys) -> Nullable ((:|) h) xs
- Data.Extensible.Nullable: wrench :: (Generate ys, xs ⊆ ys) => h :* xs -> Nullable h :* ys
+ Data.Extensible.Nullable: wrench :: (Generate ys, xs ⊆ ys) => (h :* xs) -> Nullable h :* ys
- Data.Extensible.Plain: bury :: (x ∈ xs) => x -> OneOf xs
+ Data.Extensible.Plain: bury :: x ∈ xs => x -> OneOf xs
- Data.Extensible.Plain: pluck :: (x ∈ xs) => AllOf xs -> x
+ Data.Extensible.Plain: pluck :: x ∈ xs => AllOf xs -> x
- Data.Extensible.Product: (<!) :: h x -> h :* xs -> h :* (x : xs)
+ Data.Extensible.Product: (<!) :: h x -> (h :* xs) -> h :* (x : xs)
- Data.Extensible.Product: (<:) :: h x -> h :* xs -> h :* (x : xs)
+ Data.Extensible.Product: (<:) :: h x -> (h :* xs) -> h :* (x : xs)
- Data.Extensible.Product: data (h :: k -> *) (:*) (s :: [k])
+ Data.Extensible.Product: data (h :: k -> *) :* (s :: [k])
- Data.Extensible.Product: haccum :: Foldable f => (forall x. Membership xs x -> g x -> h x -> h x) -> h :* xs -> f (g :| xs) -> h :* xs
+ Data.Extensible.Product: haccum :: Foldable f => (forall x. Membership xs x -> g x -> h x -> h x) -> (h :* xs) -> f (g :| xs) -> h :* xs
- Data.Extensible.Product: haccumMap :: Foldable f => (a -> g :| xs) -> (forall x. Membership xs x -> g x -> h x -> h x) -> h :* xs -> f a -> h :* xs
+ Data.Extensible.Product: haccumMap :: Foldable f => (a -> g :| xs) -> (forall x. Membership xs x -> g x -> h x -> h x) -> (h :* xs) -> f a -> h :* xs
- Data.Extensible.Product: happend :: (h :* xs) -> (h :* ys) -> (h :* (xs ++ ys))
+ Data.Extensible.Product: happend :: (h :* xs) -> (h :* ys) -> h :* (xs ++ ys)
- Data.Extensible.Product: hfoldMap :: Monoid a => (forall x. h x -> a) -> h :* xs -> a
+ Data.Extensible.Product: hfoldMap :: Monoid a => (forall x. h x -> a) -> (h :* xs) -> a
- Data.Extensible.Product: hfoldMapFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => h x -> a) -> h :* xs -> a
+ Data.Extensible.Product: hfoldMapFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => h x -> a) -> (h :* xs) -> a
- Data.Extensible.Product: hfoldMapWithIndex :: Monoid a => (forall x. Membership xs x -> g x -> a) -> g :* xs -> a
+ Data.Extensible.Product: hfoldMapWithIndex :: Monoid a => (forall x. Membership xs x -> g x -> a) -> (g :* xs) -> a
- Data.Extensible.Product: hfoldMapWithIndexFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => Membership xs x -> h x -> a) -> h :* xs -> a
+ Data.Extensible.Product: hfoldMapWithIndexFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => Membership xs x -> h x -> a) -> (h :* xs) -> a
- Data.Extensible.Product: hfoldlWithIndex :: (forall x. Membership xs x -> r -> h x -> r) -> r -> h :* xs -> r
+ Data.Extensible.Product: hfoldlWithIndex :: (forall x. Membership xs x -> r -> h x -> r) -> r -> (h :* xs) -> r
- Data.Extensible.Product: hfoldlWithIndexFor :: (Forall c xs) => proxy c -> (forall x. c x => Membership xs x -> r -> h x -> r) -> r -> h :* xs -> r
+ Data.Extensible.Product: hfoldlWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> r -> h x -> r) -> r -> (h :* xs) -> r
- Data.Extensible.Product: hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r
+ Data.Extensible.Product: hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> (h :* xs) -> r
- Data.Extensible.Product: hfoldrWithIndexFor :: (Forall c xs) => proxy c -> (forall x. c x => Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r
+ Data.Extensible.Product: hfoldrWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> h x -> r -> r) -> r -> (h :* xs) -> r
- Data.Extensible.Product: hforce :: h :* xs -> h :* xs
+ Data.Extensible.Product: hforce :: (h :* xs) -> h :* xs
- Data.Extensible.Product: hindex :: h :* xs -> Membership xs x -> h x
+ Data.Extensible.Product: hindex :: (h :* xs) -> Membership xs x -> h x
- Data.Extensible.Product: hlength :: h :* xs -> Int
+ Data.Extensible.Product: hlength :: (h :* xs) -> Int
- Data.Extensible.Product: hlookup :: Membership xs x -> h :* xs -> h x
+ Data.Extensible.Product: hlookup :: Membership xs x -> (h :* xs) -> h x
- Data.Extensible.Product: hmap :: (forall x. g x -> h x) -> g :* xs -> h :* xs
+ Data.Extensible.Product: hmap :: (forall x. g x -> h x) -> (g :* xs) -> h :* xs
- Data.Extensible.Product: hmapWithIndex :: (forall x. Membership xs x -> g x -> h x) -> g :* xs -> h :* xs
+ Data.Extensible.Product: hmapWithIndex :: (forall x. Membership xs x -> g x -> h x) -> (g :* xs) -> h :* xs
- Data.Extensible.Product: hmapWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> g x -> h x) -> g :* xs -> h :* xs
+ Data.Extensible.Product: hmapWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> g x -> h x) -> (g :* xs) -> h :* xs
- Data.Extensible.Product: hsequence :: Applicative f => Comp f h :* xs -> f (h :* xs)
+ Data.Extensible.Product: hsequence :: Applicative f => (Comp f h :* xs) -> f (h :* xs)
- Data.Extensible.Product: htraverse :: Applicative f => (forall x. g x -> f (h x)) -> g :* xs -> f (h :* xs)
+ Data.Extensible.Product: htraverse :: Applicative f => (forall x. g x -> f (h x)) -> (g :* xs) -> f (h :* xs)
- Data.Extensible.Product: htraverseWithIndex :: Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> g :* xs -> f (h :* xs)
+ Data.Extensible.Product: htraverseWithIndex :: Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> (g :* xs) -> f (h :* xs)
- Data.Extensible.Product: hzipWith :: (forall x. f x -> g x -> h x) -> f :* xs -> g :* xs -> h :* xs
+ Data.Extensible.Product: hzipWith :: (forall x. f x -> g x -> h x) -> (f :* xs) -> (g :* xs) -> h :* xs
- Data.Extensible.Product: hzipWith3 :: (forall x. f x -> g x -> h x -> i x) -> f :* xs -> g :* xs -> h :* xs -> i :* xs
+ Data.Extensible.Product: hzipWith3 :: (forall x. f x -> g x -> h x -> i x) -> (f :* xs) -> (g :* xs) -> (h :* xs) -> i :* xs
- Data.Extensible.Product: toHList :: forall h xs. h :* xs -> HList h xs
+ Data.Extensible.Product: toHList :: forall h xs. (h :* xs) -> HList h xs
- Data.Extensible.Struct: (-$>) :: forall k h xs v s. (Associate k v xs) => Struct s h xs -> Proxy k -> WrappedPointer s h (Repr h (k :> v))
+ Data.Extensible.Struct: (-$>) :: forall k h xs v s. Associate k v xs => Struct s h xs -> Proxy k -> WrappedPointer s h (Repr h (k :> v))
- Data.Extensible.Struct: [WrappedPointer] :: !(Struct s h xs) -> !(Membership xs x) -> WrappedPointer s h (Repr h x)
+ Data.Extensible.Struct: [WrappedPointer] :: !Struct s h xs -> !Membership xs x -> WrappedPointer s h (Repr h x)
- Data.Extensible.Struct: data (h :: k -> *) (:*) (s :: [k])
+ Data.Extensible.Struct: data (h :: k -> *) :* (s :: [k])
- Data.Extensible.Struct: happend :: (h :* xs) -> (h :* ys) -> (h :* (xs ++ ys))
+ Data.Extensible.Struct: happend :: (h :* xs) -> (h :* ys) -> h :* (xs ++ ys)
- Data.Extensible.Struct: hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r
+ Data.Extensible.Struct: hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> (h :* xs) -> r
- Data.Extensible.Struct: hlength :: h :* xs -> Int
+ Data.Extensible.Struct: hlength :: (h :* xs) -> Int
- Data.Extensible.Struct: hlookup :: Membership xs x -> h :* xs -> h x
+ Data.Extensible.Struct: hlookup :: Membership xs x -> (h :* xs) -> h x
- Data.Extensible.Struct: hmodify :: (forall s. Struct s h xs -> ST s ()) -> h :* xs -> h :* xs
+ Data.Extensible.Struct: hmodify :: (forall s. Struct s h xs -> ST s ()) -> (h :* xs) -> h :* xs
- Data.Extensible.Struct: newFrom :: forall g h m xs. (PrimMonad m) => g :* xs -> (forall x. Membership xs x -> g x -> h x) -> m (Struct (PrimState m) h xs)
+ Data.Extensible.Struct: newFrom :: forall g h m xs. PrimMonad m => (g :* xs) -> (forall x. Membership xs x -> g x -> h x) -> m (Struct (PrimState m) h xs)
- Data.Extensible.Struct: thaw :: PrimMonad m => h :* xs -> m (Struct (PrimState m) h xs)
+ Data.Extensible.Struct: thaw :: PrimMonad m => (h :* xs) -> m (Struct (PrimState m) h xs)
- Data.Extensible.Struct: toHList :: forall h xs. h :* xs -> HList h xs
+ Data.Extensible.Struct: toHList :: forall h xs. (h :* xs) -> HList h xs
- Data.Extensible.Sum: (<:|) :: (h x -> r) -> (h :| xs -> r) -> h :| (x : xs) -> r
+ Data.Extensible.Sum: (<:|) :: (h x -> r) -> ((h :| xs) -> r) -> (h :| (x : xs)) -> r
- Data.Extensible.Sum: [EmbedAt] :: !(Membership xs x) -> h x -> h :| xs
+ Data.Extensible.Sum: [EmbedAt] :: !Membership xs x -> h x -> h :| xs
- Data.Extensible.Sum: data (h :: k -> *) (:|) (s :: [k])
+ Data.Extensible.Sum: data (h :: k -> *) :| (s :: [k])
- Data.Extensible.Sum: embed :: (x ∈ xs) => h x -> h :| xs
+ Data.Extensible.Sum: embed :: x ∈ xs => h x -> h :| xs
- Data.Extensible.Sum: exhaust :: h :| '[] -> r
+ Data.Extensible.Sum: exhaust :: (h :| '[]) -> r
- Data.Extensible.Sum: hoist :: (forall x. g x -> h x) -> g :| xs -> h :| xs
+ Data.Extensible.Sum: hoist :: (forall x. g x -> h x) -> (g :| xs) -> h :| xs
- Data.Extensible.Sum: strike :: forall h x xs. (x ∈ xs) => h :| xs -> Maybe (h x)
+ Data.Extensible.Sum: strike :: forall h x xs. x ∈ xs => (h :| xs) -> Maybe (h x)
- Data.Extensible.Sum: strikeAt :: forall h x xs. Membership xs x -> h :| xs -> Maybe (h x)
+ Data.Extensible.Sum: strikeAt :: forall h x xs. Membership xs x -> (h :| xs) -> Maybe (h x)
- Data.Extensible.Tangle: evalTangleT :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> TangleT h xs m a -> m a
+ Data.Extensible.Tangle: evalTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m a
- Data.Extensible.Tangle: runTangleT :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> TangleT h xs m a -> m (a, Nullable h :* xs)
+ Data.Extensible.Tangle: runTangleT :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> TangleT h xs m a -> m (a, Nullable h :* xs)
- Data.Extensible.Tangle: runTangles :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> m (h :* xs)
+ Data.Extensible.Tangle: runTangles :: Monad m => (Comp (TangleT h xs m) h :* xs) -> (Nullable h :* xs) -> m (h :* xs)
- Data.Extensible.Wrapper: Prod :: (f a) -> (g a) -> Prod f g a
+ Data.Extensible.Wrapper: Prod :: f a -> g a -> Prod f g a
Files
- CHANGELOG.md +9/−0
- examples/eff.hs +23/−0
- examples/misc.hs +0/−22
- extensible.cabal +1/−1
- src/Data/Extensible/Dictionary.hs +23/−12
- src/Data/Extensible/Effect/Default.hs +5/−1
- src/Data/Extensible/Struct.hs +1/−0
CHANGELOG.md view
@@ -1,3 +1,12 @@+0.4.10.1+-------------------------------------------------+* Fixed build on GHC 8.6++0.4.10+-------------------------------------------------+* Added a `MonadResource`, `MonadThrow`, and `MonadCatch` instances for `Eff`+* `Proxy` and `KnownSymbol` are now reexported from `Data.Extensible`+ 0.4.9 ------------------------------------------------- * Generalised the `MonadIO` instance for `Eff` to `(MonadIO m, Associate "IO" m xs) => MonadIO (Eff xs)`
+ examples/eff.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE TypeApplications, OverloadedLabels, PolyKinds, DataKinds, ScopedTypeVariables, Rank2Types #-}+import Data.Extensible++import Prelude hiding (readFile)+import Control.Exception+import Data.ByteString (ByteString)++data FileSystem r where+ ReadFile+ :: FilePath+ -> FileSystem (Either SomeException ByteString)++readFile+ :: forall xs+ . (Associate "fs" FileSystem xs+ , Associate "fs_error" (EitherEff SomeException) xs)+ => FilePath+ -> Eff xs ByteString+readFile fp = liftEff #fs (ReadFile fp)+ >>= either (throwEff #fs_error) pure++foo :: forall xs. Associate "fs" FileSystem xs => Eff xs (Either SomeException ByteString)+foo = castEff (runEitherEff @ "fs_error" (readFile "foo") :: Eff '["fs" >: FileSystem] (Either SomeException ByteString))
− examples/misc.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, TypeApplications #-}--import Data.Extensible-import Data.Functor.Identity-import Data.Proxy-import GHC.TypeLits-import Data.Extensible.Internal.Rig-import Data.Typeable-import Data.Functor.Product---- | Collect keys-keys :: forall proxy xs. Forall (KeyIs KnownSymbol) xs => proxy xs -> [String]-keys _ = henumerateFor (Proxy @ (KeyIs KnownSymbol)) (Proxy @ xs)- ((:) . symbolVal . proxyAssocKey) []--values :: Forall (ValueIs Show) xs => Record xs -> [String]-values = hfoldrWithIndexFor (Proxy @ (ValueIs Show))- (const $ (:) . show . view _Wrapper) []--values' :: Forall (ValueIs (Product Typeable Show)) xs => Record xs -> [String]-values' = hfoldrWithIndexFor (Proxy @ (ValueIs Show))- (const $ (:) . show . view _Wrapper) []
extensible.cabal view
@@ -1,5 +1,5 @@ name: extensible-version: 0.4.10+version: 0.4.10.1 synopsis: Extensible, efficient, optics-friendly data types and effects homepage: https://github.com/fumieval/extensible bug-reports: http://github.com/fumieval/extensible/issues
src/Data/Extensible/Dictionary.hs view
@@ -1,8 +1,10 @@+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies, ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances, MultiParamTypeClasses #-} #if __GLASGOW_HASKELL__ >= 800 {-# LANGUAGE UndecidableSuperClasses #-}+{-# LANGUAGE TypeInType #-} #endif {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-}@@ -20,6 +22,8 @@ module Data.Extensible.Dictionary (library, WrapForall, Instance1, And) where import Control.Applicative import Control.DeepSeq+import Control.Monad.Trans+import Control.Monad.Trans.Cont import qualified Data.Aeson as J import qualified Data.Csv as Csv import qualified Data.ByteString.Char8 as BC@@ -38,13 +42,17 @@ import qualified Data.HashMap.Strict as HM import Data.Semigroup import Data.Text.Prettyprint.Doc+import Data.Typeable+#if __GLASGOW_HASKELL__ >= 800+import Data.Kind+#endif import qualified Data.Vector.Generic as G import qualified Data.Vector.Generic.Mutable as M import qualified Data.Vector.Unboxed as U import qualified Data.Vector as V import qualified Data.Text as T-import Language.Haskell.TH.Lift-import Language.Haskell.TH+import qualified Language.Haskell.TH.Lift as TH+import Language.Haskell.TH hiding (Type) import GHC.TypeLits import Test.QuickCheck.Arbitrary import Test.QuickCheck.Gen@@ -110,16 +118,16 @@ maxBound = hrepeatFor (Proxy :: Proxy (Instance1 Bounded h)) maxBound #if !MIN_VERSION_th_lift(0,7,9)-instance Lift a => Lift (Identity a) where- lift = appE (conE 'Identity) . lift . runIdentity+instance TH.Lift a => TH.Lift (Identity a) where+ lift = appE (conE 'Identity) . TH.lift . runIdentity -instance Lift a => Lift (Const a b) where- lift = appE (conE 'Const) . lift . getConst+instance TH.Lift a => TH.Lift (Const a b) where+ lift = appE (conE 'Const) . TH.lift . getConst #endif -instance WrapForall Lift h xs => Lift (h :* xs) where- lift = hfoldrWithIndexFor (Proxy :: Proxy (Instance1 Lift h))- (\_ x xs -> infixE (Just $ lift x) (varE '(<:)) (Just xs)) (varE 'nil)+instance WrapForall TH.Lift h xs => TH.Lift (h :* xs) where+ lift = hfoldrWithIndexFor (Proxy :: Proxy (Instance1 TH.Lift h))+ (\_ x xs -> infixE (Just $ TH.lift x) (varE '(<:)) (Just xs)) (varE 'nil) newtype instance U.MVector s (h :* xs) = MV_Product (Comp (U.MVector s) h :* xs) newtype instance U.Vector (h :* xs) = V_Product (Comp U.Vector h :* xs)@@ -259,10 +267,10 @@ (library :: Comp Dict (Instance1 Hashable h) :* xs) {-# INLINE hashWithSalt #-} -instance WrapForall Lift h xs => Lift (h :| xs) where+instance WrapForall TH.Lift h xs => TH.Lift (h :| xs) where lift (EmbedAt i h) = views (pieceAt i)- (\(Comp Dict) -> conE 'EmbedAt `appE` lift i `appE` lift h)- (library :: Comp Dict (Instance1 Lift h) :* xs)+ (\(Comp Dict) -> conE 'EmbedAt `appE` TH.lift i `appE` TH.lift h)+ (library :: Comp Dict (Instance1 TH.Lift h) :* xs) instance WrapForall Arbitrary h xs => Arbitrary (h :| xs) where arbitrary = choose (0, hcount (Proxy :: Proxy xs)) >>= henumerateFor@@ -385,3 +393,6 @@ instance (U.Unbox a) => U.Unbox (Const' a b) #endif++proxyApp :: Proxy f -> Proxy a -> Proxy (f a)+proxyApp _ _ = Proxy
src/Data/Extensible/Effect/Default.hs view
@@ -36,14 +36,18 @@ import Control.Monad.Reader.Class import Control.Monad.Skeleton import Control.Monad.State.Strict+#if MIN_VERSION_resourcet(1,2,0) import Control.Monad.Trans.Resource+#endif import Control.Monad.Writer.Class instance (MonadIO m, Associate "IO" m xs) => MonadIO (Eff xs) where liftIO = liftEff (Proxy :: Proxy "IO") . liftIO +#if MIN_VERSION_resourcet(1,2,0) instance (MonadResource m, Associate "IO" m xs) => MonadResource (Eff xs) where liftResourceT = liftEff (Proxy :: Proxy "IO") . liftResourceT+#endif instance (MonadThrow m, Associate "IO" m xs) => MonadThrow (Eff xs) where throwM = liftEff (Proxy :: Proxy "IO") . throwM@@ -54,7 +58,7 @@ Return a -> return a Instruction i t :>>= k -> case compareMembership (association :: Membership xs ("IO" ':> m)) i of Left _ -> boned $ Instruction i t :>>= go . k- Right Refl -> boned $ Instruction i (try t) :>>= go . either h k + Right Refl -> boned $ Instruction i (try t) :>>= go . either h k pReader :: Proxy "Reader" pReader = Proxy
src/Data/Extensible/Struct.hs view
@@ -4,6 +4,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MagicHash, UnboxedTuples #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE UndecidableInstances #-} ------------------------------------------------------------------------ -- | -- Module : Data.Extensible.Struct