Module

FFI.Simple

Package
purescript-ffi-simple
Repository
garganscript/purescript-ffi-simple

Unsafe functions used for FFI. Not considered part of the public api

Re-exports from FFI.Simple.Functions

#delay Source

delay :: forall m a b. Delay m => a -> (a -> m b) -> m b

#bindTo Source

bindTo :: forall f o. f -> o -> f

#args9 Source

args9 :: forall a b c d e f g h i. a -> b -> c -> d -> e -> f -> g -> h -> i -> PseudoArray

returns 9 arguments as a PseudoArray

#args8 Source

args8 :: forall a b c d e f g h. a -> b -> c -> d -> e -> f -> g -> h -> PseudoArray

returns 8 arguments as a PseudoArray

#args7 Source

args7 :: forall a b c d e f g. a -> b -> c -> d -> e -> f -> g -> PseudoArray

returns 7 arguments as a PseudoArray

#args6 Source

args6 :: forall a b c d e f. a -> b -> c -> d -> e -> f -> PseudoArray

returns 6 arguments as a PseudoArray

#args5 Source

args5 :: forall a b c d e. a -> b -> c -> d -> e -> PseudoArray

returns 5 arguments as a PseudoArray

#args4 Source

args4 :: forall a b c d. a -> b -> c -> d -> PseudoArray

returns 4 arguments as a PseudoArray

#args3 Source

args3 :: forall a b c. a -> b -> c -> PseudoArray

returns 3 arguments as a PseudoArray

#args2 Source

args2 :: forall a b. a -> b -> PseudoArray

returns 2 arguments as a PseudoArray

#args10 Source

args10 :: forall a b c d e f g h i j. a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> PseudoArray

returns 9 arguments as a PseudoArray

#args1 Source

args1 :: forall a. a -> PseudoArray

returns an argument as a PseudoArray

#applyTo Source

applyTo :: forall f this a b. f -> this -> a -> b

Apply a function to a this object with the given arguments

#applyMethod' Source

applyMethod' :: forall o a b. o -> String -> a -> b

flip applyMethod

#applyMethod Source

applyMethod :: forall o a b. String -> o -> a -> b

Lookup and apply the method with the given name on the given object to the given this and an array or pseudoarray of arguments

#(...) Source

Operator alias for FFI.Simple.Functions.applyMethod' (left-associative / precedence 4)

Re-exports from FFI.Simple.Globals

#unsafeGlobal Source

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)

#global Source

global :: forall t. String -> Maybe t

Looks up a name in globalThis, window or global depending on environment. NodeJS makes things available to a module without putting them in global, because it's shit, so don't expect much sense out of it in that environment.

Re-exports from FFI.Simple.Objects

#typeOf Source

typeOf :: forall a. a -> String

Gets the type of an object with javascript typeof

#setProperty' Source

setProperty' :: forall o v. o -> String -> v -> o

flip setProperty

#setProperty Source

setProperty :: forall o v. String -> o -> v -> o

Sets a property on an object Notes:

  • Will probably throw an error if you try to set a readonly property
  • Is meant to be used in Effect

#named Source

named :: forall o. String -> o -> o

Return the object with a custom name Notes:

  • name is a readonly property, so we define over it
  • quietly mutates the input - use immediately after creation

#maybeGetProperty' Source

maybeGetProperty' :: forall o v. o -> String -> Maybe v

flip maybeGetProperty

#maybeGetProperty Source

maybeGetProperty :: forall o v. String -> o -> Maybe v

Attempts to get a property from an object, returning Nothing if it was undefined

#isIn Source

isIn :: forall a. String -> a -> Boolean

Is the given property found on the given object or via inheritance?

#instanceOf Source

instanceOf :: forall a b. a -> b -> Boolean

Checks whether an object is an instance of an invokable

#hasOwnProperty Source

hasOwnProperty :: forall o. String -> o -> Boolean

Does this object have the given property itself (i.e. not inherited)?

#getProperty' Source

getProperty' :: forall o v. o -> String -> v

flip getProperty

#getProperty Source

getProperty :: forall o v. String -> o -> v

Get the property with the given name form the given object If property does not exist, will be undefined (see F.S.Undef)

#defineProperty' Source

defineProperty' :: forall o v. o -> String -> v -> o

#defineProperty Source

defineProperty :: forall o v. String -> o -> v -> o

Defines a new readonly property. Useful for e.g. name which is a readonly prop

#(.?) Source

Operator alias for FFI.Simple.Objects.maybeGetProperty' (left-associative / precedence 9)

#(.=) Source

Operator alias for FFI.Simple.Objects.setProperty' (left-associative / precedence 9)

#(..) Source

Operator alias for FFI.Simple.Objects.getProperty' (left-associative / precedence 9)

#(!=) Source

Operator alias for FFI.Simple.Objects.defineProperty' (left-associative / precedence 9)