Search results
withJust :: forall a b m. Applicative m => Maybe a -> (a -> m b) -> m Unit
assure :: forall a e g f. ErrorControl f g e => Monad f => g a -> (a -> Maybe e) -> f a
bind :: forall m a b. Bind m => m a -> (a -> m b) -> m b
discard :: forall a f b. Discard a => Bind f => f a -> (a -> f b) -> f b
bind' :: forall v1 v0 m c. HasBind c m => ObjectOf c v0 => ObjectOf c (m v1) => Restrictable Function c => m v0 -> (v0 -> (m v1)) -> m v1
bind :: forall c b a. HasChain a => a b -> (b -> a c) -> a c
A version of chain with the arguments flipped. This is provided only to
support desugaring do notation. It is not recommended to use explicitly.
fairConjunction :: forall b a m. MonadLogic m => m a -> (a -> m b) -> m b
hummingbird :: forall m b a. Bind m => m a -> (a -> m b) -> m b
H combinator - hummingbird
BW(BC)
Λ a b c (a → b → a → c) → a → b → c
λ f x y . f x y x
when :: forall b a m. MonadLogic m => m a -> (a -> m b) -> m b
for1_ :: forall t f a b. Foldable1 t => Apply f => t a -> (a -> f b) -> f Unit
A version of traverse1_ with its arguments flipped.
This can be useful when running an action written using do notation for every element in a data structure:
for_ :: forall a b f m. Applicative m => Foldable f => f a -> (a -> m b) -> m Unit
A version of traverse_ with its arguments flipped.
This can be useful when running an action written using do notation for every element in a data structure:
For example:
for_ [1, 2, 3] \n -> do
print n
trace "squared is"
print (n * n)
for_ :: forall f m a. Foldable f => MonadRec m => f a -> (a -> m Unit) -> m Unit
Safely traverse a foldable container.
discard :: forall a f. Apply f => f Unit -> (Unit -> f a) -> f a
forM_ :: forall f m a. MonadRec m => Foldable f => f a -> (a -> m Unit) -> m Unit
catchError :: forall e m a. MonadError e m => m a -> (e -> m a) -> m a
controlError :: forall f g e a. ErrorControl f g e => f a -> (e -> g a) -> g a
alt :: forall f a. Alt f => f a -> (Unit -> f a) -> f a
discard :: forall f a. Alt f => f a -> (Unit -> f a) -> f a
discard :: forall f m a. Parallel f m => Alt f => m a -> (Unit -> m a) -> m a
when :: forall a m. Monad m => m Boolean -> (Unit -> m a) -> m Unit
Run a given computation when a monadic boolean is true.
mapFlipped :: forall f a b. Functor f => f a -> (a -> b) -> f b
mapFlipped is map with its arguments reversed. For example:
[1, 2, 3] <#> \n -> n * n
flippedMap :: forall f a b. Functor f => f a -> (a -> b) -> f b
delay :: forall m a b. Delay m => a -> (a -> m b) -> m b
for :: forall a b m t. Applicative m => Traversable t => t a -> (a -> m b) -> m (t b)
A version of traverse with its arguments flipped.
This can be useful when running an action written using do notation for every element in a data structure:
For example:
for [1, 2, 3] \n -> do
print n
return (n * n)
bindMaybe :: forall m a b. Bind m => Compactable m => m a -> (a -> m (Maybe b)) -> m b
forkAction :: forall m a b. MonadEffect m => MonadAff m => Plus m => m a -> (m a -> m b) -> m b
A common pattern - running a long running action and keeping the GUI responsive Because the action can't be restarted on every gui event, we must fork it off in the beginning
fromMaybeS :: forall a f. Selective f => f a -> f (Maybe a) -> f a
fromMaybeS :: forall @f @a. Select f => f a -> f (Maybe a) -> f a
If the second action is Nothing, run and return the first
shouldNotSatisfyM :: forall m a. MonadThrow Error m => Show a => a -> (a -> m Boolean) -> m Unit
shouldSatisfyM :: forall m a. MonadThrow Error m => Show a => a -> (a -> m Boolean) -> m Unit
cmapFlipped :: forall a b f. Contravariant f => f a -> (b -> a) -> f b
cmapFlipped is cmap with its arguments reversed.
whileJust_ :: forall m b a. Monad m => m (Maybe a) -> (a -> m b) -> m Unit
As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are discarded.
whileJust_ :: forall m b a. MonadRec m => m (Maybe a) -> (a -> m b) -> m Unit
As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are discarded.
intercept :: forall a e g f. ErrorControl f g e => f a -> (e -> a) -> g a
bind :: forall f a. Alt f => f a -> (f a -> f a) -> f a
bind :: forall f m a. Parallel f m => Alt f => m a -> (m a -> m a) -> m a
freads :: forall m r s a. MonadEffect m => Refer s r => r -> (s -> a) -> m a
fmodify_ :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m Unit
pCompare1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Ordering
pGreaterThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pGreaterThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pLessThan1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
pLessThanOrEq1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe Boolean
extendFlipped :: forall b a w. Extend w => w a -> (w a -> b) -> w b
A version of extend with its arguments flipped.
fmodify :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m s
whileJust :: forall m b a. Monad m => m (Maybe a) -> (a -> m b) -> m (Array b)
As long as the supplied Maybe expression returns Just, the loop body will be called and passed the value contained in the 'Just'. Results are collected into an array.
whileJust :: forall m b a. MonadRec m => m (Maybe a) -> (a -> m b) -> m (Array b)
As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are collected into an array.
whileJust' :: forall b f a m. Monad m => Applicative f => Monoid (f b) => m (Maybe a) -> (a -> m b) -> m (f b)
As long as the supplied Maybe expression returns Just, the loop
body will be called and passed the value contained in the Just.
Results are collected into an arbitrary Applicative monoidal structure.
whileJust' :: forall m f b a. MonadRec m => Applicative f => Monoid (f b) => m (Maybe a) -> (a -> m b) -> m (f b)
As long as the supplied "Maybe" expression returns "Just _", the loop body will be called and passed the value contained in the 'Just'. Results are collected into an arbitrary MonadPlus container.
div :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLDivElement
span :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLSpanElement
table :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableElement
td :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableCellElement
th :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableCellElement
tr :: forall m f1 f2. MonadEffect m => Foldable f1 => Foldable f2 => f1 (String /\ String) -> f2 (m Node) -> m HTMLTableRowElement
appendsNodesM :: forall m p f. NodeOp p => Foldable f => MonadEffect m => m p -> f (m Node) -> m p
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.
applySecond :: forall a b f. Apply f => f a -> f b -> f b
Combine two effectful actions, keeping only the result of the second.
voidLeft :: forall f a b. Functor f => f a -> b -> f b
A version of voidRight with its arguments flipped.
mulNat :: forall proxy a b c. ProductNat a b c => proxy a -> proxy b -> proxy c
plus :: forall proxy a b c. SumInt a b c => proxy a -> proxy b -> proxy c
plusNat :: forall proxy a b c. SumNat a b c => proxy a -> proxy b -> proxy c
powNat :: forall proxy a b c. ExponentiationNat a b c => proxy a -> proxy b -> proxy c
> powNat d2 d3
8 -- : NProxy D8
a raised to the power of b a^b = c
prod :: forall proxy a b c. ProductInt a b c => proxy a -> proxy b -> proxy c
sampleOnLeft_ :: forall event a b. IsEvent event => event a -> event b -> event b
fromMaybe' :: forall a. Maybe a -> a -> a
An infix form of fromMaybe with arguments flipped.
divides :: forall a. Divisible a => a -> a -> Maybe a
concat :: forall xs ys zs lproxy. Concat xs ys zs => lproxy xs -> lproxy ys -> lproxy zs
downcast :: forall ctor from to. ctor -> from -> Maybe to
Attempt to cast to a type given a constructor for it
drop :: forall n xs ys lproxy iproxy. Drop n xs ys => iproxy n -> lproxy xs -> lproxy ys
map :: forall f xs ys fproxy kproxy lproxy. Map f xs ys => fproxy f -> kproxy xs -> lproxy ys
take :: forall n xs ys lproxy iproxy. Take n xs ys => iproxy n -> lproxy xs -> lproxy ys
zip :: forall x y z lproxy. Zip x y z => lproxy x -> lproxy y -> lproxy z
applySecond :: forall v1 v0 f c. HasApply c f => HasConst c => HasIdentity c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v1) => ObjectOf c (c v0 (c v1 v1)) => ObjectOf c (c (c v1 v1) (c v0 (c v1 v1))) => f v0 -> f v1 -> f v1
downcast :: forall ctor from to. ctor -> from -> Maybe to
Attempt to cast to a type given a constructor for it
lookup :: forall c k r. Lookup c k r => c -> k -> Maybe r
Given some type and a key on that type, extract some value that corresponds to that key.
lookup :: forall c k r. Lookup c k r => c -> k -> Maybe r
Given some type and a key on that type, extract some value that corresponds to that key.
getOrAlt :: forall v s r' r l h g f. Alternative h => Cons s v r' r => RowToList r l => RGetOrAlt f g s l r => g s -> f r -> h v
max :: forall a. PartialOrd a => a -> a -> Maybe a
min :: forall a. PartialOrd a => a -> a -> Maybe a
pMax :: forall a. PartialOrd a => a -> a -> Maybe a
pMin :: forall a. PartialOrd a => a -> a -> Maybe a
rsingleton :: forall f g s v r. RSingleton f g s => Cons s v () r => Lacks s () => g s -> v -> f r
singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
_call :: forall b a. a -> (a -> b) -> b
after :: forall k f. Eq k => Foldable f => k -> f k -> Maybe k
always_ :: forall a i. i -> a -> Maybe i
before :: forall k f. Eq k => Foldable f => k -> f k -> Maybe k
bind :: forall a. Semigroup a => a -> (a -> a) -> a
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
functorDecorateFlipped :: forall b a f. Functor f => Decorate b a => f a -> b -> f b
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb
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
shouldContain :: forall m f a. MonadThrow Error m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldNotContain :: forall m f a. MonadThrow Error m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldNotReturn :: forall m t. MonadThrow Error m => Eq t => Show t => m t -> t -> m Unit
Asserts that m t does not return t
shouldReturn :: forall m t. MonadThrow Error m => Eq t => Show t => m t -> t -> m Unit
Asserts that m t returns t
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 ...
gate :: forall a event. IsEvent event => event Boolean -> event a -> event a
Sample the events that are fired while a boolean event is true. Note that,
until the boolean event fires, it will be assumed to be false, and events
will be blocked.
gate :: forall event a. IsEvent event => event Boolean -> event a -> event a
Sample the events that are fired while a boolean event is true. Note that,
until the boolean event fires, it will be assumed to be false, and events
will be blocked.
local :: forall m r a. Alt m => MonadRec m => MonadEffect m => MonadAff m => Plus m => a -> (Wire m a -> m r) -> m r
Setup a local environment with a wire
compare :: forall a. PartialOrd a => a -> a -> Maybe Ordering
pCompare :: forall a. PartialOrd a => a -> a -> Maybe Ordering
pGreaterThan :: forall a. PartialOrd a => a -> a -> Maybe Boolean
pGreaterThanOrEq :: forall a. PartialOrd a => a -> a -> Maybe Boolean
pLessThan :: forall a. PartialOrd a => a -> a -> Maybe Boolean
pLessThanOrEq :: forall a. PartialOrd a => a -> a -> Maybe Boolean
pMax1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe (f a)
pMin1 :: forall f a. PartialOrd1 f => f a -> f a -> Maybe (f a)
addClasses :: forall m n f. MonadEffect m => ElementOp n => Foldable f => f String -> n -> m n
addClassesM :: forall m n f. MonadEffect m => ElementOp n => Foldable f => f String -> m n -> m n
applySecond :: forall a d. Syntax d => d Unit -> d a -> d a
This variant of <*> ignores its left result. In contrast to its
counterpart derived from the Apply class, the ignored parts have type
d Unit rather than d b because otherwise information relevant for
pretty-printing would be lost.
applyTuple :: forall f a b. Apply f => f a -> f b -> f (a /\ b)
buildStub :: forall params fun. StubBuilder params fun => Maybe MockName -> params -> fun
chainM :: forall m a. Testable m => m Element -> m a -> m a
Used in its operator form >>, this function chains two DOM operations
together, taking the output of the first operation and making it context of
the second one. For example:
buttonInsideDiv <- find "div" >> find "button"
inputValue <- find "input" >> attr "value"
discard :: forall a. Semigroup a => a -> (Unit -> a) -> a
findFirstDifference :: forall obj2 obj1. obj1 -> obj2 -> Maybe Change
Take two raw objects, diff them and return the path to the first difference alongside the type of that difference (changed, deleted, created).
longestTail' :: forall a t. Unconsable t => t a -> t a -> Maybe (t a)
Less polymorphic version of longestTail.
maxLen :: forall m e. MonadEffect m => ElementOp e => m e -> m (Maybe Int)
Get the max length setting.
rmCss :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f String -> n -> m n
rmCssM :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f String -> m n -> m n
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
setAttrs :: forall e f m. Foldable f => ElementOp e => MonadEffect m => f (String /\ String) -> e -> m e
Sets the attributes of an element. Existing attributes of the same names are overwritten. New names create new attributes. The element is returned.
setAttrsM :: forall e f m. Foldable f => ElementOp e => MonadEffect m => f (String /\ String) -> m e -> m e
Sets the attributes of an element. Existing attributes of the same names are overwritten. New names create new attributes. The element is returned.
setCss :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f (String /\ String) -> n -> m n
setCssM :: forall m n f. MonadEffect m => HTMLElementOp n => Foldable f => f (String /\ String) -> m n -> m n
shouldContain :: forall m f a. MonadEffect m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldEqualM :: forall m a. MonadThrow Error m => Eq a => Show a => m a -> a -> m Unit
shouldNotContain :: forall m f a. MonadEffect m => Show a => Eq a => Show (f a) => Foldable f => f a -> a -> m Unit
shouldNotEqualM :: forall m a. MonadThrow Error m => Eq a => Show a => m a -> a -> m Unit
whileM_ :: forall m a. Monad m => m Boolean -> m a -> m Unit
Execute an action repeatedly as long as the given boolean expression
returns true. The condition is evaluated before the loop body.
Ignores the results of loop body execution.
whileM_ :: forall m a. MonadRec m => m Boolean -> m a -> m Unit
Execute an action repeatedly as long as the given boolean expression
returns true. The condition is evaluated before the loop body.
Ignores the results of loop body execution.
loopState :: forall m a s. Monad m => s -> (s -> m (Either s a)) -> m a
A very useful combinator for widgets with localised state
appendsNodes :: forall m p f. NodeOp p => Foldable f => MonadEffect m => p -> f (m Node) -> m p
applyFirst :: forall a b f. Apply f => f a -> f b -> f a
Combine two effectful actions, keeping only the result of the first.
alt :: forall f a. Alt f => f a -> f a -> f a
optional :: forall f a. Alt f => Applicative f => f a -> f (Maybe a)
One or none.
optional empty = pure Nothing
The behaviour of optional (pure x) depends on whether the Alt instance
satisfy the left catch law (pure a <|> b = pure a).
Either e does:
optional (Right x) = Right (Just x)
But Array does not:
optional [x] = [Just x, Nothing]
choose :: forall m a. MonadGen m => m a -> m a -> m a
Creates a generator that outputs a value chosen from one of two existing existing generators with even probability.
genMaybe :: forall m a. MonadGen m => m a -> m (Maybe a)
Creates a generator that outputs Maybe values, choosing a value from
another generator for the inner value. The generator has a 75% chance of
returning a Just over a Nothing.
evaluateExample :: forall t arg m. Example t arg m => t -> (ActionWith m arg -> m Unit) -> m Unit
sampleOnRight_ :: forall event a b. IsEvent event => event a -> event b -> event a
Create an Event which samples the latest values from the first event
at the times when the second event fires, ignoring the values produced by
the second event.
optional :: forall f a. Alt f => Applicative f => f a -> f (Maybe a)
addU :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
Add two values with the same unit
addUnitOp :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
subU :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
Subtract two values with the same unit
subUnitOp :: forall repr u. UnitArith repr => repr u -> repr u -> repr u
sampleOn_ :: forall b a event. IsEvent event => event a -> event b -> event a
Create an Event which samples the latest values from the first event
at the times when the second event fires, ignoring the values produced by
the second event.
applyFirst :: forall v1 v0 f c. HasApply c f => HasConst c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v0) => f v0 -> f v1 -> f v0
mmapFlipped :: forall a b f g. Functor f => Functor g => f (g a) -> (a -> b) -> f (g b)
flipScalarMul :: forall k f. VectorField f k => f k -> k -> f k
max1 :: forall f a. Ord1 f => f a -> f a -> f a
min1 :: forall f a. Ord1 f => f a -> f a -> f a
onIntegrityError :: forall m a. MonadError PGError m => m a -> m a -> m a
add :: forall f a. Additive f => Semiring a => f a -> f a -> f a
Vector addition
alt :: forall f a. Alternative f => f a -> f a -> f a
attempt :: forall m a. MonadNope m => m a -> m (Maybe a)
Return Just if the given action succeeds, Nothing if it nopes.
dappend :: forall cnt a. Diff cnt => cnt a -> cnt a -> cnt a
diff :: forall p d a. Affine p d => Ring a => p a -> p a -> d a
The vector from the first point to the second.
fromFoldableL :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldl.
fromFoldableL [] [1,2,3,4] == [4,3,2,1]
fromFoldableL [0] [1,2,3,4] == [4,3,2,1,0]
fromFoldableR :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldr.
fromFoldableR [] [1,2,3,4] == [1,2,3,4]
fromFoldableR [5] [1,2,3,4] == [1,2,3,4,5]
interleave :: forall m a. MonadLogic m => m a -> m a -> m a
moveBy :: forall p d a. Affine p d => Semiring a => p a -> d a -> p a
Add a vector to a point.
moveByNeg :: forall p d a. Affine p d => Ring a => p a -> d a -> p a
Subtract a vector from a point.
optionMaybe :: forall a m. Alternative m => m a -> m (Maybe a)
scalarDiv :: forall f a. Functor f => EuclideanRing a => f a -> a -> f a
Right scalar division
V2 6.0 9.0 ^/ 3.0 = V2 2.0 3.0
scalarR :: forall f a. Functor f => Semiring a => f a -> a -> f a
Right scalar multiplication
V2 1.0 2.0 ^* 3.0 = V2 3.0 6.0
snoc :: forall f a. Container f => f a -> a -> f a
sub :: forall f a. Additive f => Ring a => f a -> f a -> f a
Vector subtraction
yup :: forall m a. MonadNope m => m a -> m a -> m a
orElse :: forall a m. Monad m => m (Maybe a) -> m (Maybe a) -> m (Maybe a)
voidRight :: forall f a b. Functor f => a -> f b -> f a
Ignore the return value of a computation, using the specified return value instead.
fromJust :: forall a. Partial => Maybe a -> a
A partial function that extracts the value from the Just data
constructor. Passing Nothing to fromJust will throw an error at
runtime.
fromMaybe :: forall f a. Unfoldable f => Maybe a -> f a
Convert a Maybe to any Unfoldable, such as lists or arrays.
fromMaybe (Nothing :: Maybe Int) == []
fromMaybe (Just 1) == [1]
enumFromTo :: forall a u. Enum a => Unfoldable1 u => a -> a -> u a
Returns a contiguous sequence of elements from the first value to the second value (inclusive).
enumFromTo 0 3 = [0, 1, 2, 3]
enumFromTo 'c' 'a' = ['c', 'b', 'a']
The example shows Array return values, but the result can be any type
with an Unfoldable1 instance.
seek :: forall s a w. ComonadStore s w => s -> w a -> w a
Reposition the focus at the specified position.
forceMaybe :: forall m a. MonadThrow Error m => Maybe a -> m a
convertOption :: forall field from to sproxy. ConvertOption field from to => sproxy field -> from -> to
filled :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction with the given fillStyle, resetting it to the
previous value after
putCtx :: forall a html ctx. Ctx ctx html => ctx -> html a -> html a
stroked :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction with the given strokeStyle, resetting it to the
previous value after
tellAccum :: forall acc html a. TellAccum acc html => acc -> html a -> html a
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
scalarMul :: forall f k. VectorField f k => k -> f k -> f k
- ∀v in V: one * v == v
- ∀a b in K, v in V: a * (b .* v) = (a * b) .* v
- ∀a b in K, v in V:
- a .* (u + v) = a .* u + a .* v
- (a + b) .* v = a .* v + b .* v
advance :: forall p c m. Position p c m => c -> p -> m p
cons :: forall t a. Consable t => a -> t a -> t a
cons :: forall f a. Container f => a -> f a -> f a
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
fromJust :: forall a. Maybe a -> a
fromJust' :: forall a. Maybe a -> a
The partial and unsafe version of fromJust.
functorDecorate :: forall b a f. Functor f => Decorate a b => a -> f b -> f a
index :: forall f a b. Representable f a => f b -> (a -> b)
insert :: forall f a. Container f => Ord a => a -> f a -> f a
invokeAction :: forall m res args ctrl act. RemoteAction act ctrl args res => MonadReader Visualforce m => MonadAff m => MonadError RemoteActionError m => IsSymbol ctrl => Encode args => Decode res => act -> args -> m res
Function that invoke the action defined by referring to contraints which holds details about the correct controller to invoke. Example:
data PCMRequests = ..
data CreatePCMRequests = CreatePCMRequests
instance remoteActionCreatePCMs :: RemoteAction CreatePCMRequests "PCMMassController.createRecords" PCMRequests Unit
createPCMRequest :: Visualforce -> PCMRequests -> Aff (Either RemoteActionError Unit)
createPCMRequest vf rec = runReaderT (runExceptT $ invokeAction CreatePCMRequests rec) vf
liftMaybe :: forall m a. MonadNuhUh m => Maybe a -> m a
Lift a Maybe value to a MonadNuhUh monad.
option :: forall a m. Alternative m => a -> m a -> m a
peekSource :: forall s d c m. Source s d c m => s -> m (Maybe c)
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
refillSource :: forall s d c m. Source s d c m => d -> s -> m s
replaceInArray :: forall a f. HasUuid a => Functor f => a -> f a -> f a
scalarL :: forall f a. Functor f => Semiring a => a -> f a -> f a
Left scalar multiplication
3.0 *^ V2 1.0 2.0 = V2 3.0 6.0
setVal :: forall el v m. HTMLValueContainerOp el v => MonadEffect m => v -> el -> m el
setValM :: forall m el v. MonadEffect m => HTMLValueContainerOp el v => v -> m el -> m el
splice :: forall f t. Corecursive t (SqlF f) => Maybe t -> t
toDefault :: forall a. Default a => Maybe a -> a
Turns Nothing into a “default” (zero) value.
The Protobuf spec requires that a no presence field set to its “default” (zero) value must not be serialized to the wire.
When receiving messages we can use this function to interpret a missing no presence field as a “default” value.
unsafeMaybeToNullableAttr :: forall a. Maybe a -> a
WARNING: This is for JS interop -- don't use this to unwrap Maybes!
Unsafely nulls out a value so the resulting html attributes are less noisy
Ex: R.input { type: unsafeMaybeToNullableAttr Nothing } avoids rendering
the type attribute while still validating the type of the Maybe's content
matches the type of the DOM field. It's only slightly safer than using
unsafeCreateDOMComponent to avoid DOM type checking entirely.
reifyType :: forall t r. Reifiable t => t -> (forall v. Reflectable v t => Proxy v -> r) -> r
Reify a value of type t such that it can be consumed by a
function constrained by the Reflectable type class. For
example:
twiceFromType :: forall v. Reflectable v Int => Proxy v -> Int
twiceFromType = (_ * 2) <<< reflectType
twiceOfTerm :: Int
twiceOfTerm = reifyType 21 twiceFromType
shouldEqual :: forall m t. MonadThrow Error m => Show t => Eq t => t -> t -> m Unit
shouldNotEqual :: forall m t. MonadThrow Error m => Show t => Eq t => t -> t -> m Unit
kill :: forall e f m a. MonadKill e f m => e -> f a -> m Unit
awrite :: forall s r m. Refer s r => MonadEffect m => s -> r -> m Unit
fwrite :: forall m r s. MonadEffect m => Refer s r => r -> s -> m Unit
headA :: forall repr a. DataDSL repr => repr (Array a) -> repr (Maybe a)
Get first element
compareMany :: forall f a. Eq a => Align f => f a -> f a -> f (DiffLine a)
diffCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
diffStackCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
onlyDifferentCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
appendChild :: forall m p c. MonadEffect m => NodeOp c => NodeOp p => c -> p -> m Unit
appendNodes :: forall m p f. Foldable f => MonadEffect m => NodeOp p => f (m Node) -> p -> m p
Extracts child nodes from a Foldable of continuations and appends them to
a parent node. Returns the given parent node.
appendNodesM :: forall m p f. NodeOp p => Foldable f => MonadEffect m => f (m Node) -> m p -> m p
Extracts child nodes from a Foldable of continuations and appends them to
a monadic parent node. Returns the given parent node.
compareDocumentPositionBits :: forall m n1 n2. MonadEffect m => NodeOp n1 => NodeOp n2 => n1 -> n2 -> m Int
compareMany :: forall f a. Eq a => Align f => f a -> f a -> f (DiffLine a)
Compares two alignable structures element-by-element, producing a structure
of DiffLine results that indicate the relationship between corresponding elements.
Example:
compareMany [1, 2, 3] [1, 2, 4]
-- Returns array showing which elements are equal and which differ
contains :: forall m p c. MonadEffect m => NodeOp c => NodeOp p => c -> p -> m Boolean
diffCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
diffStackCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
duration :: forall nt r. Newtype nt (Variant (duration :: Maybe Number | r)) => Maybe Number -> nt
firstChild :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Node)
hasFunctionBeenCalledWith :: forall fn params input m. ToDirectExpected input params => MatchParams params => MonadEffect m => MonadThrow Error m => fn -> input -> m Unit
interval :: forall a. Ord a => a -> a -> Maybe (Interval a)
Construct an interval. Returns Nothing if start >= end (which would
be empty in half-open semantics).
isEqualNode :: forall m n1 n2. MonadEffect m => NodeOp n1 => NodeOp n2 => n1 -> n2 -> m Boolean
lastChild :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Node)
nextSibling :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Node)
nodeValue :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe String)
onlyDifferentCompare :: forall m t. MonadEffect m => MonadThrow Error m => Diffable t => t -> t -> m Unit
orRun :: forall a m. Monad m => m (Maybe a) -> m a -> m a
ownerDocument :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Document)
parentElement :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Element)
parentNode :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Node)
previousSibling :: forall m n. MonadEffect m => NodeOp n => n -> m (Maybe Node)
reify :: forall r a. a -> (forall s. Reifies s a => Proxy s -> r) -> r
Reify a value of type a at the type level.
The value can be recovered in the body of the lambda by using the reflect function.
removeChild :: forall m p c. MonadEffect m => NodeOp c => NodeOp p => c -> p -> m Unit
sepBy :: forall sep a f. Alternative f => Lazy (f (Array a)) => f a -> f sep -> f (Array a)
sepBy :: forall sep a f. Alternative f => Lazy (f (List a)) => f a -> f sep -> f (List a)
sepBy1 :: forall sep a f. Alternative f => Lazy (f (Array a)) => f a -> f sep -> f (Array a)
sepBy1 :: forall sep a f. Alternative f => Lazy (f (List a)) => f a -> f sep -> f (List a)
sepEndBy :: forall sep a f. Alternative f => Lazy (f (Array a)) => f a -> f sep -> f (Array a)
sepEndBy :: forall sep a f. Alternative f => Lazy (f (List a)) => f a -> f sep -> f (List a)
sepEndBy1 :: forall sep a f. Alternative f => Lazy (f (Array a)) => f a -> f sep -> f (Array a)
No further results.