extensible-0.4.7.1: Extensible, efficient, optics-friendly data types and effects

Data.Extensible.Wrapper

Description

Synopsis

# Documentation

class Wrapper (h :: k -> *) where Source #

The extensible data types should take k -> * as a parameter. This class allows us to take a shortcut for direct representation.

Minimal complete definition

_Wrapper

Associated Types

type Repr h (v :: k) :: * Source #

Repr h v is the actual representation of h v.

Methods

_Wrapper :: (Functor f, Profunctor p) => Optic' p f (h v) (Repr h v) Source #

This is an isomorphism between h v and Repr h v.

_Wrapper :: Iso' (h v) (Repr h v)

Instances

 Wrapper k (Proxy k) Source # Associated Typestype Repr (Proxy k) (h :: Proxy k -> *) (v :: Proxy k) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Proxy k) h v) Source # Wrapper k (Const' k a) Source # Associated Typestype Repr (Const' k a) (h :: Const' k a -> *) (v :: Const' k a) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Const' k a) h v) Source # Wrapper k h => Wrapper k (Nullable k h) Source # Associated Typestype Repr (Nullable k h) (h :: Nullable k h -> *) (v :: Nullable k h) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Nullable k h) h v) Source # Wrapper k (OptionDescr k h) Source # Associated Typestype Repr (OptionDescr k h) (h :: OptionDescr k h -> *) (v :: OptionDescr k h) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (OptionDescr k h) h v) Source # (Wrapper k f, Wrapper k g) => Wrapper k (Prod k f g) Source # Associated Typestype Repr (Prod k f g) (h :: Prod k f g -> *) (v :: Prod k f g) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Prod k f g) h v) Source # Wrapper k h => Wrapper k (Match k h r) Source # Associated Typestype Repr (Match k h r) (h :: Match k h r -> *) (v :: Match k h r) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Match k h r) h v) Source # (Functor f, Wrapper k g) => Wrapper k (Comp * k f g) Source # Associated Typestype Repr (Comp * k f g) (h :: Comp * k f g -> *) (v :: Comp * k f g) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Comp * k f g) h v) Source # Wrapper * [] Source # Associated Typestype Repr [] (h :: [] -> *) (v :: []) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr [] h v) Source # Source # Associated Typestype Repr Maybe (h :: Maybe -> *) (v :: Maybe) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr Maybe h v) Source # Source # Associated Typestype Repr Identity (h :: Identity -> *) (v :: Identity) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr Identity h v) Source # Wrapper v h => Wrapper (Assoc k v) (Field k v h) Source # Associated Typestype Repr (Field k v h) (h :: Field k v h -> *) (v :: Field k v h) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Field k v h) h v) Source #

_WrapperAs :: (Functor f, Profunctor p, Wrapper h) => proxy v -> Optic' p f (h v) (Repr h v) Source #

Restricted version of _Wrapper. It is useful for eliminating ambiguousness.

newtype Const' a x Source #

Poly-kinded Const

Constructors

 Const' FieldsgetConst' :: a

Instances

 Wrapper k (Const' k a) Source # Associated Typestype Repr (Const' k a) (h :: Const' k a -> *) (v :: Const' k a) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Const' k a) h v) Source # FromBits r a => FromBits r (Const' k a b) Source # Associated Typestype BitWidth (Const' k a b) :: Nat Source # MethodsfromBits :: r -> Const' k a b Source #toBits :: Const' k a b -> r Source # Source # Methodsfmap :: (a -> b) -> Const' * a a -> Const' * a b #(<$) :: a -> Const' * a b -> Const' * a a # Source # Methodsfold :: Monoid m => Const' * a m -> m #foldMap :: Monoid m => (a -> m) -> Const' * a a -> m #foldr :: (a -> b -> b) -> b -> Const' * a a -> b #foldr' :: (a -> b -> b) -> b -> Const' * a a -> b #foldl :: (b -> a -> b) -> b -> Const' * a a -> b #foldl' :: (b -> a -> b) -> b -> Const' * a a -> b #foldr1 :: (a -> a -> a) -> Const' * a a -> a #foldl1 :: (a -> a -> a) -> Const' * a a -> a #toList :: Const' * a a -> [a] #null :: Const' * a a -> Bool #length :: Const' * a a -> Int #elem :: Eq a => a -> Const' * a a -> Bool #maximum :: Ord a => Const' * a a -> a #minimum :: Ord a => Const' * a a -> a #sum :: Num a => Const' * a a -> a #product :: Num a => Const' * a a -> a # Source # Methodstraverse :: Applicative f => (a -> f b) -> Const' * a a -> f (Const' * a b) #sequenceA :: Applicative f => Const' * a (f a) -> f (Const' * a a) #mapM :: Monad m => (a -> m b) -> Const' * a a -> m (Const' * a b) #sequence :: Monad m => Const' * a (m a) -> m (Const' * a a) # Eq a => Eq (Const' k a x) Source # Methods(==) :: Const' k a x -> Const' k a x -> Bool #(/=) :: Const' k a x -> Const' k a x -> Bool # Ord a => Ord (Const' k a x) Source # Methodscompare :: Const' k a x -> Const' k a x -> Ordering #(<) :: Const' k a x -> Const' k a x -> Bool #(<=) :: Const' k a x -> Const' k a x -> Bool #(>) :: Const' k a x -> Const' k a x -> Bool #(>=) :: Const' k a x -> Const' k a x -> Bool #max :: Const' k a x -> Const' k a x -> Const' k a x #min :: Const' k a x -> Const' k a x -> Const' k a x # Show a => Show (Const' k a x) Source # MethodsshowsPrec :: Int -> Const' k a x -> ShowS #show :: Const' k a x -> String #showList :: [Const' k a x] -> ShowS # Generic (Const' k a x) Source # Associated Typestype Rep (Const' k a x) :: * -> * # Methodsfrom :: Const' k a x -> Rep (Const' k a x) x #to :: Rep (Const' k a x) x -> Const' k a x # Arbitrary a => Arbitrary (Const' k a x) Source # Methodsarbitrary :: Gen (Const' k a x) #shrink :: Const' k a x -> [Const' k a x] # NFData a => NFData (Const' k a x) Source # Methodsrnf :: Const' k a x -> () # Hashable a => Hashable (Const' k a x) Source # MethodshashWithSalt :: Int -> Const' k a x -> Int #hash :: Const' k a x -> Int # type Repr k (Const' k a) b Source # type Repr k (Const' k a) b = a data MVector s (Const' k a b) # data MVector s (Const' k a b) = MV_Const (MVector s a) type Rep (Const' k a x) Source # type Rep (Const' k a x) = D1 * (MetaData "Const'" "Data.Extensible.Wrapper" "extensible-0.4.7.1-6dMtc2bHm6wkFQI0yFQsC" True) (C1 * (MetaCons "Const'" PrefixI True) (S1 * (MetaSel (Just Symbol "getConst'") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a))) data Vector (Const' k a b) # data Vector (Const' k a b) = V_Const (Vector a) type BitWidth (Const' k a b) Source # type BitWidth (Const' k a b) = BitWidth a newtype Comp (f :: j -> *) (g :: i -> j) (a :: i) Source # Poly-kinded composition Constructors  Comp FieldsgetComp :: f (g a) Instances  (Functor f, Wrapper k g) => Wrapper k (Comp * k f g) Source # Associated Typestype Repr (Comp * k f g) (h :: Comp * k f g -> *) (v :: Comp * k f g) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Comp * k f g) h v) Source # (Functor f, Functor g) => Functor (Comp * * f g) Source # Methodsfmap :: (a -> b) -> Comp * * f g a -> Comp * * f g b #(<$) :: a -> Comp * * f g b -> Comp * * f g a # (Foldable f, Foldable g) => Foldable (Comp * * f g) Source # Methodsfold :: Monoid m => Comp * * f g m -> m #foldMap :: Monoid m => (a -> m) -> Comp * * f g a -> m #foldr :: (a -> b -> b) -> b -> Comp * * f g a -> b #foldr' :: (a -> b -> b) -> b -> Comp * * f g a -> b #foldl :: (b -> a -> b) -> b -> Comp * * f g a -> b #foldl' :: (b -> a -> b) -> b -> Comp * * f g a -> b #foldr1 :: (a -> a -> a) -> Comp * * f g a -> a #foldl1 :: (a -> a -> a) -> Comp * * f g a -> a #toList :: Comp * * f g a -> [a] #null :: Comp * * f g a -> Bool #length :: Comp * * f g a -> Int #elem :: Eq a => a -> Comp * * f g a -> Bool #maximum :: Ord a => Comp * * f g a -> a #minimum :: Ord a => Comp * * f g a -> a #sum :: Num a => Comp * * f g a -> a #product :: Num a => Comp * * f g a -> a # (Traversable f, Traversable g) => Traversable (Comp * * f g) Source # Methodstraverse :: Applicative f => (a -> f b) -> Comp * * f g a -> f (Comp * * f g b) #sequenceA :: Applicative f => Comp * * f g (f a) -> f (Comp * * f g a) #mapM :: Monad m => (a -> m b) -> Comp * * f g a -> m (Comp * * f g b) #sequence :: Monad m => Comp * * f g (m a) -> m (Comp * * f g a) # Eq (f (g a)) => Eq (Comp j i f g a) Source # Methods(==) :: Comp j i f g a -> Comp j i f g a -> Bool #(/=) :: Comp j i f g a -> Comp j i f g a -> Bool # Ord (f (g a)) => Ord (Comp j i f g a) Source # Methodscompare :: Comp j i f g a -> Comp j i f g a -> Ordering #(<) :: Comp j i f g a -> Comp j i f g a -> Bool #(<=) :: Comp j i f g a -> Comp j i f g a -> Bool #(>) :: Comp j i f g a -> Comp j i f g a -> Bool #(>=) :: Comp j i f g a -> Comp j i f g a -> Bool #max :: Comp j i f g a -> Comp j i f g a -> Comp j i f g a #min :: Comp j i f g a -> Comp j i f g a -> Comp j i f g a # Show (f (g a)) => Show (Comp j i f g a) Source # MethodsshowsPrec :: Int -> Comp j i f g a -> ShowS #show :: Comp j i f g a -> String #showList :: [Comp j i f g a] -> ShowS # Generic (Comp j i f g a) Source # Associated Typestype Rep (Comp j i f g a) :: * -> * # Methodsfrom :: Comp j i f g a -> Rep (Comp j i f g a) x #to :: Rep (Comp j i f g a) x -> Comp j i f g a # Semigroup (f (g a)) => Semigroup (Comp j i f g a) Source # Methods(<>) :: Comp j i f g a -> Comp j i f g a -> Comp j i f g a #sconcat :: NonEmpty (Comp j i f g a) -> Comp j i f g a #stimes :: Integral b => b -> Comp j i f g a -> Comp j i f g a # Monoid (f (g a)) => Monoid (Comp j i f g a) Source # Methodsmempty :: Comp j i f g a #mappend :: Comp j i f g a -> Comp j i f g a -> Comp j i f g a #mconcat :: [Comp j i f g a] -> Comp j i f g a # Arbitrary (f (g a)) => Arbitrary (Comp j i f g a) Source # Methodsarbitrary :: Gen (Comp j i f g a) #shrink :: Comp j i f g a -> [Comp j i f g a] # NFData (f (g a)) => NFData (Comp j i f g a) Source # Methodsrnf :: Comp j i f g a -> () # Hashable (f (g a)) => Hashable (Comp j i f g a) Source # MethodshashWithSalt :: Int -> Comp j i f g a -> Int #hash :: Comp j i f g a -> Int # type Repr k (Comp * k f g) x Source # type Repr k (Comp * k f g) x = f (Repr k g x) type Rep (Comp j i f g a) Source # type Rep (Comp j i f g a) = D1 * (MetaData "Comp" "Data.Extensible.Wrapper" "extensible-0.4.7.1-6dMtc2bHm6wkFQI0yFQsC" True) (C1 * (MetaCons "Comp" PrefixI True) (S1 * (MetaSel (Just Symbol "getComp") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (f (g a)))))

comp :: Functor f => (a -> g b) -> f a -> Comp f g b Source #

Wrap a result of fmap

data Prod f g a Source #

Poly-kinded product

Constructors

 Prod (f a) (g a)

Instances

 (Wrapper k f, Wrapper k g) => Wrapper k (Prod k f g) Source # Associated Typestype Repr (Prod k f g) (h :: Prod k f g -> *) (v :: Prod k f g) :: * Source # Methods_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (Prod k f g) h v) Source # (Functor g, Functor f) => Functor (Prod * f g) Source # Methodsfmap :: (a -> b) -> Prod * f g a -> Prod * f g b #(<\$) :: a -> Prod * f g b -> Prod * f g a # (Foldable g, Foldable f) => Foldable (Prod * f g) Source # Methodsfold :: Monoid m => Prod * f g m -> m #foldMap :: Monoid m => (a -> m) -> Prod * f g a -> m #foldr :: (a -> b -> b) -> b -> Prod * f g a -> b #foldr' :: (a -> b -> b) -> b -> Prod * f g a -> b #foldl :: (b -> a -> b) -> b -> Prod * f g a -> b #foldl' :: (b -> a -> b) -> b -> Prod * f g a -> b #foldr1 :: (a -> a -> a) -> Prod * f g a -> a #foldl1 :: (a -> a -> a) -> Prod * f g a -> a #toList :: Prod * f g a -> [a] #null :: Prod * f g a -> Bool #length :: Prod * f g a -> Int #elem :: Eq a => a -> Prod * f g a -> Bool #maximum :: Ord a => Prod * f g a -> a #minimum :: Ord a => Prod * f g a -> a #sum :: Num a => Prod * f g a -> a #product :: Num a => Prod * f g a -> a # (Traversable g, Traversable f) => Traversable (Prod * f g) Source # Methodstraverse :: Applicative f => (a -> f b) -> Prod * f g a -> f (Prod * f g b) #sequenceA :: Applicative f => Prod * f g (f a) -> f (Prod * f g a) #mapM :: Monad m => (a -> m b) -> Prod * f g a -> m (Prod * f g b) #sequence :: Monad m => Prod * f g (m a) -> m (Prod * f g a) # (Eq (g a), Eq (f a)) => Eq (Prod k f g a) Source # Methods(==) :: Prod k f g a -> Prod k f g a -> Bool #(/=) :: Prod k f g a -> Prod k f g a -> Bool # (Ord (g a), Ord (f a)) => Ord (Prod k f g a) Source # Methodscompare :: Prod k f g a -> Prod k f g a -> Ordering #(<) :: Prod k f g a -> Prod k f g a -> Bool #(<=) :: Prod k f g a -> Prod k f g a -> Bool #(>) :: Prod k f g a -> Prod k f g a -> Bool #(>=) :: Prod k f g a -> Prod k f g a -> Bool #max :: Prod k f g a -> Prod k f g a -> Prod k f g a #min :: Prod k f g a -> Prod k f g a -> Prod k f g a # (Show (g a), Show (f a)) => Show (Prod k f g a) Source # MethodsshowsPrec :: Int -> Prod k f g a -> ShowS #show :: Prod k f g a -> String #showList :: [Prod k f g a] -> ShowS # Generic (Prod k f g a) Source # Associated Typestype Rep (Prod k f g a) :: * -> * # Methodsfrom :: Prod k f g a -> Rep (Prod k f g a) x #to :: Rep (Prod k f g a) x -> Prod k f g a # (Semigroup (f a), Semigroup (g a)) => Semigroup (Prod k f g a) Source # Methods(<>) :: Prod k f g a -> Prod k f g a -> Prod k f g a #sconcat :: NonEmpty (Prod k f g a) -> Prod k f g a #stimes :: Integral b => b -> Prod k f g a -> Prod k f g a # (Monoid (f a), Monoid (g a)) => Monoid (Prod k f g a) Source # Methodsmempty :: Prod k f g a #mappend :: Prod k f g a -> Prod k f g a -> Prod k f g a #mconcat :: [Prod k f g a] -> Prod k f g a # (Arbitrary (f a), Arbitrary (g a)) => Arbitrary (Prod k f g a) Source # Methodsarbitrary :: Gen (Prod k f g a) #shrink :: Prod k f g a -> [Prod k f g a] # (NFData (f a), NFData (g a)) => NFData (Prod k f g a) Source # Methodsrnf :: Prod k f g a -> () # (Hashable (f a), Hashable (g a)) => Hashable (Prod k f g a) Source # MethodshashWithSalt :: Int -> Prod k f g a -> Int #hash :: Prod k f g a -> Int # type Repr k (Prod k f g) a Source # type Repr k (Prod k f g) a = (Repr k f a, Repr k g a) type Rep (Prod k f g a) Source # type Rep (Prod k f g a) = D1 * (MetaData "Prod" "Data.Extensible.Wrapper" "extensible-0.4.7.1-6dMtc2bHm6wkFQI0yFQsC" False) (C1 * (MetaCons "Prod" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (f a))) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (g a)))))