Search results

liftA1 :: forall f a b. Applicative f => (a -> b) -> f a -> f b

liftA1 provides a default implementation of (<$>) for any Applicative functor, without using (<$>) as provided by the Functor-Applicative superclass relationship.

liftA1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftA1
liftM1 :: forall m a b. Monad m => (a -> b) -> m a -> m b

liftM1 provides a default implementation of (<$>) for any Monad, without using (<$>) as provided by the Functor-Monad superclass relationship.

liftM1 can therefore be used to write Functor instances as follows:

instance functorF :: Functor F where
  map = liftM1
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
mapDefault :: forall i f a b. FunctorWithIndex i f => (a -> b) -> f a -> f b

A default implementation of Functor's map in terms of mapWithIndex

squigglyMap :: forall f a b. Functor f => (a -> b) -> f a -> f b
map :: forall p q a b. Dissect p q => (a -> b) -> p a -> p b

A tail-recursive map operation, implemented in terms of Dissect.

map :: forall a c b. HasMap a => (b -> c) -> a b -> a c
map :: forall f a b. Functor f => (a -> b) -> f a -> f b
map :: forall a b. Ord b => (a -> b) -> Set a -> Set b

Maps over the values in a set.

This operation is not structure-preserving for sets, so is not a valid Functor. An example case: mapping const x over a set with n > 0 elements will result in a set with one element.

map :: forall a b. Ord b => (a -> b) -> NonEmptySet a -> NonEmptySet b

Maps over the values in a set.

This operation is not structure-preserving for sets, so is not a valid Functor. An example case: mapping const x over a set with n > 0 elements will result in a set with one element.

map :: forall a b. Hashable b => (a -> b) -> HashSet a -> HashSet b

Construct a new set by applying a function to each element of an input set.

If distinct inputs map to the same output, this changes the cardinality of the set, therefore hash set is not a Functor. Also, the order in which elements appear in the new set is entirely dependent on the hash function for type b.

withUor :: forall a b. (a -> b) -> UndefinedOr a -> UndefinedOr b
pseudoMap :: forall a b. (a -> b) -> Opt a -> Opt b
mapEvent :: forall b a. (a -> b) -> HTML a -> HTML b

Map HTML with event type a to HTML with event type b.

It's important that memoize is only used at a top-level declaration – not inside a view. This is because PureScript is eagerly evaluated like JavaScript. If memoize is used inside a view it will recreate the memoized function every time the view is called.

map :: forall a b. Ord b => (a -> b) -> OSet a -> OSet b

Maps over the values in a set.

This operation is not structure-preserving for sets, so is not a valid Functor. An example case: mapping const x over a set with n > 0 elements will result in a set with one element.

map :: forall a b. (a -> b) -> Seq a -> Seq b

O(n). Apply a function to every element within a sequence. Note that this function is performed lazily — the actual call is almost instantaneous, regardless of the length of the sequence, because the function is not applied to all elements immediately. The eventual running time (assuming all elements are later requested) is O(n), though.

map :: forall b a. NotJSPromise b => (a -> b) -> PromiseSpec a -> PromiseSpec b

map the value in a promise spec

map :: forall b a. Hashable b => (a -> b) -> MultiSet a -> MultiSet b
extent' :: forall m d. Magnitude m => (d -> m) -> Array d -> Array m
fmap :: forall b a. (a -> b) -> Event a -> Event b
map :: forall b a. (a -> b) -> List a -> List b
map :: forall msgA msgB. (msgA -> msgB) -> Document msgA -> Document msgB
mapChange :: forall c d. (c -> d) -> Change c -> Change d

Transform a Change by applying a function to both old and new values.

mapImpl :: forall a b. (a -> b) -> AffList a -> AffList b
mapNullable :: forall b a. NeverNull b => (a -> b) -> Nullable a -> Nullable b

Change the value inside a Nullable using a function.

mMap :: forall a b. (a -> b) -> Music a -> Music b
pMap :: forall a b. (a -> b) -> Primitive a -> Primitive b
smap :: forall b a. (a -> b) -> Slice a -> Slice b

Apply a function to each element in a slice, creating a new slice.

smap :: forall b a. (a -> b) -> Slice a -> Slice b

Apply a function to each element in a slice, creating a new slice.

uop :: forall a b. (a -> b) -> AudioParameter_ a -> AudioParameter_ b
updateBody :: forall a b. (a -> b) -> Response a -> Response b
map :: forall b a. (a -> b) -> SortedArray a -> Array b

Functor-like convenience function, equivalent to unwrapping and applying the Array map.

s_fmap :: forall b a. (a -> b) -> Signal a -> SigBuilder b
shouldNotSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
shouldSatisfyM_Flipped :: forall m a. MonadThrow Error m => Show a => (a -> Boolean) -> m a -> m Unit
use1 :: forall a x. (a -> x) -> (Case1 a -> F x)
mapRecord :: forall a b rin rout. HFoldlWithIndex (MapRecord a b) (Builder (Record ()) (Record ())) (Record rin) (Builder (Record ()) (Record rout)) => (a -> b) -> Record rin -> Record rout

Recursively maps a record using a function f.

let
  f :: Int -> String
  f i = show (i + 1)
mapRecord  f { a : { b : 10, c : { d: 20, e : Just "hello" }}, f : 30 }
-- { a : { b : "11", c : { d: "21", e : Just "hello" }, f : "31" }
mapUniformRecord :: forall row xs a b row'. RowToList row xs => MapUniformRecord xs row a b () row' => (a -> b) -> Record row -> Record row'
mapRecord :: forall row xs a b row'. RowToList row xs => MapRecord xs row a b () row' => (a -> b) -> Record row -> Record row'
alter' :: forall a b. (a -> b /\ (Array (Tree b))) -> Tree a -> Tree b

Traverse the nodes of given tree with the function, building a new tree with updated values and children |

defaultFilter :: forall a h f. BooleanEq h => Applicative f => Foldable f => Monoid (f a) => (a -> h) -> f a -> f a
filter :: forall f h a. Filterable f => BooleanEq h => (a -> h) -> f a -> f a
mapRecord :: forall a b rin rout. HFoldlWithIndex (MapRecord a b) (Builder (Record ()) (Record ())) (Record rin) (Builder (Record ()) (Record rout)) => (a -> b) -> Record rin -> Record rout

Recursively maps a record using a function f.

let
  f :: Int -> String
  f i = show (i + 1)
mapRecord  f { a : { b : 10, c : { d: 20, e : Just "hello" }}, f : 30 }
-- { a : { b : "11", c : { d: "21", e : Just "hello" }, f : "31" }
mapRecord :: forall row rowList a b row'. RowToList row rowList => MapRecord rowList row a b () row' => (a -> b) -> Record row -> Record row'
modifyNodeValue :: forall a. (a -> a) -> Tree a -> Tree a

Modify the value of a node.

modifyValue :: forall a. (a -> a) -> Loc a -> Loc a

Modify the value of the current Node.

filter :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a
filterDefault :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using filterMap.

filterDefaultPartition :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using partition.

filterDefaultPartitionMap :: forall f a. Filterable f => (a -> Boolean) -> f a -> f a

A default implementation of filter using partitionMap.

modify :: forall m s. MonadEffect m => (s -> s) -> Ref s -> m s
iterateUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).

iterateUntil :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result satisfies a predicate, and return that result (discarding all others).

iterateWhile :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).

iterateWhile :: forall m a. MonadRec m => (a -> Boolean) -> m a -> m a

Execute an action repeatedly until its result fails to satisfy a predicate, and return that result (discarding all others).

modify :: forall b. (b -> b) -> Buffer b -> Buffer b
modifyNodeValue :: forall a. (a -> a) -> Tree a -> Tree a

Modify the value of a node.

modifyValue :: forall a. (a -> a) -> Loc a -> Loc a

Modify the value of the current Node.

retryUntil :: forall m a. Monad m => (a -> Boolean) -> m a -> m a

Repeat a computation until the value satisfies a predicate

update :: forall n. (n -> n) -> Tree n -> Tree n

Update value of the tree node using its current value. |

findEachIndex :: forall a. (a -> Boolean) -> Array a -> Array Int
modifyAndRead :: forall m s. MonadEffect m => (s -> s) -> Ref s -> m s
dropWhile :: forall f a. Container f => (a -> Boolean) -> f a -> f a
filter :: forall a b. HasFilter a => (b -> Boolean) -> a b -> a b
findAllIndices :: forall a. (a -> Boolean) -> List a -> List Int
findIndex :: forall f a. Container f => (a -> Boolean) -> f a -> Maybe Int
findIndices :: forall a. (a -> Boolean) -> Array a -> Array Int

Find the all the indices for which a predicate holds.

findIndices (contains $ Pattern "b") ["a", "bb", "b", "d"] = [1, 2]
findIndices (contains $ Pattern "x") ["a", "bb", "b", "d"] = []
modifyCurrent :: forall a. (a -> a) -> ZipperArray a -> ZipperArray a
modifyFocus :: forall a. (a -> a) -> ArrayZipper a -> ArrayZipper a

Uses a function to update the focus element. O(n)

modifyNodeValue :: forall a. (a -> a) -> Tree a -> Tree a

Modify the value of a node.

modifyRef :: forall s m. MonadEffect m => (s -> s) -> Ref s -> m s
modifyValue :: forall a. (a -> a) -> Loc a -> Loc a

Modify the value of the current Node.

modifyX :: forall a. (a -> a) -> Vec a -> Vec a

Modifies the X component of a vector

> modifyX (add 10) (Vec 3 4)
Vec 13 4
modifyX :: forall a. (a -> a) -> Vec a -> Vec a

Modifies the X component of a vector

> modifyX (add 10) (Vec 3 4 2)
Vec 13 4 2
modifyY :: forall a. (a -> a) -> Vec a -> Vec a

Modifies the Y component of a vector

> modifyY (add 10) (Vec 3 4)
Vec 3 14
modifyY :: forall a. (a -> a) -> Vec a -> Vec a

Modifies the Y component of a vector

> modifyY (add 10) (Vec 3 4 2)
Vec 3 14 2
modifyZ :: forall a. (a -> a) -> Vec a -> Vec a

Modifies the Z component of a vector

> modifyZ (add 10) (Vec 3 4 2)
Vec 3 4 20
modParam :: forall a. (a -> a) -> AudioParameter_ a -> AudioParameter_ a
until :: forall a m. Monad m => (a -> Boolean) -> m a -> m a
findIndex :: forall a. (a -> Boolean) -> Array a -> Maybe Int

Find the first index for which a predicate holds.

findIndex (contains $ Pattern "b") ["a", "bb", "b", "d"] = Just 1
findIndex (contains $ Pattern "x") ["a", "bb", "b", "d"] = Nothing
findIndex :: forall a. (a -> Boolean) -> NonEmptyArray a -> Maybe Int
findLastIndex :: forall a. (a -> Boolean) -> Array a -> Maybe Int

Find the last index for which a predicate holds.

findLastIndex (contains $ Pattern "b") ["a", "bb", "b", "d"] = Just 2
findLastIndex (contains $ Pattern "x") ["a", "bb", "b", "d"] = Nothing
findLastIndex :: forall a. (a -> Boolean) -> NonEmptyArray a -> Maybe Int
sortWith :: forall a b. Ord b => (a -> b) -> Array a -> Array a

Sort the elements of an array in increasing order, where elements are sorted based on a projection. Sorting is stable: the order of elements is preserved if they are equal according to the projection.

sortWith (_.age) [{name: "Alice", age: 42}, {name: "Bob", age: 21}]
   = [{name: "Bob", age: 21}, {name: "Alice", age: 42}]
sortWith :: forall a b. Ord b => (a -> b) -> NonEmptyArray a -> NonEmptyArray a
modify :: forall s. (s -> s) -> Ref s -> Effect s

Update the value of a mutable reference by applying a function to the current value. The updated value is returned.

findIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the first index for which a predicate holds.

findIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the first index for which a predicate holds.

findIndex :: forall a. (a -> Boolean) -> NonEmptyList a -> Maybe Int
findLastIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the last index for which a predicate holds.

findLastIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the last index for which a predicate holds.

findLastIndex :: forall a. (a -> Boolean) -> NonEmptyList a -> Maybe Int
all :: forall a t. TypedArray a t => (t -> Boolean) -> ArrayView a -> Effect Boolean

Test a predicate to pass on all values.

any :: forall a t. TypedArray a t => (t -> Boolean) -> ArrayView a -> Effect Boolean

Test a predicate to pass on any value.

findIndex :: forall a. (a -> Boolean) -> OSet a -> Maybe Int
findLastIndex :: forall a. (a -> Boolean) -> OSet a -> Maybe Int
sortWith :: forall a b. Ord b => (a -> b) -> OSet a -> OSet a
findIndex :: forall a. (a -> Boolean) -> TwoOrMore a -> Maybe Int
withContext' :: forall ctx props. (props -> ctx) -> ReactClass props -> ReactClass props
findBy :: forall a. (a -> Boolean) -> Play a -> Maybe (ItemPath /\ (Play a))

Find the first sub-layout in the layout tree in the layout tree that satisfies the given predicate. Returns Nothing if no such item exists. The returned value includes both the path to the item and the item itself. Root is at path [].

findByInLayout :: forall a. (a -> Boolean) -> Layout a -> Maybe (ItemPath /\ (Tree (WithRect a)))

Find the first sub-layout in the layout tree in the layout tree that satisfies the given predicate. Returns Nothing if no such item exists. The returned value includes both the path to the item and the item itself. Root is at path [].

modify :: forall s. (s -> s) -> BehaviorRef s -> Effect s
_splitByBreak' :: (Words -> Doc) -> Array Words -> Array Doc
findIndex :: forall a. (a -> Boolean) -> ArrayView a -> Maybe Int
findIndex :: forall a. (a -> Boolean) -> NonEmptyArrayView a -> Maybe Int
findIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the first index for which a predicate holds.

findLastIndex :: forall a. (a -> Boolean) -> ArrayView a -> Maybe Int
findLastIndex :: forall a. (a -> Boolean) -> NonEmptyArrayView a -> Maybe Int
findLastIndex :: forall a. (a -> Boolean) -> List a -> Maybe Int

Find the last index for which a predicate holds.

mapIndex :: forall row rowList a b row'. RowToList row rowList => MapIndex rowList row a b () row' => (String -> b) -> Proxy row -> Record row'
sortOn :: forall a b. Ord b => (a -> b) -> Array a -> Array a

Sort a list by a projection.

sortOn (\x -> if x == "dog" then 2 else 1) ["apple", "dog", "kiwi"] = ["apple", "kiwi", "dog"]
sortOn' :: forall a b. Ord b => (a -> b) -> Array a -> Array a

Sort a list by a projection. This version of sortOn uses the decorate-sort-undecorate paradigm or Schwartzian transform. Which means the projection for each entry will only be computed once at the cost of creating more data structures. You will have to benchmark your specific situation to find out whether sortOn or sortOn' is faster.

sortOn' (\x -> if x == "dog" then 2 else 1) ["apple", "dog", "kiwi"] = ["apple", "kiwi", "dog"]
sortWith :: forall b a. Ord b => (a -> b) -> ArrayView a -> ArrayView a
sortWith :: forall b a. Ord b => (a -> b) -> NonEmptyArrayView a -> NonEmptyArrayView a
sortWith :: forall b a. Ord b => (a -> b) -> List a -> List a

Sort the elements of a list in increasing order, where elements are sorted based on a projection

Running time: O(n*log(n)).

find :: forall a f. Foldable f => (a -> Boolean) -> f a -> Maybe a

Try to find an element in a data structure which satisfies a predicate.

dropWhile :: forall a. (a -> Boolean) -> Array a -> Array a

Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new array.

dropWhile (_ < 0) [-3, -1, 0, 4, -6] = [0, 4, -6]
filter :: forall a. (a -> Boolean) -> Array a -> Array a

Filter an array, keeping the elements which satisfy a predicate function, creating a new array.

filter (_ > 0) [-1, 4, -5, 7] = [4, 7]
takeWhile :: forall a. (a -> Boolean) -> Array a -> Array a

Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new array.

takeWhile (_ > 0) [4, 1, 0, -4, 5] = [4, 1]
takeWhile (_ > 0) [-1, 4] = []
dropWhile :: forall a. (a -> Boolean) -> List a -> List a

Drop those elements from the front of a list which match a predicate.

Running time (worst case): O(n)

dropWhile :: forall a. (a -> Boolean) -> List a -> List a

Drop those elements from the front of a list which match a predicate.

Running time (worst case): O(n)

filter :: forall a. (a -> Boolean) -> List a -> List a

Filter a list, keeping the elements which satisfy a predicate function.

Running time: O(n)

filter :: forall a. (a -> Boolean) -> List a -> List a

Filter a list, keeping the elements which satisfy a predicate function.

Running time: O(n)

takeWhile :: forall a. (a -> Boolean) -> List a -> List a

Take those elements from the front of a list which match a predicate.

Running time (worst case): O(n)

takeWhile :: forall a. (a -> Boolean) -> List a -> List a

Take those elements from the front of a list which match a predicate.

Running time (worst case): O(n)

filter :: forall a. Ord a => (a -> Boolean) -> Set a -> Set a

Filter out those values of a set for which a predicate on the value fails to hold.

filter :: forall a. (a -> Boolean) -> Object a -> Object a

Filter out those key/value pairs of a map for which a predicate on the value fails to hold.

filter :: forall a. (a -> Boolean) -> Emitter a -> Emitter a

Create an Emitter which only fires when a predicate holds.

modify_ :: forall m s. MonadEffect m => (s -> s) -> Ref s -> m Unit
filter :: forall a. (a -> Boolean) -> HashSet a -> HashSet a

Remove all elements from the set for which the predicate does not hold.

filter (const false) s == empty

derivative :: forall a. Eq a => Semiring a => (Int -> a) -> Polynomial a -> Polynomial a
dropWhileExcl :: forall a. (a -> Boolean) -> Array a -> Array a
dropWhileIncl :: forall a. (a -> Boolean) -> Array a -> Array a
reject :: forall a. (a -> Boolean) -> Array a -> Array a
takeWhileExcl :: forall a. (a -> Boolean) -> Array a -> Array a
takeWhileIncl :: forall a. (a -> Boolean) -> Array a -> Array a
deleteWith :: forall a. (a -> Boolean) -> OSet a -> OSet a

Delete first element matching the predicate.

dropWhile :: forall a. (a -> Boolean) -> OSet a -> OSet a
filter :: forall a. (a -> Boolean) -> OSet a -> OSet a
filter :: forall a. (a -> Boolean) -> Seq a -> Seq a

O(n). Create a new Seq which contains only those elements of the input Seq which satisfy the given predicate.

filter :: forall a. (a -> Boolean) -> Seq a -> Seq a

O(n). Create a new (possibly empty) sequence which contains only those elements of the input sequence which satisfy the given predicate.

filter :: forall a. (a -> Boolean) -> Vector a -> Vector a
reject :: forall a. (a -> Boolean) -> Vector a -> Vector a
takeWhile :: forall a. (a -> Boolean) -> OSet a -> OSet a
filter :: forall a. (a -> Boolean) -> Stream a -> Stream a

Filter a stream, keeping the elements which satisfy a predicate function, creating a new stream.

Semantically.

filter p s = filter (\(time, a) -> p x) s
filter :: forall a. (a -> Boolean) -> MultiSet a -> MultiSet a
filter :: forall a. (a -> Boolean) -> Stream a -> Stream a
modify :: forall m s. MonadEffect m => (s -> s) -> Ref s -> m Unit
withFilter :: forall node. (node -> Boolean) -> ForceConfig node -> ForceConfig node

Add a filter predicate (force only applies to matching nodes)

withFilter :: forall node. (node -> Boolean) -> ForceConfig node -> ForceConfig node

Add a filter predicate (force only applies to matching nodes)

deleteWith :: forall a. (a -> Boolean) -> Array a -> Array a

Find an element by a predicate and return an array without that element when it was found.

deleteWith (_ == 2) [2,1,3,2] == Just [1,3]
dropEndWhile :: forall a. (a -> Boolean) -> ResizeArray a -> ResizeArray a
dropWhile :: forall a. (a -> Boolean) -> ArrayView a -> ArrayView a

See also: span.

dropWhile :: forall a. (a -> Boolean) -> List a -> List a
dropWhile :: forall a. (a -> Boolean) -> ResizeArray a -> ResizeArray a
dropWhile :: forall a. (a -> Boolean) -> List a -> List a

Remove the longest initial sublist for which all element satisfy the specified predicate, creating a new list.

dropWhile :: forall a. (a -> Boolean) -> SortedArray a -> SortedArray a

Creates a new array by skipping the longest subarray of items that satisfy the specified predicate.

dropWhile :: forall a. (a -> Boolean) -> AffList a -> AffList a
dropWhileExcl :: forall a. (a -> Boolean) -> Array a -> Array a
dropWhileIncl :: forall a. (a -> Boolean) -> Array a -> Array a
filter :: forall a. (a -> Boolean) -> ArrayView a -> ArrayView a
filter :: forall a. (a -> Boolean) -> Event a -> Event a
filter :: forall a. (a -> Boolean) -> List a -> List a
filter :: forall a. (a -> Boolean) -> Iterable a -> Iterable a
filter :: forall a. (a -> Boolean) -> List a -> List a
filter :: forall a. (a -> Boolean) -> List a -> List a

Filter a list, keeping the elements which satisfy a predicate function, creating a new list.

Running time: O(n)

filter :: forall a. (a -> Boolean) -> Observable a -> Observable a
filter :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Filter items emitted by the source AsyncSubject by only emitting those that satisfy a specified predicate.

filter :: forall a. (a -> Boolean) -> BehaviorSubject a -> BehaviorSubject a

Filter items emitted by the source BehaviorSubject by only emitting those that satisfy a specified predicate.

filter :: forall a. (a -> Boolean) -> Observable a -> Observable a

Filter items emitted by the source Observable by only emitting those that satisfy a specified predicate. marble diagram

filter :: forall a. (a -> Boolean) -> ReplaySubject a -> ReplaySubject a

Filter items emitted by the source ReplaySubject by only emitting those that satisfy a specified predicate.

filter :: forall str a. SodiumStream str => (a -> Boolean) -> str a -> Stream a

Return a stream that only outputs events for which the predicate returns true.

filter :: forall a. (a -> Boolean) -> Series a -> Series a

Filter a series, keeping the elements which satisfy a predicate function, creating a new series.

filter :: forall a. (a -> Boolean) -> AffList a -> AffList a
filter :: forall a. (a -> Boolean) -> Event a -> Event a
filterEvent :: forall a. (a -> Boolean) -> Event a -> Event a
filterTree :: forall a. (a -> Boolean) -> Tree a -> Tree a

Recursively discard any shrinks whose outcome does not pass the predicate. /Note that the root outcome can never be discarded./

fixParallelLayout :: forall a. (a -> Boolean) -> PartitionNode a -> PartitionNode a

Fix parallel layout for sunburst diagrams

Makes children of "parallel" nodes share the parent's angular extent and stack radially (same angle, different radius) instead of dividing angular space. This is useful for visualizing simultaneous/overlapping elements.

The predicate function determines which nodes should be treated as "parallel". For example: \nodeData -> nodeData.nodeType == "parallel"

modifyRef_ :: forall s m. MonadEffect m => (s -> s) -> Ref s -> m Unit
reject :: forall a. (a -> Boolean) -> AffList a -> AffList a
reject :: forall k. Ord k => (k -> Boolean) -> Set k -> Set k
satisfy :: forall a. (a -> Boolean) -> Parser a -> Parser a
shiftFocusByFind :: forall a. (a -> Boolean) -> ArrayZipper a -> ArrayZipper a

Use a function to find and focus the first matching element in the array. If no element matches, the zipper is returned unchanged.

skipWhile :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Returns an AsyncSubject that skips all items emitted by the source AsyncSubject as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false.

skipWhile :: forall a. (a -> Boolean) -> BehaviorSubject a -> BehaviorSubject a

Returns an BehaviorSubject that skips all items emitted by the source BehaviorSubject as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false.

skipWhile :: forall a. (a -> Boolean) -> Observable a -> Observable a

Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false. marble diagram

skipWhile :: forall a. (a -> Boolean) -> ReplaySubject a -> ReplaySubject a

Returns an ReplaySubject that skips all items emitted by the source ReplaySubject as long as a specified condition holds true, but emits all further source items as soon as the condition becomes false.

takeWhile :: forall a. (a -> Boolean) -> ArrayView a -> ArrayView a

See also: span.

takeWhile :: forall a. (a -> Boolean) -> List a -> List a

Calculate the longest initial sublist for which all element satisfy the specified predicate, creating a new list.

takeWhile :: forall a. (a -> Boolean) -> AsyncSubject a -> AsyncSubject a

Emits values emitted by the source AsyncSubject so long as each value satisfies the given predicate, and then completes as soon as this predicate is not satisfied.

takeWhile :: forall a. (a -> Boolean) -> BehaviorSubject a -> BehaviorSubject a

Emits values emitted by the source BehaviorSubject so long as each value satisfies the given predicate, and then completes as soon as this predicate is not satisfied.

takeWhile :: forall a. (a -> Boolean) -> Observable a -> Observable a

Emits values emitted by the source Observable so long as each value satisfies the given predicate, and then completes as soon as this predicate is not satisfied.

takeWhile :: forall a. (a -> Boolean) -> ReplaySubject a -> ReplaySubject a

Emits values emitted by the source ReplaySubject so long as each value satisfies the given predicate, and then completes as soon as this predicate is not satisfied.

takeWhile :: forall a. (a -> Boolean) -> SortedArray a -> SortedArray a

Creates a new array by taking the longest subarray of items that satisfy the specified predicate.

takeWhile :: forall a. (a -> Boolean) -> AffList a -> AffList a
takeWhileExcl :: forall a. (a -> Boolean) -> Array a -> Array a
takeWhileIncl :: forall a. (a -> Boolean) -> Array a -> Array a
traceDynWith :: forall a. DebugWarning => (a -> String) -> Dynamic a -> Dynamic a

Note: tracing will work only when something will subscribe to returned Dynamic.

traceEventWith :: forall a. DebugWarning => (a -> String) -> Event a -> Event a

Note: tracing will work only when something will subscribe to returned Event.

dropWhile :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a
filter :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a
find :: forall a. (a -> Boolean) -> Array a -> Maybe a

Find the first element for which a predicate holds.

find (contains $ Pattern "b") ["a", "bb", "b", "d"] = Just "bb"
find (contains $ Pattern "x") ["a", "bb", "b", "d"] = Nothing
find :: forall a. (a -> Boolean) -> NonEmptyArray a -> Maybe a
takeWhile :: forall a. (a -> Boolean) -> NonEmptyArray a -> Array a
modify_ :: forall s. (s -> s) -> Ref s -> Effect Unit

A version of modify which does not return the updated value.

dropWhile :: forall a. (a -> Boolean) -> NonEmptyList a -> List a
filter :: forall a. (a -> Boolean) -> NonEmptyList a -> List a
takeWhile :: forall a. (a -> Boolean) -> NonEmptyList a -> List a
cmap :: forall f a b. Contravariant f => (b -> a) -> f a -> f b
censor :: forall w m a. MonadWriter w m => (w -> w) -> m a -> m a

Modify the final accumulator value by applying a function.

local :: forall e w a. ComonadEnv e w => (e -> e) -> w a -> w a
local :: forall r m a. MonadReader r m => (r -> r) -> m a -> m a
seeks :: forall s a w. ComonadStore s w => (s -> s) -> w a -> w a

Reposition the focus at the specified position, which depends on the current position.

filter :: forall a. Ord a => (a -> Boolean) -> NonEmptySet a -> Set a

Filter out those values of a set for which a predicate on the value fails to hold.

find :: forall a. (a -> Boolean) -> Vector a -> Maybe a
censorAccum :: forall acc html a. Accum acc html => (acc -> acc) -> html a -> html a
setCtx :: forall ctx html a. Ctx ctx html => (ctx -> ctx) -> html a -> html a
buildIntMap :: forall node. (node -> Int) -> Array node -> IntMap node

Build an IntMap from nodes using an index accessor

buildIntMap :: forall node. (node -> Int) -> Array node -> IntMap node

Build an IntMap from nodes using an index accessor

largestWhere :: forall a. Ord a => (a -> Boolean) -> Array a -> Maybe a
mapErr :: forall e m a. MonadError e m => (e -> e) -> m a -> m a
modify_ :: forall s. (s -> s) -> BehaviorRef s -> Effect Unit
smallestWhere :: forall a. Ord a => (a -> Boolean) -> Array a -> Maybe a
dropWhile :: forall a. (a -> Boolean) -> NonEmptyArrayView a -> ArrayView a
filter :: forall a. (a -> Boolean) -> NonEmptyArrayView a -> ArrayView a
takeWhile :: forall a. (a -> Boolean) -> NonEmptyArrayView a -> ArrayView a
withLayerScale :: forall a. (Int -> Number) -> TreeConfig a -> TreeConfig a

Configuration with custom layer scaling

Common patterns:

  • \d -> toNumber d ** 1.5 - compressed at top, expanded at bottom
  • \d -> log (toNumber d + 1.0) - very flat at top
  • \d -> sqrt (toNumber d) - moderate compression at top
resize :: forall m a. MonadGen m => (Size -> Size) -> m a -> m a

Modifies the size state for a random generator.

toAff' :: forall a. (Foreign -> Error) -> Promise a -> Aff a

Convert a Promise into an Aff with custom Error coercion. When the promise rejects, we attempt to coerce the error value into an actual JavaScript Error object using the provided function.

toAff' :: forall a. (Rejection -> Error) -> Promise a -> Aff a

Convert a Promise into an Aff with custom Error coercion. When the promise rejects, we attempt to coerce the error value into an actual JavaScript Error object using the provided function.

map :: forall a t. TypedArray a t => (t -> t) -> ArrayView a -> ArrayView a

Maps a new value over the typed array, creating a new ArrayBuffer and typed array as well.

modCompleter :: forall f a. HasCompleter f => (Completer -> Completer) -> f a -> f a
cmapProps :: forall props' props. (props' -> props) -> ReactClass props -> ReactClass props'

Turn ReactClass into contravariant functor It returns a React stateless component

bindFlipped :: forall m a b. Bind m => (a -> m b) -> m a -> m b

bindFlipped is bind with its arguments reversed. For example:

print =<< random
extend :: forall w b a. Extend w => (w a -> b) -> w a -> w b
coyoneda :: forall f a b. (a -> b) -> f a -> Coyoneda f b

Construct a value of type Coyoneda f b from a mapping function and a value of type f a.

filterMap :: forall f a b. Filterable f => (a -> Maybe b) -> f a -> f b
filterMapByWither :: forall t a b. Witherable t => (a -> Maybe b) -> t a -> t b

A default implementation of filterMap given a Witherable.

filterMapDefault :: forall f a b. Filterable f => (a -> Maybe b) -> f a -> f b

A default implementation of filterMap using separate. Note that this is almost certainly going to be suboptimal compared to direct implementations.

locally :: forall a. (LocalOptions -> LocalOptions) -> Doc a -> Doc a

EXPERIMENTAL: modifies printing state and options locally for a document. This may change or be removed at any time.

overFailure :: forall a. (ParserHelp -> ParserHelp) -> ParserResult a -> ParserResult a
withReadM :: forall a. (String -> String) -> ReadM a -> ReadM a
mapMaybe :: forall html msg1 msg2. MapMaybe html => (msg1 -> Maybe msg2) -> html msg1 -> html msg2
locally :: forall a. (LocalOptions -> LocalOptions) -> FormatDoc a -> FormatDoc a
mapDisplayName :: forall props. (String -> String) -> ReactClass props -> ReactClass props
scale :: forall a. (Int -> Int) -> Gen a -> Gen a
chain :: forall a c b. HasChain a => (b -> a c) -> a b -> a c
foldMap :: forall b a m. Monad m => Monoid b => (a -> b) -> StreamT m a -> m b
iterateM :: forall b a m. Monad m => (a -> m a) -> m a -> m b
locally :: forall a. (LocalOptions -> LocalOptions) -> FormatDoc a -> FormatDoc a

No further results.