Search results

initWasm :: String -> Aff Unit

Initialize the WASM module. Call once at application startup.

initWasm :: String -> Aff Unit

Initialize the WASM module. Call once at application startup.

The URL should point to the generated JavaScript module from wasm-pack. Example: initWasm "./pkg/force_kernel.js"

initWasm :: String -> Aff Unit

Initialize the WASM module. Call once at application startup.

The URL should point to the generated JavaScript module from wasm-pack. Example: initWasm "./pkg/force_kernel.js"

initWASM :: String -> Aff Unit

Initialize the WASM physics engine. Call once at application startup before using Engine.WASM.

Example: initWASM "./pkg/force_kernel.js"

ensureDirExists :: String -> Aff Unit
initWasm :: String -> Aff Unit

Initialize the WASM module. Call once at application startup.

initWasm :: String -> Aff Unit

Initialize the WASM module. Call once at application startup.

The URL should point to the generated JavaScript module from wasm-pack. Example: initWasm "./pkg/force_kernel.js"

loadContents :: String -> Aff Unit

Loads a .env-compatible string into the environment. This is useful when sourcing configuration from somewhere other than a local .env file.

mkdir :: String -> Aff Unit
openURL :: String -> Aff Unit
toastS :: String -> Aff Unit

Sends a toast with content being text.

unlink :: String -> Aff Unit
write :: String -> Aff Unit
debug :: forall m. MonadEffect m => String -> m Unit
error :: forall m. MonadEffect m => String -> m Unit
group :: forall m. MonadEffect m => String -> m Unit
groupCollapsed :: forall m. MonadEffect m => String -> m Unit
info :: forall m. MonadEffect m => String -> m Unit
log :: forall m. MonadEffect m => String -> m Unit
time :: forall m. MonadEffect m => String -> m Unit
timeEnd :: forall m. MonadEffect m => String -> m Unit
timeLog :: forall m. MonadEffect m => String -> m Unit
warn :: forall m. MonadEffect m => String -> m Unit
fail :: forall m. MonadThrow Error m => String -> m Unit
tellLn :: forall m. MonadWriter String m => String -> m Unit
log :: forall a. MonadEffect a => String -> a Unit
quickCheck :: forall p. Testable p => p -> Aff Unit

Runs a Testable with a random seed and 100 inputs.

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
parseJSON :: forall a. ReadForeign a => String -> Aff a

Parse JSON from a string

setFont :: forall m. MonadCanvasAction m => String -> m 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
change :: forall m. Testable m => String -> m Unit

A convenience specialization of fireEvent, simulating the change event with the given value.

find "input" >> change "some text"
clear :: forall store. IDBObjectStore store => store -> Aff Unit

Deletes all records in store.

clickOn :: forall m. Testable m => String -> m Unit

A convenience function, finding an element by CSS selector and simulating the click event on it.

clickOn "button.t--my-button"
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
cmd_ :: forall m. MonadAff m => String -> m Unit
cmdPipe :: forall m. MonadAff m => String -> m Unit
delay :: forall d. Duration d => d -> Aff Unit
delete :: forall ma. MonadAff ma => String -> ma Unit

Deletes the database called dbName. If the database does not exist this method will still succeed.

Documentation: dexie.org/docs/Dexie/Dexie.delete()

delete :: forall cursor. IDBCursor cursor => cursor -> Aff Unit

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

dive :: forall m. MonadState (List String) m => String -> m Unit
el_ :: forall m. MonadDomBuilder m => String -> m Unit
error :: forall eff m. MonadEff (console :: CONSOLE | eff) m => String -> m Unit
error :: forall m. MonadEffect m => String -> m Unit
fail :: forall m. MonadEffect m => String -> m Unit
gumPager :: forall m. MonadAff m => String -> m Unit
info :: forall eff m. MonadEff (console :: CONSOLE | eff) m => String -> m Unit
info :: forall m. MonadEffect m => String -> m Unit
loadSimpleJsonFile :: forall a. ReadForeign a => String -> Aff a
log :: forall eff m. MonadEff (console :: CONSOLE | eff) m => String -> m Unit
log :: forall m. MonadEffect m => String -> m Unit
log :: forall m. MonadEffect m => String -> m Unit
log :: forall m. MonadIOSync m => String -> m Unit
logError :: forall m. MonadEffect m => String -> m Unit
logError :: forall m. MonadIOSync m => String -> m Unit
logInfo :: forall m. MonadIOSync m => String -> m Unit
logWarning :: forall m. MonadIOSync m => String -> m Unit
pager :: forall m. MonadEffect m => String -> m Unit
pagerNative :: forall m. MonadEffect m => String -> m Unit
rawHtml :: forall m. MonadDomBuilder m => String -> m Unit
runSpecs :: forall m. MonadAff m => String -> m Unit
taddle :: forall m a. MonadTell (List (Tuple a String)) m => MonadState a m => String -> m Unit
text :: forall d. Syntax d => String -> d Unit

text parses/prints a fixed text and consumes/produces a unit value.

text :: forall m. MonadDomBuilder m => String -> m Unit
usePushRoute :: forall m. Router m => String -> m Unit

Push a new Route to the browser history.

useReplaceRoute :: forall m. Router m => String -> m Unit

Replace the current Route in the browser history.

warn :: forall eff m. MonadEff (console :: CONSOLE | eff) m => String -> m Unit
warn :: forall m. MonadEffect m => String -> m Unit
crashWith :: forall a. Partial => String -> a

A partial function which crashes on any input with the specified message.

unsafeCrashWith :: forall a. String -> a

A function which crashes with the specified error message.

unsafeThrow :: forall a. String -> a

Defined as unsafeThrowException <<< error.

put :: forall m s. MonadState s m => s -> m Unit

Set the state.

tell :: forall w m. MonadTell w m => w -> m Unit
debugShow :: forall m a. MonadEffect m => Show a => a -> m Unit
errorShow :: forall m a. MonadEffect m => Show a => a -> m Unit
infoShow :: forall m a. MonadEffect m => Show a => a -> m Unit
logShow :: forall m a. MonadEffect m => Show a => a -> m Unit
warnShow :: forall m a. MonadEffect m => Show a => a -> m Unit
impossible :: forall a. String -> a
discard :: forall a m. Monad m => a -> m Unit

Discards a value

traceM :: forall m a. DebugWarning => Monad m => a -> m Unit

Log any PureScript value to the console and return the unit value of the Monad m.

delay :: forall m d. MonadAff m => Duration d => d -> m Unit
fromString :: forall s. IsString s => String -> s
url :: forall a. URL a => String -> a
mwrite :: forall s m. ReferM s m => s -> m Unit
throwString :: forall a m. MonadThrow Error m => String -> m a
readDefault :: forall a. Read a => Zero a => String -> a

Read a value a from a String but fallback on Zero a on failure

fromString :: forall a. IsString a => String -> a
text :: forall html a. Html html => String -> html a
unsafeGlobal :: forall t. String -> t

Like global, but for when you're really sure it exists and are willing to tolerate it being quietly undefined (or plan to use the Undef module functions)

stringValue :: forall a. Value a => String -> a
clearRect :: forall m r. MonadCanvasAction m => ToRegion Number r => r -> m Unit

Clear a rectangular area

fillRect :: forall m r. MonadCanvasAction m => ToRegion Number r => r -> m Unit

Fill a rectangular area

setFillStyle :: forall m r. MonadCanvasAction m => CanvasStyle r => r -> m Unit
setShadowColor :: forall m color. MonadCanvasAction m => CanvasColor color => color -> m Unit
setShadowOffset :: forall m p. MonadCanvasAction m => ToPos Number p => p -> m Unit

Set x and y shadow offset at the same time

setStrokeStyle :: forall m r. MonadCanvasAction m => CanvasStyle r => r -> m Unit
strokeRect :: forall m r. MonadCanvasAction m => ToRegion Number r => r -> m Unit

Stroke a rectangular area

interp :: forall a. Interp a => String -> a

Use the derived function, i, instead of this function to do string interpolation. Otherwise, you will get a compiler error if the first value is not a String:

interp "a" 42 true == "a42true"
i      "a" 42 true == "a42true"

interp 42 "a" -- does not compile!
i      42 "a" -- compiles!
string :: forall t. Corecursive t EJsonF => String -> t
to1 :: forall f rep. Generic1 f rep => rep -> f Unit
act_ :: forall a m. Mother m => a -> m Unit
cp :: forall @args input m. CmdArgs "cp" args => KnownTemplateArgs args input => MonadAff m => input -> m Unit
cpArgs :: forall args m. ToArgs args => MonadAff m => args -> m Unit
crash :: forall m a. Testable m => String -> m a
delay :: forall m d. MonadAff m => Duration d => d -> m Unit
emptyHandler :: forall m a. Applicative m => a -> m Unit

an empty event handler

errorShow :: forall eff m a. Show a => MonadEff (console :: CONSOLE | eff) m => a -> m Unit
exec_ :: forall m q. MonadSession m => AsQuery q => q -> m Unit

Executes a query and discards the result

fromDefault :: forall mod m. MonadAff m => String -> m mod

Import a module with a default export

fromString :: forall a. Utf8Encodable a => String -> a
fromString :: forall a. Utf8Encodable a => String -> a
gum_ :: forall args m. ToArgs args => MonadAff m => args -> m Unit
ident :: forall f t. Corecursive t (SqlF f) => String -> t
infoShow :: forall eff m a. Show a => MonadEff (console :: CONSOLE | eff) m => a -> m Unit
logDebug :: forall m a. MonadLog m => Loggable a => a -> m Unit
logError :: forall m a. MonadLog m => Loggable a => a -> m Unit
logFmt :: forall @tmpl segments input m. IsSymbol tmpl => ParseTemplate tmpl segments => RenderInput segments input => MonadEffect m => input -> m Unit
logInfo :: forall m a. MonadLog m => Loggable a => a -> m Unit
logShow :: forall eff m a. Show a => MonadEff (console :: CONSOLE | eff) m => a -> m Unit
logShow :: forall m a. MonadEffect m => Show a => a -> m Unit
logWarning :: forall m a. MonadLog m => Loggable a => a -> m Unit
mkdir :: forall @args input m. CmdArgs "mkdir" args => KnownTemplateArgs args input => MonadAff m => input -> m Unit
mkdirArgs :: forall args m. ToArgs args => MonadAff m => args -> m Unit
mv :: forall @args input m. CmdArgs "mv" args => KnownTemplateArgs args input => MonadAff m => input -> m Unit
mvArgs :: forall args m. ToArgs args => MonadAff m => args -> m Unit
normalize :: forall m n. MonadEffect m => NodeOp n => n -> m Unit
onElement :: forall e m. Feed e m => e -> m Unit
parse :: forall a. Router a => String -> a
parseError :: forall e. OwoifyError e => String -> e

Representing general parser error. Currently not used.

parseSlot' :: forall a. EmptyableSlot a => String -> a
property' :: forall a. String -> a
read :: forall a. Read a => Partial => String -> a
require :: forall a. String -> a
rm :: forall @args input m. RmArgs args => KnownTemplateArgs args input => MonadAff m => input -> m Unit
rmArgs :: forall args m. ToArgs args => MonadAff m => args -> m Unit
string :: forall t. Corecursive t (SqlF EJsonF) => String -> t
touch :: forall @args input m. CmdArgs "touch" args => KnownTemplateArgs args input => MonadAff m => input -> m Unit
touchArgs :: forall args m. ToArgs args => MonadAff m => args -> m Unit
unexpected :: forall m a. Parsing m => String -> m a
unsafeUnserialize :: forall m. UnserializeState m => String -> m
updateStore :: forall a s m. MonadStore a s m => a -> m Unit
warnShow :: forall eff m a. Show a => MonadEff (console :: CONSOLE | eff) m => a -> m Unit
abs :: forall a. Ord a => Ring a => a -> a

The absolute value function. abs x is defined as if x >= zero then x else negate x.

from :: forall a rep. Generic a rep => a -> rep
genericNot :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a

A Generic implementation of the not member from the HeytingAlgebra type class.

genericNot' :: forall a. GenericHeytingAlgebra a => a -> a
negate :: forall a. Ring a => a -> a

negate x can be used as a shorthand for zero - x.

not :: forall a. HeytingAlgebra a => a -> a
pure :: forall f a. Applicative f => a -> f a
recip :: forall a. DivisionRing a => a -> a
signum :: forall a. Ord a => Ring a => a -> a

The sign function; returns one if the argument is positive, negate one if the argument is negative, or zero if the argument is zero. For floating point numbers with signed zeroes, when called with a zero, this function returns the argument in order to preserve the sign. For any x, we should have signum x * abs x == x.

to :: forall a rep. Generic a rep => rep -> a
unwrap :: forall t a. Newtype t a => t -> a
wrap :: forall t a. Newtype t a => a -> t
unsafeCoerce :: forall a b. a -> b

A highly unsafe function, which can be used to persuade the type system that any type is the same as any other type. When using this function, it is your (that is, the caller's) responsibility to ensure that the underlying representation for both types is the same.

Because this function is extraordinarily flexible, type inference can greatly suffer. It is highly recommended to define specializations of this function rather than using it as-is. For example:

fromBoolean :: Boolean -> Json
fromBoolean = unsafeCoerce

This way, you won't have any nasty surprises due to the inferred type being different to what you expected.

After the v0.14.0 PureScript release, some of what was accomplished via unsafeCoerce can now be accomplished via coerce from purescript-safe-coerce. See that library's documentation for more context.

inj :: forall a b. Inject a b => a -> b
unsafePartial :: forall a. (Partial => a) -> a

Discharge a partiality constraint, unsafely.

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

Contain a single value. For example:

singleton "foo" == (NEL.singleton "foo" :: NEL.NonEmptyList String)
from :: forall a b. TypeEquals a b => b -> a
to :: forall a b. TypeEquals a b => a -> b
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.

throwError :: forall e m a. MonadThrow e m => e -> m a
convertDuration :: forall a b. Duration a => Duration b => a -> b

Converts directly between durations of differing types.

negateDuration :: forall a. Duration a => a -> a

Negates a duration, turning a positive duration negative or a negative duration positive.

coerce :: forall a b. Coercible a b => a -> b

Coerce a value of one type to a value of some other type, without changing its runtime representation. This function behaves identically to unsafeCoerce at runtime. Unlike unsafeCoerce, it is safe, because the Coercible constraint prevents any use of this function from compiling unless the compiler can prove that the two types have the same runtime representation.

One application for this function is to avoid doing work that you know is a no-op because of newtypes. For example, if you have an Array (Conj a) and you want an Array (Disj a), you could do Data.Array.map (un Conj >>> Disj), but this performs an unnecessary traversal of the array, with O(n) cost. coerce accomplishes the same with only O(1) cost:

mapConjToDisj :: forall a. Array (Conj a) -> Array (Disj a)
mapConjToDisj = coerce
div10 :: forall x q. Div10 x q => x -> q
isDivBy :: forall d x. IsDivBy d x => d -> x
mul10 :: forall x q. Mul10 x q => x -> q
not :: forall b1 b2. Not b1 b2 => b1 -> b2
pred :: forall x y. Pred x y => x -> y
succ :: forall x y. Succ x y => x -> y
cast :: forall a b. Castable a b => a -> b
coerce :: forall expected given. Coerce given expected => given -> expected
coerce :: forall expected given. Coerce given expected => given -> expected
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
coerceReactProps :: forall props nonDataProps targetProps. CoerceReactProps props nonDataProps targetProps => props -> targetProps
ginverse :: forall g. Group g => g -> g
unsafeHideDataProps :: forall props without. WithoutDataProps props without => props -> without
convertImpl :: forall input output. ToInternalConverter input output => input -> output
convertTo :: forall t f r. Recursive t f => Corecursive r f => t -> r
fill :: forall partial complete. Fillable partial complete => partial -> complete
justify :: forall unjust just. Justifiable unjust just => unjust -> just
lambek :: forall t f. Recursive t f => Corecursive t f => t -> f t
mnegateL :: forall r x. LeftModule x r => x -> x
mnegateR :: forall r x. RightModule x r => x -> x
nextPrime :: forall a. Ord a => Semiring a => EuclideanRing a => a -> a

Ad infinitum

pad :: forall @n a b. Pad n a b => a -> b
project :: forall t f. Recursive t f => t -> f t
unpad :: forall @n a b. Unpad n a b => b -> a
area :: forall s n. ToSize n s => Semiring n => s -> n

Get the area of a size

convertPos :: forall p1 p2 n. ToPos n p1 => FromPos n p2 => p1 -> p2