Module

ApplicativePhases

Package
purescript-applicative-phases
Repository
artemisSystem/purescript-applicative-phases

#Phases Source

data Phases :: (Type -> Type) -> Type -> Typedata Phases f a

Constructors

  • Nil a
  • Cons (forall r. (forall y z. (y -> z -> a) -> f y -> Phases f z -> r) -> r)

Instances

#now Source

now :: forall @f @a. f a -> Phases f a

Create a singleton list.

#later Source

later :: forall @f @a. Applicative f => Phases f a -> Phases f a

Delay all of a list's computations by one phase.

#phase Source

phase :: forall @f @a. Applicative f => Int -> f a -> Phases f a

Insert a computation at the given index/"phase". The first phase is 0, and providing a number lower than 0 also inserts at phase 0.

#foldPhases Source

foldPhases :: forall @f. Applicative f => (Phases f) ~> f

Fold a list of computations into a single computation.

#cons Source

cons :: forall @f @a @b. f (a -> b) -> Phases f a -> Phases f b

Append a computation to the start of a list, applying the result of the new computation to the result of the rest of the list.

#(:) Source

Operator alias for ApplicativePhases.cons (right-associative / precedence 6)

#consFst Source

consFst :: forall @f @a @b. f a -> Phases f b -> Phases f a

Append a computation to the start of a list, keeping only the result of that first computation.

#consSnd Source

consSnd :: forall @f @a @b. f a -> Phases f b -> Phases f b

Append a computation to the start of a list, keeping only the result of the tail of the list.

#cons' Source

cons' :: forall @f @a @b @c. (a -> b -> c) -> f a -> Phases f b -> Phases f c

Append a computation to the start of a list, providing a combining function.

#index Source

index :: forall @f @a. Applicative f => Int -> Phases f a -> f Unit

Get the computation at a certain index, returning pure unit if out of bounds.

#index' Source

index' :: forall @f @a. Functor f => Int -> Phases f a -> Maybe (f Unit)

Get the computation at a certain index.

#head Source

head :: forall @f @a. Applicative f => Phases f a -> f Unit

Get the first computation, returning pure unit if there isn't one.

#tail Source

tail :: forall @f @a. Applicative f => Phases f a -> Phases f Unit

Get all the computations except the first, returning an empty list if there are none.

#head' Source

head' :: forall @f @a. Functor f => Phases f a -> Maybe (f Unit)

Get the first computation.

#tail' Source

tail' :: forall @f @a. Phases f a -> Maybe (Phases f Unit)

Get all the computations except the first.

#null Source

null :: forall @f @a. Phases f a -> Boolean

Check if a list is empty.

#length Source

length :: forall @f @a. Phases f a -> Int

Find the length of a list.