primus-0.3.0.0: nonempty and positive functions
Copyright(c) Grant Weyburne 2022
LicenseBSD-3
Safe HaskellSafe-Inferred
LanguageHaskell2010

Primus.Rep

Description

 
Synopsis

Documentation

buildRepL :: forall f a b. (Traversable f, Representable f) => ([Rep f] -> [Rep f] -> b -> Rep f -> (b, a)) -> b -> (b, f a) Source #

builds a representable from the left using past and future inputs

buildRepR :: forall f a b. (Traversable f, Representable f) => ([Rep f] -> [Rep f] -> b -> Rep f -> (b, a)) -> b -> (b, f a) Source #

same as buildRepL but associates to the right

fillRep :: forall f a. (Representable f, Traversable f) => [a] -> Either String ([a], f a) Source #

fill a representable container with a foldable

toEnumRep :: forall f a. (Traversable f, Representable f, Enum a, Bounded a) => Integer -> Either String (f a) Source #

load a fixed container with "a"s using the relative position "i"

izipWithR :: Representable f => (Rep f -> a -> b -> c) -> f a -> f b -> f c Source #

zipWith with rep index

izipWithRF :: (Representable f, Distributive g) => (Rep f -> a -> b -> g c) -> f a -> f b -> g (f c) Source #

zipWithM with rep index

ipostscanr :: (Representable f, Traversable f) => (Rep f -> a -> b -> b) -> b -> f a -> f b Source #

like scanr passes in the Rep index and removes the first element

ipostscanl :: (Representable f, Traversable f) => (Rep f -> b -> a -> b) -> b -> f a -> f b Source #

like scanl passes in the Rep index and removes the last element

unfoldlRep :: (Representable f, Traversable f) => (Rep f -> s -> (s, a)) -> s -> (s, f a) Source #

left/right unfold from the right into a Representable

unfoldrRep :: (Representable f, Traversable f) => (Rep f -> s -> (s, a)) -> s -> (s, f a) Source #

left/right unfold from the right into a Representable