ExternsCheck
- Package
- purescript-externs-check
- Repository
- hdgarrood/purescript-externs-check
#Options Source
type Options = { mainName :: String, typeConstructor :: FQName }
Options for checking an entry point.
The typeConstructor
option allows you to pick a single type constructor
which the entry point should be using; usually this will be
Control.Monad.Eff.Eff
, but you may want to use an alternative type. Note
however, that whichever type you use, you should ensure that its runtime
representation is the same as Eff
, 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
Eff
.
#checkEntryPoint Source
checkEntryPoint :: Options -> Json -> Either (Array 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 type specified in the Options
).
#exportedValues Source
exportedValues :: Json -> Array String
Return a list of exported values from a module, given its externs file
#UnsuitableReason Source
- Modules
- ExternsCheck