Module

ExternsCheck

Package
purescript-externs-check
Repository
hdgarrood/purescript-externs-check

#checkEntryPoint Source

checkEntryPoint :: Options -> Json -> Either (NonEmptyArray UnsuitableReason) Unit

Given a module's externs JSON, check that it exports a value with the name specified in the Options, and also that the value is suitable for use as a program's entry point (based on comparing its type in the externs file to the types specified in the Options).

#Options Source

type Options = { mainName :: String, typeConstructors :: NonEmptyArray FQName }

Options for checking an entry point.

The typeConstructors option allows you to provide a list of type constructors which the entry point's type must appear in; usually this array will consist of Effect.Effect and Control.Monad.Eff.Eff, but you may want to use an alternative list of types. Note however, that whichever types you use, you should ensure that their runtime representation is the same as Effect, in that it should be a function which executes your program when it is called with no arguments, as most PureScript tooling will assume that this is the case.

The mainName option specifies the name of the entry point value; usually "main".

#defaultOptions Source

defaultOptions :: Options

Default Options for an entry point check. Using these Options will check that your entry point module exports a main value whose type is either Effect.Effect or Control.Monad.Eff.Eff.

#FQName Source

newtype FQName

A fully-qualified name (eg. for a value or a type class).

Constructors

Instances

#typeEff Source

typeEff :: FQName

A FQName representing Eff from Control.Monad.Eff. This is defined as

FQName "Control.Monad.Eff.Eff"

#exportedValues Source

exportedValues :: Json -> Array String

Return a list of exported values from a module, given its externs file

Modules
ExternsCheck