Search results
elem :: forall a f. Foldable f => Eq a => a -> f a -> Boolean
Test whether a value is an element of a data structure.
notElem :: forall a f. Foldable f => Eq a => a -> f a -> Boolean
Test whether a value is not an element of a data structure.
contains :: forall b a. HasEqual b => HasReduce a => b -> a b -> Boolean
Returns true if the container contains the element.
[1, 2, 3] :contains 2 -- true
[1, 0, 3] :contains 2 -- false
elem :: forall a. Eq a => a -> Array a -> Boolean
Returns true if the array has the given element.
elem :: forall a. Eq a => a -> NonEmptyArray a -> Boolean
notElem :: forall a. Eq a => a -> Array a -> Boolean
Returns true if the array does not have the given element.
notElem :: forall a. Eq a => a -> NonEmptyArray a -> Boolean
member :: forall a. Ord a => a -> Set a -> Boolean
Test if a value is a member of a set
member :: forall a. Ord a => a -> NonEmptySet a -> Boolean
Test if a value is a member of a set.
member :: forall a. Hashable a => a -> HashSet a -> Boolean
Test whether a value is in a set.
canFindEq :: forall a. Eq a => a -> Array a -> Boolean
canFindEq :: forall a. Eq a => a -> Vector a -> Boolean
eq :: forall n. Eq n => n -> Bound n -> Boolean
greaterThan :: forall n. Ord n => n -> Bound n -> Boolean
greaterThanOrEq :: forall n. Ord n => n -> Bound n -> Boolean
lessThan :: forall n. Ord n => n -> Bound n -> Boolean
lessThanOrEq :: forall n. Ord n => n -> Bound n -> Boolean
member :: forall n. Ord n => n -> Interval n -> Boolean
member :: forall a. Hashable a => a -> MultiSet a -> Boolean
notEq :: forall n. Eq n => n -> Bound n -> Boolean
contains :: forall a. Ord a => a -> Range a -> Boolean
Returns whether the range contains value a
contains :: forall a. Ord a => a -> Interval a -> Boolean
Whether a point falls within the interval (half-open: start <= x < end).
equals :: forall a. a -> EqPred a -> Boolean
member :: forall a. Ord a => a -> IntervalSet a -> Boolean
Whether a point is contained in any interval in the set. O(log n).
unsafeHas :: forall r1. String -> Record r1 -> Boolean
Checks if a record has a key, using a string for the key.
member :: forall a. String -> Object a -> Boolean
Test whether a String appears as a key in a map
lookupTag :: String -> List String -> Boolean
A specialized lookup function which bails early. Foldable's elem
is always worst-case.
inBounds :: forall a. Int -> Seq a -> Boolean
O(1). True if the given index specifies an element that exists in the sequence, false otherwise.
inBounds :: forall a. Int -> Seq a -> Boolean
O(1). True if the given index specifies an element that exists in the sequence, false otherwise.
existsAt :: forall a. Path -> Tree a -> Boolean
If the tree contains something at given path. |
hasSubUnits :: forall c. Int -> Money c -> Boolean
Check if the amount has fractional minor units at the given scale.
e.g. hasSubUnits 100 (fromCents 1050) is true (10.50 has sub-units),
hasSubUnits 100 (fromCents 1000) is false (10.00 has none).
isEqualTo :: forall a. RoomPosition -> TargetPosition a -> Boolean
isNearTo :: forall a. RoomPosition -> TargetPosition a -> Boolean
sectionContains :: forall a. Section -> Cell a -> Boolean
The sectionContains function tells if a section contains a cell.
fullscreen :: P5 -> (Maybe Boolean) -> Boolean
p5js.org documentation
isEnum :: String -> List TypeDefinition -> Boolean
isInEnumValuesDefinition :: String -> List EnumValueDefinition -> Boolean
isProbablePrime :: BigInt -> Maybe Int -> Boolean
isScalar :: String -> List TypeDefinition -> Boolean
intercalate :: forall f m. Foldable f => Monoid m => m -> f m -> m
Fold a data structure, accumulating values in some Monoid,
combining adjacent elements using the specified separator.
For example:
> intercalate ", " ["Lorem", "ipsum", "dolor"]
= "Lorem, ipsum, dolor"
> intercalate "*" ["a", "b", "c"]
= "a*b*c"
> intercalate [1] [[2, 3], [4, 5], [6, 7]]
= [2, 3, 1, 4, 5, 1, 6, 7]
intercalate :: forall f m. Foldable1 f => Semigroup m => m -> f m -> m
Fold a data structure using a Semigroup instance,
combining adjacent elements using the specified separator.
surround :: forall f m. Foldable f => Semigroup m => m -> f m -> m
fold but with each element surrounded by some fixed value.
For example:
> surround "*" []
= "*"
> surround "*" ["1"]
= "*1*"
> surround "*" ["1", "2"]
= "*1*2*"
> surround "*" ["1", "2", "3"]
= "*1*2*3*"
consMax :: forall a f. Foldable f => Ord a => a -> f a -> a
consMin :: forall a f. Foldable f => Ord a => a -> f a -> a
fromMaybe :: forall a. a -> Maybe a -> a
Takes a default value, and a Maybe value. If the Maybe value is
Nothing the default value is returned, otherwise the value inside the
Just is returned.
fromMaybe x Nothing == x
fromMaybe x (Just y) == y
intercalate :: forall a. Monoid a => a -> Array a -> a
intercalate :: forall a. Semigroup a => a -> NonEmptyArray a -> a
peek :: forall s w a. ComonadStore s w => s -> w a -> a
track :: forall t w a. ComonadTraced t w => t -> w a -> a
fromUndefinedOr :: forall a. a -> UndefinedOr a -> a
fromOpt :: forall a. a -> Opt a -> a
Let's be consistent with fromMaybe args order here
xpose :: forall a. Semiring a => a -> Polynomial a -> a
buildLeaf :: forall e f p v. ElementBuilder e f p v => e -> f p -> v
fromMaybeChurch :: forall a. a -> MaybeChurch a -> a
withDefault :: forall a. a -> Maybe a -> a
If the given value is Nothing, return the default. Otherwise return the
value.
withDefault 2 Nothing -- 2
withDefault 2 (Just 1) -- 1
eq1 :: forall f a. Eq1 f => Eq a => f a -> f a -> Boolean
notEq1 :: forall f a. Eq1 f => Eq a => f a -> f a -> Boolean
member :: forall k v. Ord k => k -> Map k v -> Boolean
Test if a key is a member of a map
default :: forall a r. a -> Variant r -> a
Combinator for partial matching with a default value in case of failure.
caseFn :: forall r. Variant (foo :: Int, bar :: String | r) -> String
caseFn = default "No match"
# on (Proxy :: Proxy "foo") (\foo -> "Foo: " <> show foo)
# on (Proxy :: Proxy "bar") (\bar -> "Bar: " <> bar)
withEvent :: forall e a. Eventable e a => a -> EventHandlers e -> a
Add an event handler to a markup node.
member :: forall k v. Hashable k => k -> HashMap k v -> Boolean
Test whether a key is in a map.
hasNode :: forall node weight. Ord node => node -> WeightedDigraph node weight -> Boolean
Check if a node exists in the graph
prj :: forall size a n' n t'' t' t. TupleSize size t => Lt n size => ShowNat n n' => ListToRow t t' => Cons n' a t'' t' => Nat n => n -> TupleN t -> a
Project a value of index n from a TupleN, using Data.TypeLevel.Num.Reps.dN as Nat values.
set :: forall @n a b. Set n a b => a -> Polynomial b -> b
isMember :: forall x xs r lproxy. IsMember x xs r => Proxy x -> lproxy xs -> Boolean
eq1 :: forall f a. Eq1 f => f a -> f a -> Boolean
equal :: forall r l f. REqual f l r => RowToList r l => f r -> f r -> Boolean
greaterThan1 :: forall f a. Ord1 f => f a -> f a -> Boolean
greaterThanOrEq1 :: forall f a. Ord1 f => f a -> f a -> Boolean
isInCycle :: forall v k. Ord k => k -> Graph k v -> Boolean
Checks if given key is part of a cycle.
lessThan1 :: forall f a. Ord1 f => f a -> f a -> Boolean
lessThanOrEq1 :: forall f a. Ord1 f => f a -> f a -> Boolean
member :: forall k v. EncodeKey k => k -> Map k v -> Boolean
member :: forall k v. Key k => k -> Map k v -> Boolean
Test whether a key appears in a map
notEq1 :: forall f a. Eq1 f => f a -> f a -> Boolean
sameElements :: forall a f. Foldable f => Eq a => f a -> f a -> Boolean
Checks if two arrays have exactly the same elements. The order of elements does not matter.
sameElements ["A", "B", "B"] ["B", "A", "B"] == true
sameElements ["A", "B", "B"] ["A", "B"] == false
typeVarKinded :: forall a e name. TypeVar a e => ToName name Ident => name -> Type e -> a
An overloaded constructor for kinded type variables.
apply :: forall b a f. f -> Array a -> b
elem :: forall w a. Ord a => a -> Graph a w -> Boolean
Test whether a vertex is in a graph.
isLongerThan :: forall b a t2 t1. Unconsable t1 => Unconsable t2 => t1 a -> t2 b -> Boolean
Checks whether the first list is longer than the second.
isOfSameLength :: forall b a t2 t1. Unconsable t1 => Unconsable t2 => t1 a -> t2 b -> Boolean
Checks whether two lists are of the same length.
isShorterThan :: forall b a t2 t1. Unconsable t1 => Unconsable t2 => t1 a -> t2 b -> Boolean
Checks whether the first list is shorter than the second.
member :: forall k v. Newtype k String => k -> ObjectMap k v -> Boolean
member :: forall k v. EncodeJson k => k -> ObjectMap k v -> Boolean
member :: forall v k. Hashable k => k -> HashMap k v -> Boolean
withEvent :: forall e a. Eventable e a => a -> EventHandlers e -> a
Add an event handler to a markup node.
unsafeGet :: forall r a. String -> Record r -> a
Unsafely gets a value from a record, using a string for the key.
If the key does not exist this will cause a runtime error elsewhere.
properSubset :: forall a. Ord a => Set a -> Set a -> Boolean
True if and only if the first set is a subset of the second set and the sets are not equal
properSubset :: forall a. Ord a => NonEmptySet a -> NonEmptySet a -> Boolean
True if and only if the first set is a subset of the second set and the sets are not equal.
subset :: forall a. Ord a => Set a -> Set a -> Boolean
True if and only if every element in the first set is an element of the second set
subset :: forall a. Ord a => NonEmptySet a -> NonEmptySet a -> Boolean
True if and only if every element in the first set is an element of the second set.
equal :: forall r rs. RowToList r rs => EqualFields rs r => Record r -> Record r -> Boolean
Check two records of the same type for equality.
isSubmap :: forall a. Eq a => Object a -> Object a -> Boolean
Test whether one map contains all of the keys and values contained in another map
unsafeGetCell :: forall a. Int -> Array a -> a
unsafeGetField :: forall r a. String -> Record r -> a
Unsafe field access (we've verified types at compile time)
properSubset :: forall a. Eq a => OSet a -> OSet a -> Boolean
subset :: forall a. Eq a => OSet a -> OSet a -> Boolean
contains :: String -> Map CaseInsensitiveString String -> Boolean
eqEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
eqStableName :: forall b a. StableName a -> StableName b -> Boolean
Equality on 'StableName' that does not require that the types of the arguments match.
greaterThanEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
greaterThanOrEqEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
lessThanEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
lessThanOrEqEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
notEqEverywhere :: forall a. Ord a => NonEmpty a -> NonEmpty a -> Boolean
abuts :: forall a. Ord a => Interval a -> Interval a -> Boolean
Whether two intervals are adjacent with no gap (one's end is the other's
start). Adjacent half-open intervals compose cleanly:
[a, b) abuts [b, c).
allTouchedImpl :: forall rl r. AllTouched rl r => RLProxy rl -> Record r -> Boolean
colinear :: forall a. Eq a => Field a => Vector a -> Vector a -> Boolean
returns true if v1 and v2 are colinear i.e. there exists a scalar n such that v1 = n v2 https://en.wikipedia.org/wiki/Collinearity
encloses :: forall a. Ord a => Interval a -> Interval a -> Boolean
Whether the first interval fully contains the second.
eqConstraint :: forall a b. Constraint a -> Constraint b -> Boolean
eqType :: forall a b. Type a -> Type b -> Boolean
eqTypeRep :: forall a b. TypeRep a -> TypeRep b -> Boolean
Compare two TypeRep, potentially of differing types, for equality
findTypeEq :: forall b a. FindType a -> FindType b -> Boolean
hasQueryParam :: forall route params. String -> Request route params -> Boolean
haveSameAmount :: forall c1 c2. Money c1 -> Money c2 -> Boolean
Compare amounts across different currencies (ignoring currency). Returns true if the underlying minor unit counts are equal.
haveSameContents :: forall a. Eq a => Array a -> Array a -> Boolean
invokeFunction :: forall f t. Corecursive t (SqlF f) => Ident -> List t -> t
isAfter :: forall a. Ord a => Interval a -> Interval a -> Boolean
Whether the first interval is entirely after the second (with or without gap).
isBefore :: forall a. Ord a => Interval a -> Interval a -> Boolean
Whether the first interval is entirely before the second (with or without gap).
lookEq :: forall b a. LookType a -> LookType b -> Boolean
matchesAny :: forall a. a -> Array (EqPred a) -> Boolean
mkClient :: forall routesSpec client. ClientApi routesSpec client => Options -> Spec routesSpec -> client
overlaps :: forall a. Ord a => Interval a -> Interval a -> Boolean
Whether two intervals share any time (colloquial "overlaps").
Adjacent intervals (Meets/MetBy) do NOT overlap in half-open semantics.
propertyPath :: forall b a. a -> Array String -> b
runFresh :: forall a. String -> Fresh a -> a
seq :: forall a. Eq a => Slice a -> Slice a -> Boolean
Equality test.
seq :: forall a. Eq a => Slice a -> Slice a -> Boolean
Equality test.
unsafeFromJustBecause :: forall a. String -> Maybe a -> a
unsafeFromJustBecause :: forall a. String -> Maybe a -> a
withOptionalStyle :: forall h. HasStyle h => h -> Maybe Style -> h
equalArrays :: Array Number -> Array Number -> Boolean
Uses equal to check that all numbers in the given arrays are approximately the same.
matchSegments :: Array String -> Array String -> Boolean
eq :: forall a. Eq a => a -> a -> Boolean
genericEq :: forall a rep. Generic a rep => GenericEq rep => a -> a -> Boolean
A Generic implementation of the eq member from the Eq type class.
genericEq' :: forall a. GenericEq a => a -> a -> Boolean
greaterThan :: forall a. Ord a => a -> a -> Boolean
Test whether one value is strictly greater than another.
greaterThanOrEq :: forall a. Ord a => a -> a -> Boolean
Test whether one value is non-strictly greater than another.
lessThan :: forall a. Ord a => a -> a -> Boolean
Test whether one value is strictly less than another.
lessThanOrEq :: forall a. Ord a => a -> a -> Boolean
Test whether one value is non-strictly less than another.
notEq :: forall a. Eq a => a -> a -> Boolean
notEq tests whether one value is not equal to another. Shorthand for
not (eq x y).
reallyUnsafeRefEq :: forall a b. a -> b -> Boolean
Compares two values of different types using strict (===) equality.
unsafeRefEq :: forall a. a -> a -> Boolean
Compares two values of the same type using strict (===) equality.
defaultEq :: forall r s. Eq s => Refer s r => r -> r -> Boolean
instanceOf :: forall a b. a -> b -> Boolean
Checks whether an object is an instance of an invokable
inside :: forall r p n. ToRegion n r => ToPos n p => Ord n => Semiring n => r -> p -> Boolean
Checks if a position is inside a region. Size of the region should be positive. Inclusive on the lower bound, exclusive on the higher bound.
outside :: forall r p n. ToRegion n r => ToPos n p => Ord n => Semiring n => r -> p -> Boolean
inside, but with its result negated.
parallel :: forall p n. ToPos n p => EuclideanRing n => Eq n => p -> p -> Boolean
Check if two vectors are parallel
perpendicular :: forall p n. ToPos n p => Semiring n => Eq n => p -> p -> Boolean
Check if two vectors are perpendicular
contains :: forall n. IsNode n => n -> n -> Boolean
absorption :: forall a. HeytingAlgebra a => Eq a => a -> a -> Boolean
antisymmetry :: forall a. Ord a => a -> a -> Boolean
x <= y && y <= x => x == y
commutative :: forall a. CommutativeRing a => Eq a => a -> a -> Boolean
commutative :: forall a. HeytingAlgebra a => Eq a => a -> a -> Boolean
compareHom :: forall a. BoundedEnum a => Ord a => a -> a -> Boolean
compare x y == compare (fromEnum x) (fromEnum y)
divides :: forall α. Eq α => EuclideanRing α => α -> α -> Boolean
genericEq1 :: forall a. GenericEq1 a => a -> a -> Boolean
greaterThan :: forall a. PartialOrd a => a -> a -> Boolean
greaterThanOrEq :: forall a. PartialOrd a => a -> a -> Boolean
integralDomain :: forall a. EuclideanRing a => Eq a => a -> a -> Boolean
lessThan :: forall a. PartialOrd a => a -> a -> Boolean
lessThanOrEq :: forall a. PartialOrd a => a -> a -> Boolean
negation :: forall a. Eq a => a -> a -> Boolean
x /= y => not (x == y)
notDivides :: forall α. Eq α => EuclideanRing α => α -> α -> Boolean
quotientRemainder :: forall a. EuclideanRing a => Eq a => a -> a -> Boolean
submultiplicative :: forall a. EuclideanRing a => Eq a => a -> a -> Boolean
symmetry :: forall a. Eq a => a -> a -> Boolean
x == y => y == x?
_equal :: forall a. HasEqual a => a -> a -> Boolean
_greater :: forall a. HasGreater a => a -> a -> Boolean
_greaterOrEqual :: forall a. HasEqual a => HasGreater a => a -> a -> Boolean
_less :: forall a. HasLess a => a -> a -> Boolean
_lessOrEqual :: forall a. HasEqual a => HasLess a => a -> a -> Boolean
_notEqual :: forall a. HasEqual a => a -> a -> Boolean
compareReference :: forall a. a -> a -> Boolean
divisibleBy :: forall a. HasEqual a => HasRemainder a => HasZero a => a -> a -> Boolean
Returns true if the number is divisible by the other.
9 :divisibleBy 3 -- true
8 :divisibleBy 3 -- false
eqById :: forall a. HasId a => a -> a -> Boolean
equal :: forall a. HasEqual a => a -> a -> Boolean
greater :: forall a. HasGreater a => a -> a -> Boolean
greaterOrEqual :: forall a. HasEqual a => HasGreater a => a -> a -> Boolean
Returns true if the value is greater than or equal to the other.
2 :greaterOrEqual 1 -- true
2 :greaterOrEqual 2 -- true
2 :greaterOrEqual 3 -- false
includes :: forall key range. IDBKey key => IDBKeyRange range => range -> key -> Boolean
Returns true if key is included in the range, and false otherwise.
includes :: forall range key. IDBKey key => IDBKeyRange range => range -> key -> Boolean
Returns true if key is included in the range, and false otherwise.
instanceof :: forall b a. a -> b -> Boolean
less :: forall a. HasLess a => a -> a -> Boolean
lessOrEqual :: forall a. HasEqual a => HasLess a => a -> a -> Boolean
Returns true if the value is less than or equal to the other.
2 :lessOrEqual 1 -- false
2 :lessOrEqual 2 -- true
2 :lessOrEqual 3 -- true
matchObjectsOnId :: forall a b. HasUuid a => HasUuid b => a -> b -> Boolean
modelHasChanged :: forall model. model -> model -> Boolean
notEqual :: forall a. HasEqual a => a -> a -> Boolean
Returns true if the value is not equal to the other.
2 :notEqual 1 -- true
1 :notEqual 1 -- true
notMatchObjectsOnId :: forall a b. HasUuid a => HasUuid b => a -> b -> Boolean
rEq :: forall r. Fold EqS r (AppCat (Function r) Function Boolean Boolean) => r -> r -> Boolean
fromRight :: forall a b. b -> Either a b -> b
A function that extracts the value from the Right data constructor.
The first argument is a default value, which will be returned in the
case where a Left is passed to fromRight.
hasOwnProperty :: forall o. String -> o -> Boolean
Does this object have the given property itself (i.e. not inherited)?
isIn :: forall a. String -> a -> Boolean
Is the given property found on the given object or via inheritance?
getModifierState :: forall e. IsKeyboardOrMouseEvent e => String -> e -> Boolean
Returns the state of a given modifier key during an event, as defined in https://reactjs.org/docs/events.html#keyboard-events
This function applies only to certain kinds of events, such as MouseEvent
or KeyboardEvent.
withDefault :: forall e a. a -> RemoteData e a -> a
If the RemoteData has been successfully loaded, return that,
otherwise return a default value.
vfromRight :: forall errorRows a. a -> Veither errorRows a -> a
Extract the value from a Veither, using a default value in case the underlying
Variant is storing one of the error rows' values.
vError :: Veither (foo :: Int) String
vError = Veither (inj (Proxy :: Proxy "foo") 4)
vSuccess :: Veither (foo :: Int) String
vSuccess = pure "yay"
vfromRight "" vError == ""
vfromRight "" vSuccess == "yay"
bind :: forall a. Semigroup a => a -> (a -> a) -> a
discard :: forall a. Semigroup a => a -> (Unit -> a) -> a
getFieldBool :: forall r. String -> r -> Boolean
instanceOf :: forall a. String -> a -> Boolean
invert :: forall scale domain range. Scale (scale domain range) => range -> scale domain range -> domain
sbind :: forall a. Semigroup a => a -> (Unit -> a) -> a
Utility function so you can define formats with do notation. For example:
myFormat = do
ifNegative $ literal "("
currencyCode
literal space
amount
ifNegative $ literal ")"
where discard = sbind
applyFlipped :: forall a b. a -> (a -> b) -> b
Applies an argument to a function. This is primarily used as the (#)
operator, which allows parentheses to be omitted in some cases, or as a
natural way to apply a value to a chain of composed functions.
fromLeft :: forall a b. a -> Either a b -> a
A function that extracts the value from the Left data constructor.
The first argument is a default value, which will be returned in the
case where a Right is passed to fromLeft.
default :: forall a b r. a -> VariantF r b -> a
Combinator for partial matching with a default value in case of failure.
caseFn :: forall r. VariantF (foo :: Maybe, bar :: Tuple String | r) Int -> String
caseFn = default "No match"
# on (Proxy :: Proxy "foo") (\foo -> "Foo: " <> maybe "nothing" show foo)
# on (Proxy :: Proxy "bar") (\bar -> "Bar: " <> show (snd bar))
trace :: forall a b. DebugWarning => a -> (Unit -> b) -> b
Log any PureScript value to the console for debugging purposes and then
return a value. This will log the value's underlying representation for
low-level debugging, so it may be desireable to show the value first.
The return value is thunked so it is not evaluated until after the message has been printed, to preserve a predictable console output.
For example:
doSomething = trace "Hello" \_ -> ... some value or computation ...
evalState :: forall s a. s -> State s a -> a
Runs a computation inside of State, discarding the final state.
execState :: forall s a. s -> State s a -> s
Runs a computation inside of State, discarding the final result.
runReader :: forall r a. r -> Reader r a -> a
Runs a computation inside of Reader.
foldMap' :: forall b a f. Foldable f => Functor f => Monoid b => Eq b => (a -> b) -> f a -> Boolean
fold (map f x) == foldMap f x
get :: forall v s r' r l g f. Cons s v r' r => RGet f g s l r => RowToList r l => g s -> f r -> v
match :: forall v r1 r0 l1 l0 g f. RMatch f g v l0 r0 l1 r1 => RowToList r0 l0 => RowToList r1 l1 => f r0 -> g r1 -> v
peek :: forall a s. s -> Store s a -> a
- Law: peek (pos x) x = extract x
- Proof:
- RHS := extract (f, s) = f s
- LHS := peek (pos (f, s)) (f, s) =
- peek s (f, s) =
- peek s (f, _) = f s
track :: forall m a. Monoid m => m -> Traced m a -> a
- Law: track mempty = extract
- Proof:
- First, rewrite as: track mempty f = extract f
- RHS := f mempty
- LHS := f mempty
- Law: (track s =<= track t) x = track (s <> t) x
- Proof:
- RHS := track (s <> t) x = x (s <> t)
- LHS := composeCoKliesliFlipped (track s) (track t) x =
- track s (track t <<= x) =
- track s (extend (track t) x) =
- track s (\ t' -> (track t) \ t'' -> x (t' <> t'')) =
- track s (\ t' -> x (t' <> t)) =
- x (s <> t)
_call :: forall b a. a -> (a -> b) -> b
all :: forall b a. HasReduce a => (b -> Boolean) -> a b -> Boolean
Returns true if all of the elements in the collection pass the predicate.
[2, 3] :all (_ > 1) -- true
[2, 1] :all (_ > 1) -- false
any :: forall b a. HasReduce a => (b -> Boolean) -> a b -> Boolean
Returns true if any of the elements in the collection pass the predicate.
[1, 2] :any (_ > 1) -- true
[1, 0] :any (_ > 1) -- false
bindTo :: forall receiver fn. receiver -> BoundFunction receiver fn -> fn
Run a BoundFunction by providing a this object.
dot :: forall f a. Metric f => Semiring a => f a -> f a -> a
The inner (dot) product of two vectors.
dot (V2 1.0 2.0) (V2 3.0 4.0) = 11.0 -- 1*3 + 2*4
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb
qd :: forall f a. Metric f => Ring a => f a -> f a -> a
The squared distance between two vectors.
qd (V2 0.0 0.0) (V2 3.0 4.0) = 25.0
scaled :: forall scale domain range. Scale (scale domain range) => domain -> scale domain range -> range
t :: forall b a. a -> (a -> b) -> b
Reverse application which is
probably exist inside Lens module
t :: forall b a. a -> (a -> b) -> b
thrush :: forall b a. a -> (a -> b) -> b
T combinator - thrush
CI
Λ a b . a → (a → b) → b
λ x f . f x
verifyFilter :: forall a h f. Eq (f a) => Monoid (f a) => BooleanEq h => Filterable f => (a -> h) -> f a -> Boolean
all :: forall a. (a -> Boolean) -> Array a -> Boolean
Returns true if all the array elements satisfy the given predicate. iterating the array only as necessary and stopping as soon as the predicate yields false.
all (_ > 0) [] = True
all (_ > 0) [1, 2, 3] = True
all (_ > 0) [-1, -2, -3] = False
all :: forall a. (a -> Boolean) -> NonEmptyArray a -> Boolean
any :: forall a. (a -> Boolean) -> Array a -> Boolean
Returns true if at least one array element satisfies the given predicate, iterating the array only as necessary and stopping as soon as the predicate yields true.
any (_ > 0) [] = False
any (_ > 0) [-1, 0, 1] = True
any (_ > 0) [-1, -2, -3] = False
any :: forall a. (a -> Boolean) -> NonEmptyArray a -> Boolean
get :: forall r r' l a. IsSymbol l => Cons l a r' r => Proxy l -> Record r -> a
Get a property for a label which is specified using a value-level proxy for a type-level string.
For example:
get (Proxy :: Proxy "x") :: forall r a. { x :: a | r } -> a
match :: forall rl r r1 r2 b. RowToList r rl => VariantMatchCases rl r1 b => Union r1 () r2 => Record r -> Variant r2 -> b
Combinator for exhaustive pattern matching using an onMatch case record.
matchFn :: Variant (foo :: Int, bar :: String, baz :: Boolean) -> String
matchFn = match
{ foo: \foo -> "Foo: " <> show foo
, bar: \bar -> "Bar: " <> bar
, baz: \baz -> "Baz: " <> show baz
}
traceTime :: forall a. DebugWarning => String -> (Unit -> a) -> a
Measures the time it takes the given function to run and prints it out,
then returns the function's result. This is handy for diagnosing
performance problems by wrapping suspected parts of the code in
traceTime.
For example:
bunchOfThings =
[ traceTime "one" \_ -> one x y
, traceTime "two" \_ -> two z
, traceTime "three" \_ -> three a b c
]
Console output would look something like this:
one took 3.456ms
two took 562.0023ms
three took 42.0111ms
Note that the timing precision may differ depending on whether the Performance API is supported. Where supported (on most modern browsers and versions of Node), the Performance API offers timing resolution of 5 microseconds. Where Performance API is not supported, this function will fall back on standard JavaScript Date object, which only offers a 1-millisecond resolution.
reifyBool :: forall r. Boolean -> (forall b. Bool b => b -> r) -> r
Convert a value level boolean into a type level boolean through a callback function.
reifyInt :: forall r. Int -> (forall n. Nat n => n -> r) -> r
reifyIntP :: forall r. Int -> (forall n. Pos n => n -> r) -> r
canFind :: forall a. (a -> Boolean) -> Array a -> Boolean
get :: forall r2 r1 a l. IsSymbol l => Cons l a r1 r2 => SProxy l -> Record r2 -> a
getErrorOption :: forall sym a tail rows. IsSymbol sym => Cons sym a tail rows => Lacks "name" rows => Lacks "message" rows => Proxy sym -> CustomError rows -> a
canFind :: forall a. (a -> Boolean) -> Vector a -> Boolean
get :: forall a l r' r. IsSymbol l => Cons l a r' r => SProxy l -> Record r -> a
isInstanceOf :: forall state props. ReactThis props state -> ReactClass props -> Boolean
fromRecordFields :: forall args fields rowList. RecordFieldsIso args fields rowList => RLProxy rowList -> Record fields -> args
genericFromRecord :: forall tok a r. GenericRecordLike tok a r => Proxy tok -> Record r -> a
genericFromVariant :: forall tok a r. GenericVariantLike tok a r => Proxy tok -> Variant r -> a
repFromVariant :: forall tok rep r. RepVariantLike tok rep r => Proxy tok -> Variant r -> rep
every :: forall a. (a -> Boolean) -> Array a -> Boolean
get :: forall sym rts a. Get sym rts a => Proxy sym -> TsRecord rts -> a
isValidPath :: forall v k. Ord k => Graph k v -> NonEmptyList k -> Boolean
onlyImpl :: forall rl row a. OnlyVariant rl row a => Proxy rl -> Variant row -> a
some :: forall a. (a -> Boolean) -> Array a -> Boolean
No further results.