Search results

catMaybes :: forall a. Array (Maybe a) -> Array a

Filter an array of optional values, keeping only the elements which contain a value, creating a new array.

catMaybes [Nothing, Just 2, Nothing, Just 4] = [2, 4]
P purescript-arrays M Data.Array
untilJust :: forall a m. MonadRec m => m (Maybe a) -> m a

Supplied computation will be executed repeatedly until it evaluates to Just value and then that value will be returned.

P purescript-tailrec M Control.Monad.Rec.Class
whileJust :: forall a m. Monoid a => MonadRec m => m (Maybe a) -> m a

While supplied computation evaluates to Just _, it will be executed repeatedly and results will be combined using monoid instance.

P purescript-tailrec M Control.Monad.Rec.Class
init :: forall a. Partial => Array a -> Array a

Get all but the last element of a non-empty array.

Running time: O(n), where n is the length of the array.

P purescript-arrays M Data.Array.Partial
nub :: forall a. Ord a => Array a -> Array a

Remove the duplicates from an array, creating a new array.

nub [1, 2, 1, 3, 3] = [1, 2, 3]
P purescript-arrays M Data.Array
nubEq :: forall a. Eq a => Array a -> Array a

Remove the duplicates from an array, creating a new array.

This less efficient version of nub only requires an Eq instance.

nubEq [1, 2, 1, 3, 3] = [1, 2, 3]
P purescript-arrays M Data.Array
reverse :: forall a. Array a -> Array a

Reverse an array, creating a new array.

reverse [] = []
reverse [1, 2, 3] = [3, 2, 1]
P purescript-arrays M Data.Array
sort :: forall a. Ord a => Array a -> Array a

Sort the elements of an array in increasing order, creating a new array. Sorting is stable: the order of equal elements is preserved.

sort [2, -3, 1] = [-3, 1, 2]
P purescript-arrays M Data.Array
tail :: forall a. Partial => Array a -> Array a

Get all but the first element of a non-empty array.

Running time: O(n), where n is the length of the array.

P purescript-arrays M Data.Array.Partial
filtered :: forall m a. MonadRec m => MonadGen m => m (Maybe a) -> m a

Creates a generator that repeatedly run another generator until it produces Just node. This will never halt if the input generator always produces Nothing.

P purescript-gen M Control.Monad.Gen
nubHash :: forall a. Hashable a => Array a -> Array a

Remove duplicates from an array.

Like nub from Data.Array, but uses a Hashable constraint instead of an Ord constraint.

P purescript-unordered-collections M Data.HashMap
compact :: forall f a. Compactable f => f (Maybe a) -> f a
P purescript-filterable M Data.Compactable
compactDefault :: forall f a. Functor f => Compactable f => f (Maybe a) -> f a
P purescript-filterable M Data.Compactable
defaultOrr :: forall m a. Plus m => Array (m a) -> m a
P purescript-concur-core M Control.MultiAlternative
orr :: forall m a. MultiAlternative m => Array (m a) -> m a
P purescript-concur-core M Control.MultiAlternative
untilJust :: forall m a. Monad m => m (Maybe a) -> m a

Run the supplied Maybe computation repeatedly until it returns a value. Returns that value.

P purescript-monad-loops M Control.Monad.Loops
untilJust :: forall m a. MonadRec m => m (Maybe a) -> m a

Run the supplied "Maybe" computation repeatedly until it returns a value. Returns that value.

P purescript-monad-loops M Control.Monad.Rec.Loops
extent :: forall m. Magnitude m => Array m -> Array m
P purescript-d3 M Graphics.D3.Util
getOutgoingTransactions :: forall a. Directional a => Array a -> Array a
P purescript-teller M Data.Teller.Transaction
initMonoid :: forall m. Monoid m => Array m -> Array m
P purescript-metajelo-web M Metajelo.View
lower :: forall a f. Rebuildable f => f (Maybe a) -> f a
P purescript-impulse M Impulse.Util.Rebuildable
nonNull :: forall a t. GraphQLType (t (Maybe a)) => t (Maybe a) -> t a

This function transforms any nullable type into a non-nullable type Doing so also influences the types accepted root value

nonNullableString :: ScalarType String
nonNullableString = nonNull string

Equivalent to JavaScript's new GraphQLNonNull(...)

P purescript-graphql M GraphQL.Type
ordNub :: forall a. Ord a => Array a -> Array a
P purescript-tupc M Content.Parse
untilSuccessful :: forall a m. Monad m => m (Maybe a) -> m a
P purescript-presto M Presto.Core.Operators
join :: forall a m. Bind m => m (m a) -> m a

Collapse two applications of a monadic type constructor into one.

P purescript-prelude M Control.Bind
oneOf :: forall f g a. Foldable f => Plus g => f (g a) -> g a

Combines a collection of elements using the Alt operation.

P purescript-foldable-traversable M Data.Foldable
singleton :: forall a. a -> Array a

Create an array of one element

singleton 2 = [2]
P purescript-arrays M Data.Array
oneOf :: forall m f a. MonadGen m => Foldable1 f => f (m a) -> m a

Creates a generator that outputs a value chosen from a selection of existing generators with uniform probability.

P purescript-gen M Control.Monad.Gen
parOneOf :: forall a t m f. Parallel f m => Alternative f => Foldable t => Functor t => t (m a) -> m a

Race a collection in parallel.

P purescript-parallel M Control.Parallel
wrapFree :: forall f m a. MonadFree f m => f (m a) -> m a
P purescript-free M Control.Monad.Free.Class
concat :: forall buf m. MutableBuffer buf m => Array buf -> m buf

Concatenates a list of buffers.

P purescript-node-buffer M Node.Buffer.Class
concat :: forall buf m. Array buf -> m buf
P purescript-node-buffer M Node.Buffer.Internal
integrateM :: forall a stM m base. Applicative base => MonadBaseControl base m stM => m (stM a) -> m a

Pack a state belonging to m back into it, instead of throwing it away

P purescript-monad-control M Control.Monad.Trans.Control
restoreM :: forall base m stM a. MonadBaseControl base m stM => base (stM a) -> m a
P purescript-monad-control M Control.Monad.Trans.Control
keepLatest :: forall event a. IsEvent event => event (event a) -> event a
P purescript-event M FRP.Event.Class
join :: forall v m c. HasBind c m => HasIdentity c => ObjectOf c (m v) => m (m v) -> m v
P purescript-subcategory M Control.Subcategory.Functor.HasBind
choice :: forall a g f. Foldable f => Alt g => Plus g => f (g a) -> g a
P purescript-simple-parser M Text.Parsing.Simple
flatten :: forall b a. HasChain a => a (a b) -> a b

Removes a level of nesting from a container.

flatten [[1, 2], [3, 4]] -- [1, 2, 3, 4]
P purescript-neon M Neon.Helper
oneOf :: forall a m f. Foldable f => Alternative m => f (m a) -> m a
P purescript-parsers M Text.Parsing.Combinators
toArray :: forall a b. HasToArray a b => a -> Array b
P purescript-neon M Neon.Class.HasToArray
warbler :: forall m a. Bind m => m (m a) -> m a

W combinator - warbler - omega

MM

Λ a b . (a → a → b) → a → b

λ f x . f x x

P purescript-birds M Aviary.Birds
pure :: forall f a. Applicative f => a -> f a
P purescript-prelude M Control.Applicative
forever :: forall m a b. MonadRec m => m a -> m b

forever runs an action indefinitely, using the MonadRec instance to ensure constant stack usage.

For example:

main = forever $ trace "Hello, World!"
P purescript-tailrec M Control.Monad.Rec.Class
singleton :: forall f a. Unfoldable1 f => a -> f a

Contain a single value. For example:

singleton "foo" == (NEL.singleton "foo" :: NEL.NonEmptyList String)
P purescript-unfoldable M Data.Unfoldable1
fold :: forall m. Monoid m => Array m -> m
P purescript-arrays M Data.Array
head :: forall a. Partial => Array a -> a

Get the first element of a non-empty array.

Running time: O(1).

P purescript-arrays M Data.Array.Partial
last :: forall a. Partial => Array a -> a

Get the last element of a non-empty array.

Running time: O(1).

P purescript-arrays M Data.Array.Partial
elements :: forall m f a. MonadGen m => Foldable1 f => f a -> m a

Creates a generator that outputs a value chosen from a selection with uniform probability.

P purescript-gen M Control.Monad.Gen
downFrom :: forall a u. Enum a => Unfoldable u => a -> u a

Produces all predecessors of an Enum value, excluding the start value.

P purescript-enums M Data.Enum
downFromIncluding :: forall a u. Enum a => Unfoldable1 u => a -> u a

Produces all predecessors of an Enum value, including the start value.

downFromIncluding top will return all values in an Enum, in reverse order.

P purescript-enums M Data.Enum