Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Act.Generic
Description
Provide generic Act
instances, in two cases
data Product a b = Product a b
instance Act (Last a) a where act (Last Nothing) a = a act (Last (Just a)) _ = a
instance Act (Last a) (Product a) where act = gact
or where two product are matched piecewise (e.g. field by field)
instance Act (Last a) (Identity a) where act (Last Nothing) a = a act (Last (Just a)) _ = Identity a
data Product' f = Product' (f a) (f b) derive Generic
instance Act (Product' Last) (Product' Identity) where act = gpact
Synopsis
- gact :: (Generic a, GAct s (Rep a)) => s -> a -> a
- newtype GenericAct s a = GenericAct {
- getGenericAct :: a
- gpact :: (Generic s, Generic a, GPAct (Rep s) (Rep a)) => s -> a -> a
Documentation
newtype GenericAct s a Source #
A newtype wrapper for deriving via.
Constructors
GenericAct | |
Fields
|
Instances
(Generic s, Generic a, GAct s (Rep a), Semigroup s) => Act s (GenericAct s a) Source # | |
Defined in Data.Act.Generic |