vessel-0.2.0.0: Functor-parametric containers

Safe HaskellNone
LanguageHaskell2010

Data.Vessel.Vessel

Synopsis

Documentation

newtype Vessel (k :: ((* -> *) -> *) -> *) (g :: * -> *) Source #

This type is a container for storing an arbitrary collection of functor-parametric container types of the sort discussed above, keyed by a GADT whose index will specify which sort of container goes in each position.

Ordinary types with values have kind * Functors have kind * -> * Containers taking a functor as a parameter then have kind (* -> *) -> * The keys of a vessel are indexed by a functor-parametric container type, so they have kind ((* -> *) -> *) -> * Vessel itself, for any such key type, produces a functor-parametric container, so it has kind (((* -> *) -> *) -> *) -> (* -> *) -> * Law: None of the items in the Vessel's MonoidalDMap are nullV

Constructors

Vessel 

Fields

Instances
(Has View k, GCompare k) => EmptyView (Vessel k) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

emptyV :: Vessel k f Source #

(Has View k, GCompare k) => View (Vessel k) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

condenseV :: (Foldable t, Filterable t, Functor t) => t (Vessel k g) -> Vessel k (Compose t g) Source #

disperseV :: Align t => Vessel k (Compose t g) -> t (Vessel k g) Source #

cropV :: (forall a. s a -> i a -> r a) -> Vessel k s -> Vessel k i -> Maybe (Vessel k r) Source #

nullV :: Vessel k i -> Bool Source #

mapV :: (forall a. f a -> g a) -> Vessel k f -> Vessel k g Source #

traverseV :: Applicative m => (forall a. f a -> m (g a)) -> Vessel k f -> m (Vessel k g) Source #

mapMaybeV :: (forall a. f a -> Maybe (g a)) -> Vessel k f -> Maybe (Vessel k g) Source #

alignWithMaybeV :: (forall a. These (f a) (g a) -> Maybe (h a)) -> Vessel k f -> Vessel k g -> Maybe (Vessel k h) Source #

alignWithV :: (forall a. These (f a) (g a) -> h a) -> Vessel k f -> Vessel k g -> Vessel k h Source #

(GCompare k, Has' Eq k (FlipAp g)) => Eq (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

(==) :: Vessel k g -> Vessel k g -> Bool #

(/=) :: Vessel k g -> Vessel k g -> Bool #

(ForallF Show k, GShow k, Has' Show k (FlipAp g)) => Show (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

showsPrec :: Int -> Vessel k g -> ShowS #

show :: Vessel k g -> String #

showList :: [Vessel k g] -> ShowS #

Generic (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Associated Types

type Rep (Vessel k g) :: Type -> Type #

Methods

from :: Vessel k g -> Rep (Vessel k g) x #

to :: Rep (Vessel k g) x -> Vessel k g #

(Has' Semigroup k (FlipAp g), GCompare k, Has View k) => Semigroup (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

(<>) :: Vessel k g -> Vessel k g -> Vessel k g #

sconcat :: NonEmpty (Vessel k g) -> Vessel k g #

stimes :: Integral b => b -> Vessel k g -> Vessel k g #

(Has' Semigroup k (FlipAp g), GCompare k, Has View k) => Monoid (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

mempty :: Vessel k g #

mappend :: Vessel k g -> Vessel k g -> Vessel k g #

mconcat :: [Vessel k g] -> Vessel k g #

(GCompare k, ForallF ToJSON k, HasV ToJSON k g) => ToJSON (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

toJSON :: Vessel k g -> Value #

toEncoding :: Vessel k g -> Encoding #

toJSONList :: [Vessel k g] -> Value #

toEncodingList :: [Vessel k g] -> Encoding #

(GCompare k, FromJSON (Some k), HasV FromJSON k g, Has View k) => FromJSON (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

parseJSON :: Value -> Parser (Vessel k g) #

parseJSONList :: Value -> Parser [Vessel k g] #

(Has' Semigroup k (FlipAp g), Has' Group k (FlipAp g), GCompare k, Has View k) => Group (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

Methods

negateG :: Vessel k g -> Vessel k g #

(~~) :: Vessel k g -> Vessel k g -> Vessel k g #

(Has' Additive k (FlipAp g), Has' Semigroup k (FlipAp g), GCompare k, Has View k) => Additive (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

(Has View k, GCompare k, Has' Semigroup k (FlipAp (Compose c (VesselLeafWrapper (QueryResult (Vessel k g))))), Query (Vessel k g)) => Query (Vessel k (Compose c g)) Source # 
Instance details

Defined in Data.Vessel.Vessel

Associated Types

type QueryResult (Vessel k (Compose c g)) :: Type #

Methods

crop :: Vessel k (Compose c g) -> QueryResult (Vessel k (Compose c g)) -> QueryResult (Vessel k (Compose c g)) #

(Has View k, GCompare k, Has' Semigroup k (FlipAp Identity)) => Query (Vessel k (Proxy :: Type -> Type)) Source # 
Instance details

Defined in Data.Vessel.Vessel

Associated Types

type QueryResult (Vessel k Proxy) :: Type #

(Has View k, GCompare k, Has' Semigroup k (FlipAp Identity)) => Query (Vessel k (Const x :: Type -> Type)) Source # 
Instance details

Defined in Data.Vessel.Vessel

Associated Types

type QueryResult (Vessel k (Const x)) :: Type #

Methods

crop :: Vessel k (Const x) -> QueryResult (Vessel k (Const x)) -> QueryResult (Vessel k (Const x)) #

type ViewQueryResult (Vessel v g :: Type) Source # 
Instance details

Defined in Data.Vessel.Vessel

type Rep (Vessel k g) Source # 
Instance details

Defined in Data.Vessel.Vessel

type Rep (Vessel k g) = D1 (MetaData "Vessel" "Data.Vessel.Vessel" "vessel-0.2.0.0-inplace" True) (C1 (MetaCons "Vessel" PrefixI True) (S1 (MetaSel (Just "unVessel") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (MonoidalDMap k (FlipAp g)))))
type QueryResult (Vessel k (Proxy :: Type -> Type)) Source # 
Instance details

Defined in Data.Vessel.Vessel

type QueryResult (Vessel k (Const x :: Type -> Type)) Source # 
Instance details

Defined in Data.Vessel.Vessel

type QueryResult (Vessel k (Compose c g)) Source # 
Instance details

Defined in Data.Vessel.Vessel

type family VesselLeafWrapper v where ... Source #

Equations

VesselLeafWrapper (Vessel k g) = g 

toListV :: Vessel k g -> [VSum k g] Source #

fromListV :: (GCompare k, Has View k) => [VSum k g] -> Vessel k g Source #

intersectionMaybeWithKeyV :: (GCompare k, Has View k) => (forall v. View v => k v -> v g -> v g' -> Maybe (v h)) -> Vessel k g -> Vessel k g' -> Vessel k h Source #

traverseWithKeyV :: (GCompare k, Has View k, Applicative m) => (forall v. View v => k v -> v g -> m (v h)) -> Vessel k g -> m (Vessel k h) Source #

traverseWithKeyV_ :: (GCompare k, Has View k, Applicative m) => (forall v. View v => k v -> v g -> m ()) -> Vessel k g -> m () Source #

buildV :: (GCompare k, Has View k, Applicative m) => Vessel k g -> (forall v. k v -> v g -> m (v h)) -> m (Vessel k h) Source #

intersectionWithKeyV :: (GCompare k, Has View k) => (forall v. View v => k v -> v g -> v g' -> v h) -> Vessel k g -> Vessel k g' -> Vessel k h Source #

singletonV :: View v => k v -> v g -> Vessel k g Source #

lookupV :: GCompare k => k v -> Vessel k g -> Maybe (v g) Source #

mapMaybeWithKeyV :: (GCompare k, Has View k) => (forall v. View v => k v -> v g -> Maybe (v g')) -> Vessel k g -> Vessel k g' Source #

intersectionDMapMaybeWithKey :: GCompare k => (forall x. k x -> a x -> b x -> Maybe (c x)) -> MonoidalDMap k a -> MonoidalDMap k b -> MonoidalDMap k c Source #

condenseV' :: forall k t g. (Has View k, GCompare k, Foldable t, Filterable t, Functor t) => DMap k (FlipAp g) -> t (Vessel k g) -> Vessel k (Compose t g) Source #

splitV :: forall k t g v. (GCompare k, View v, Filterable t) => k v -> t (Vessel k g) -> (t (Vessel k g), t (Vessel k g)) Source #

splitOneV :: (GCompare k, View v) => k v -> Vessel k g -> Maybe (These (Vessel k g) (Vessel k g)) Source #

splitLTV :: (GCompare k, View v) => k v -> Vessel k g -> (Vessel k g, Vessel k g) Source #

vessel :: (GCompare k, ViewQueryResult (v g) ~ v (ViewQueryResult g), View v, Alternative n, Applicative m) => k v -> ViewMorphism m n (v g) (Vessel k g) Source #