Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Override a (xs :: [*]) = Override a
- unOverride :: Override a xs -> a
- override :: a -> proxy xs -> Override a xs
- data As (o :: k) n
- newtype Overridden (ms :: Maybe Symbol) a (xs :: [*]) = Overridden a
- unOverridden :: Overridden ms a xs -> a
- overridden :: forall a (ms :: Maybe Symbol) (xs :: [*]) proxy0 proxy1. a -> proxy0 ms -> proxy1 xs -> Overridden ms a xs
- class GOverride (xs :: [*]) (f :: * -> *) where
- type OverrideRep xs f :: * -> *
- overrideFrom :: f x -> OverrideRep xs f x
- overrideTo :: OverrideRep xs f x -> f x
- type family Using (ms :: Maybe Symbol) (x :: *) (xs :: [*]) where ...
Documentation
newtype Override a (xs :: [*]) Source #
The feature of this library. For use with DerivingVia.
Apply it to a type a
and supply a type-level list of instance
overrides xs
.
Override a |
unOverride :: Override a xs -> a Source #
Unwrap an Override
value.
override :: a -> proxy xs -> Override a xs Source #
Construct an Override
using a proxy of overrides.
newtype Overridden (ms :: Maybe Symbol) a (xs :: [*]) Source #
Used at the leaf nodes of a generic Rep
unOverridden :: Overridden ms a xs -> a Source #
Unwrap an Overridden
value.
overridden :: forall a (ms :: Maybe Symbol) (xs :: [*]) proxy0 proxy1. a -> proxy0 ms -> proxy1 xs -> Overridden ms a xs Source #
Same as override
but for Overridden
types.
class GOverride (xs :: [*]) (f :: * -> *) where Source #
type OverrideRep xs f :: * -> * Source #
Analogous to Rep
; rewrites the type for a given Rep
and injects
Overridden
at the leaves.
overrideFrom :: f x -> OverrideRep xs f x Source #
overrideTo :: OverrideRep xs f x -> f x Source #
Instances
(GOverride xs f, GOverride xs g) => GOverride xs (f :*: g) Source # | |
Defined in Data.Override.Internal overrideFrom :: (f :*: g) x -> OverrideRep xs (f :*: g) x Source # overrideTo :: OverrideRep xs (f :*: g) x -> (f :*: g) x Source # | |
GOverride xs (M1 S (MetaSel ms su ss ds) (K1 R c :: Type -> Type)) Source # | |
Defined in Data.Override.Internal | |
GOverride xs f => GOverride xs (M1 C c f) Source # | |
Defined in Data.Override.Internal overrideFrom :: M1 C c f x -> OverrideRep xs (M1 C c f) x Source # overrideTo :: OverrideRep xs (M1 C c f) x -> M1 C c f x Source # | |
GOverride xs f => GOverride xs (M1 D c f) Source # | |
Defined in Data.Override.Internal overrideFrom :: M1 D c f x -> OverrideRep xs (M1 D c f) x Source # overrideTo :: OverrideRep xs (M1 D c f) x -> M1 D c f x Source # |