Search results

liftEffect :: forall m a. MonadEffect m => Effect a -> m a
pull :: forall a m. MonadEffect m => Effect a -> m a
read :: forall g a. RWLockGuard g => g a -> Aff a
toAffE :: forall a. Effect (Promise a) -> Aff a

Utility to convert an Effect returning a Promise into an Aff (i.e. the inverse of fromAff)

toAffE :: forall a. Effect (Promise a) -> Aff a

Utility to convert an Effect returning a Promise into an Aff (i.e. the inverse of fromAff)

useCleaner :: forall m. MonadHooks m => Effect Unit -> m Unit

Add a cleaner

onCleanup :: forall m. MonadCleanup m => Effect Unit -> m Unit

Add a cleanup action.

release :: forall g a. RWLockGuard g => g a -> Aff Unit
useCleaner :: forall m. MonadHooks m => Effect Unit -> m Unit

Add a cleaner

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.

unsafePerformEffect :: forall a. Effect a -> a

Run an effectful computation.

Note: use of this function can result in arbitrary side-effects.

inj :: forall f g a. Inject f g => f a -> g a
join :: forall f m a. MonadFork f m => f a -> m a
uninterruptible :: forall e f m a. MonadBracket e f m => m a -> m a
spyM :: forall m a. Warn (Text "Debug function usage") => Monad m => m a -> m a
liftBase :: forall b m a. MonadBase b m => b a -> m a
folded :: forall event a. IsEvent event => Monoid a => event a -> event a

Combine subsequent events using a Monoid.

folded :: forall a event. IsEvent event => Monoid a => event a -> event a

Combine subsequent events using a Monoid.

localEffect :: forall a. Effect a -> a
sort :: forall f a. Functor f => Foldable f => Unfoldable f => Ord a => f a -> f a

Sort any structure (which has Foldable, Unfoldable, and Functor instances) by converting to an OrdSeq and back again. I am fairly sure this is usually O(n*log(n)), although of course this depends on the Unfoldable and Foldable instances.

restoreAfter :: forall m a. MonadCanvasAction m => m a -> m a

Runs save, then the provided action, then restore

allOffM :: forall m t. Bind m => MonadEffect m => EventTargetOp t => m t -> m t

Removes all event handler functions from an event target. The target is returned.

changeM :: forall m t. Bind m => EventTargetOp t => MonadEffect m => m t -> m t

Triggers the change event handlers tied to the event target. The target is returned.

collapseM :: forall m n. MonadEffect m => HTMLElementOp n => m n -> m n
concealM :: forall m n. MonadEffect m => HTMLElementOp n => m n -> m n
detachM :: forall c m. MonadEffect m => NodeOp c => m c -> m c

Detatches a node from its parent node and returns the detached node. Descendant nodes and event listeners are not affected. The detatched node is returned.

disableM :: forall m el. HTMLAbleOp el => MonadEffect m => m el -> m el
emptyM :: forall m p. MonadEffect m => NodeOp p => m p -> m p

Calls remove on the all of the node's children. The emptied node is returned.

enableM :: forall m el. HTMLAbleOp el => MonadEffect m => m el -> m el
hideM :: forall m n. MonadEffect m => HTMLElementOp n => m n -> m n
lookAhead :: forall m a. LookAheadParsing m => m a -> m a
negated :: forall f a. Functor f => Ring a => f a -> f a

Negate a vector

negated (V2 1.0 (-2.0)) = V2 (-1.0) 2.0
once :: forall a m. MonadLogic m => m a -> m a
removeM :: forall c m. MonadEffect m => NodeOp c => m c -> m c

Calls detach on the node and its descendants, and in addition removes all event listeners from the detached node and descendants. The event listners are removed provided that they were added using Web.Event.Class.EventTargetOp.on or derivation thereof such as Web.Event.Class.EventTargetOp.change or Web.Event.Class.EventTargetOp.ready. The removed node is returned.

revealM :: forall m n. MonadEffect m => HTMLElementOp n => m n -> m n
showM :: forall m n. MonadEffect m => HTMLElementOp n => m n -> m n
try :: forall m a. Parsing m => m a -> m a
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!"
proof :: forall a b p. TypeEquals a b => p a -> p b
coerce :: forall f a b. Contravariant f => Functor f => f a -> f b
cleared :: forall f a b. Filterable f => f a -> f b

Filter out all values.

quickCheck :: forall p. Testable p => p -> Aff Unit

Runs a Testable with a random seed and 100 inputs.

length :: forall sproxy proxy a b. Length a b => sproxy a -> proxy b
parseInt :: forall sproxy proxy sym a. ParseInt sym a => sproxy sym -> proxy a

parse Int a Value-Level

parseInt (Proxy  :: _ "-1337") ~> N1337
parseInt (SProxy :: _ "-1337") ~> N1337
    -- N1137 would be type alias for Neg (Succ^1337 Z)
parseNat :: forall sproxy proxy sym a. ParseNat sym a => sproxy sym -> proxy a

value-level parse of number

parseNat (Proxy  "10") ~> D10
parseNat (SProxy "10") ~> D10
init :: forall xs ys lproxy. Init xs ys => lproxy xs -> lproxy ys
length :: forall xs r lproxy iproxy. Length xs r => lproxy xs -> iproxy r
awaitFinished :: forall s a. Write s a => s -> Aff Unit
awaitReadableOrClosed :: forall s a. Read s a => s -> Aff Unit
awaitWritableOrClosed :: forall s a. Write s a => s -> Aff Unit
abort :: forall tx. IDBTransaction tx => tx -> Aff Unit

Aborts the transaction. All pending requests will fail with a "AbortError" DOMException and all changes made to the database will be reverted.

cancel :: forall a. Parent a => a -> Aff Unit
clear :: forall store. IDBObjectStore store => store -> Aff Unit

Deletes all records in store.

close :: forall db. IDBDatabase db => db -> Aff Unit

Closes the connection once all running transactions have finished.

closePort :: forall a. LateNode a => a -> Aff Unit
delay :: forall d. Duration d => d -> Aff Unit
delete :: forall cursor. IDBCursor cursor => cursor -> Aff Unit

Delete the record pointed at by the cursor with a new value.

drain :: forall a s n n1. ToString n1 s => IsSymbol s => Analytic (a n) => Analytic (a n1) => Add n1 1 n => a n -> a n1

Decrement the dimension of a point/vector by removing its last coordinate.

forever :: forall b a m. Monad m => m a -> m b
immerse :: forall a n n1. Analytic (a n) => Analytic (a n1) => Add n 1 n1 => a n -> a n1

Increments the dimension of a point/vector by adding a zero coordinate after the other coordinates.

key :: forall cursor. IDBConcreteCursor cursor => cursor -> Aff Key

Returns the key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.

primaryKey :: forall cursor. IDBConcreteCursor cursor => cursor -> Aff Key

Returns the effective key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.

valM :: forall m el v. MonadEffect m => HTMLValueContainerOp el v => m el -> m v
void :: forall f a. Functor f => f a -> f Unit

The void function is used to ignore the type wrapped by a Functor, replacing it with Unit and keeping only the type information provided by the type constructor itself.

void is often useful when using do notation to change the return type of a monadic computation:

main = forE 1 10 \n -> void do
  print n
  print (n * n)
expectError :: forall m t. MonadError Error m => m t -> m Unit
notM :: forall m. Functor m => m Boolean -> m Boolean
count :: forall event a. IsEvent event => event a -> event Int

Count the number of events received.

absA :: forall repr. DataDSL repr => repr Number -> repr Number

Absolute value

Spreadsheet equivalent: =ABS(x)

acos :: forall repr. TrigExpr repr => repr Number -> repr Number
acos :: forall repr. TrigExpr repr => repr Number -> repr Number
acos :: forall repr. TrigDSL repr => repr Number -> repr Number
asin :: forall repr. TrigExpr repr => repr Number -> repr Number
asin :: forall repr. TrigExpr repr => repr Number -> repr Number
asin :: forall repr. TrigDSL repr => repr Number -> repr Number
atan :: forall repr. TrigExpr repr => repr Number -> repr Number
atan :: forall repr. TrigExpr repr => repr Number -> repr Number
atan :: forall repr. TrigDSL repr => repr Number -> repr Number
closePath :: forall repr. PathExpr repr => repr String -> repr String

Append "Z" to close a path

cos :: forall repr. TrigExpr repr => repr Number -> repr Number
cos :: forall repr. TrigExpr repr => repr Number -> repr Number
cos :: forall repr. TrigDSL repr => repr Number -> repr Number
neg :: forall repr. NumExpr repr => repr Number -> repr Number
neg :: forall repr. DataDSL repr => repr Number -> repr Number
negate :: forall repr. NumExpr repr => repr Number -> repr Number
negate :: forall repr. DataDSL repr => repr Number -> repr Number
negated :: forall repr. NumExpr repr => repr Number -> repr Number

Negate an expression

not :: forall repr. BoolExpr repr => repr Boolean -> repr Boolean
not :: forall repr. DataDSL repr => repr Boolean -> repr Boolean
not_ :: forall repr. BoolExpr repr => repr Boolean -> repr Boolean

Boolean NOT

sin :: forall repr. TrigExpr repr => repr Number -> repr Number
sin :: forall repr. TrigExpr repr => repr Number -> repr Number
sin :: forall repr. TrigDSL repr => repr Number -> repr Number
tan :: forall repr. TrigExpr repr => repr Number -> repr Number
tan :: forall repr. TrigExpr repr => repr Number -> repr Number
tan :: forall repr. TrigDSL repr => repr Number -> repr Number
count :: forall a event. IsEvent event => event a -> event Int

Count the number of events received.

generateTestTree :: forall m a. TestTreeGenerator m => m (Aff a) -> Aff a

Evaluates the test tree generator monad, returning the generated test tree. See comments on the TestTreeGenerator class for more information.

genArrayOf :: forall m. MonadGen m => MonadRec m => m JSON -> m JSON

A generator for JSON vaues that are arrays containing items based on the passed generator.

don't :: forall a m. Applicative m => m a -> m Unit
isEnabledM :: forall m el. MonadEffect m => HTMLAbleOp el => m el -> m Boolean

Is this input enabled?

lnot :: forall a m. MonadLogic m => m a -> m Unit
minLen :: forall m e. MonadEffect m => ElementOp e => m e -> m Int

Get the min length setting.

ndM :: forall n m. Functor m => NodeOp n => m n -> m Node

Put an instance of a NodeOp in a continuation.

normalize :: forall f. Metric f => Epsilon Number => f Number -> f Number

Normalize a vector to unit length.

Unlike signorm, this function handles the zero vector by returning zero rather than NaN.

normalize (V2 3.0 4.0) = V2 0.6 0.8
normalize (V2 0.0 0.0) = V2 0.0 0.0
notFollowedBy :: forall m a. Parsing m => m a -> m Unit
optional :: forall a m. Alternative m => m a -> m Unit
signorm :: forall f. Metric f => f Number -> f Number

Convert a non-zero vector to a unit vector (signorm = "sign of norm").

Returns the zero vector when given the zero vector.

signorm (V2 3.0 4.0) = V2 0.6 0.8
signorm (V2 0.0 0.0) = V2 0.0 0.0
void :: forall b a. HasMap a => a b -> a Unit

Replaces all values in the input container with unit. This is mostly useful for ignoring the value from an effect.

void [1, 2] -- [unit, unit]
genString :: forall m. MonadRec m => MonadGen m => m Char -> m String

Generates a string using the specified character generator.

class_ :: forall repr. AttrExpr repr => repr String -> repr Attr
cx :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
cy :: forall repr. AttrExpr repr => repr Pixels -> repr Attr

d

d :: forall repr. AttrExpr repr => repr String -> repr Attr
dominantBaseline :: forall repr. AttrExpr repr => repr String -> repr Attr
dx :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
dy :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
fill :: forall repr. AttrExpr repr => repr String -> repr Attr
fillOpacity :: forall repr. AttrExpr repr => repr Number -> repr Attr
fontFamily :: forall repr. AttrExpr repr => repr String -> repr Attr
fontSize :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
height :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
id_ :: forall repr. AttrExpr repr => repr String -> repr Attr
opacity :: forall repr. AttrExpr repr => repr Number -> repr Attr

r

r :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
rx :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
ry :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
stroke :: forall repr. AttrExpr repr => repr String -> repr Attr
strokeOpacity :: forall repr. AttrExpr repr => repr Number -> repr Attr
strokeWidth :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
textAnchor :: forall repr. AttrExpr repr => repr String -> repr Attr
transform :: forall repr. AttrExpr repr => repr String -> repr Attr
width :: forall repr. AttrExpr repr => repr Pixels -> repr Attr

x

x :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
x1 :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
x2 :: forall repr. AttrExpr repr => repr Pixels -> repr Attr

y

y :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
y1 :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
y2 :: forall repr. AttrExpr repr => repr Pixels -> repr Attr
genJArrayOf :: forall m. MonadGen m => MonadRec m => m JSON -> m JArray

A generator for JSON arrays containing items based on the passed generator.

passwordField :: forall m f. MonadEffect m => Foldable f => f (String /\ String) -> m HTMLInputElement

Create a password text field.

waitUntil :: forall m. Testable m => m Boolean -> m Unit

Performs active wait while the given condition is false. Times out with a crash after a second.

waitWhile :: forall m. Testable m => m Boolean -> m Unit

Performs active wait while the given condition is true. Times out with a crash after a second.

whileS :: forall @f. Lazy (f Unit) => Select f => f Boolean -> f Unit

Repeat an action until it returns true

pure :: forall f a. Applicative f => a -> f a
extract :: forall w a. Comonad w => w a -> a
and :: forall a f. Foldable f => HeytingAlgebra a => f a -> a

The conjunction of all the values in a data structure. When specialized to Boolean, this function will test whether all of the values in a data structure are true.

fold :: forall f m. Foldable f => Monoid m => f m -> m

Fold a data structure, accumulating values in some Monoid.

fold1 :: forall t m. Foldable1 t => Semigroup m => t m -> m

Fold a data structure, accumulating values in some Semigroup.

length :: forall a b f. Foldable f => Semiring b => f a -> b

Returns the size/length of a finite structure. Optimized for structures that are similar to cons-lists, because there is no general way to do better.

maximum :: forall f a. Ord a => Foldable1 f => f a -> a
minimum :: forall f a. Ord a => Foldable1 f => f a -> a
or :: forall a f. Foldable f => HeytingAlgebra a => f a -> a

The disjunction of all the values in a data structure. When specialized to Boolean, this function will test whether any of the values in a data structure is true.

product :: forall a f. Foldable f => Semiring a => f a -> a

Find the product of the numeric values in a data structure.

sum :: forall a f. Foldable f => Semiring a => f a -> a

Find the sum of the numeric values in a data structure.

singleton :: forall f a. Unfoldable1 f => a -> f a

Contain a single value. For example:

singleton "foo" == (NEL.singleton "foo" :: NEL.NonEmptyList String)
downFrom :: forall a u. Enum a => Unfoldable u => a -> u a

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

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.

upFrom :: forall a u. Enum a => Unfoldable u => a -> u a

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

upFromIncluding :: forall a u. Enum a => Unfoldable1 u => a -> u a

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

upFromIncluding bottom will return all values in an Enum.

ask :: forall e w a. ComonadAsk e w => w a -> e
pos :: forall s w a. ComonadStore s w => w a -> s
throwError :: forall e m a. MonadThrow e m => e -> m a
aread :: forall s r m. Refer s r => MonadEffect m => r -> m s
fread :: forall m r s. MonadEffect m => Refer s r => r -> m s
getSingleton :: forall f a. SingletonFunctor f => f a -> a
colambek :: forall t f. Recursive t f => Corecursive t f => f t -> t
embed :: forall t f. Corecursive t f => f t -> t
lambek :: forall t f. Recursive t f => Corecursive t f => t -> f t
project :: forall t f. Recursive t f => t -> f t
sequenceProduct :: forall specI specO f. SequenceProduct specI specO f => specI -> f specO
pure :: forall v f c. HasPure c f => ObjectOf c v => v -> f v
bottom1_ :: forall f a. Bottom1_ f => a -> f a
bottom2 :: forall f a b. Bottom2 f a => a -> f b
from1 :: forall f rep a. Generic1 f rep => f a -> rep
top1_ :: forall f a. Top1_ f => a -> f a
act :: forall m b a. Mother m => a -> m b
allOff :: forall m t. Bind m => MonadEffect m => EventTargetOp t => t -> m t

Removes all event handler functions from an event target. The target is returned.

array :: forall f t. Corecursive t (SqlF EJsonF) => Foldable f => f t -> t
askFor :: forall a p. Ask a => p a -> a

Equivalent to ask except for accepting a Proxy for specifying the exact requested type

change :: forall t m. EventTargetOp t => MonadEffect m => t -> m t

Triggers the change event handlers tied to the event target. The target is returned.

collapse :: forall m n. MonadEffect m => HTMLElementOp n => n -> m n
conceal :: forall m n. MonadEffect m => HTMLElementOp n => n -> m n
constructRecord :: forall ty fn proxy. ConstructRecord ty fn => proxy ty -> fn
detach :: forall c m. MonadEffect m => NodeOp c => c -> m c

Detatches a node from its parent node and returns the detached node. Descendant nodes and event listeners are not affected. The detatched node is returned.

disable :: forall el m. HTMLAbleOp el => MonadEffect m => el -> m el
dsingleton :: forall cnt a. Diff cnt => a -> cnt a
empty :: forall m p. MonadEffect m => NodeOp p => p -> m p

Calls remove on the all of the node's children. The emptied node is returned.

enable :: forall el m. HTMLAbleOp el => MonadEffect m => el -> m el
hide :: forall m n. MonadEffect m => HTMLElementOp n => n -> m n
maximum :: forall a f. Ord a => Foldable1 f => f a -> a
minimum :: forall a f. Ord a => Foldable1 f => f a -> a
mockFun :: forall params fun verifyParams m. MockBuilder params fun verifyParams => MonadEffect m => params -> m fun
mockFunction :: forall params fun verifyParams m. MockBuilder params fun verifyParams => MonadEffect m => params -> m fun
product :: forall b a. HasMultiply b => HasOne b => HasReduce a => a b -> b

Multiplies all of the elements of a container together.

product [2, 3] -- 6
product [] -- 1
pure :: forall d a. Syntax d => Eq a => a -> d a
pure :: forall f a. Unital Function Unit Unit f => Functor f => a -> f a
pure :: forall a b. HasPure a => b -> a b
pure :: forall f a. Applicative f => a -> f a
quadrance :: forall f a. Metric f => Semiring a => f a -> a

The squared norm of a vector (quadrance from rational trigonometry).

This is more efficient than norm when you only need to compare magnitudes.

quadrance (V2 3.0 4.0) = 25.0  -- 3² + 4²
query :: forall m q r. MonadSession m => AsQuery q => FromRows r => q -> m r

Executes a query and unmarshals the result into r