haste-compiler-0.5.5.0: Haskell To ECMAScript compiler

Safe HaskellNone
LanguageHaskell98

Haste.Compiler

Description

Yo dawg we heard you like Haste, so we let yo Haste programs compile yo Haste programs!

Currently, this API calls the hastec binary. In the future it should probably be the other way around.

Synopsis

Documentation

data OptLevel

Constructors

None 
Basic 
WholeProgram 

data ProgStart

Constructors

ASAP 
OnLoad 
Custom String 

data CompileFlags

Flags to pass to the compiler. Defaults are the same as when invoking hastec directly. Consult hastec --help for more detailed descriptions.

defaultFlags :: CompileFlags

Default compiler flags.

cfOptimize :: CompileFlags -> OptLevel

How much should the given program be optimized? Default: Basic

cfDebug :: CompileFlags -> Bool

Should the output be debuggable? Debug information will be stripped if the program is minified using Closure. Default: False

cfMinify :: CompileFlags -> MinifyFlag

Should the program be minified? This will strip any debug information from the resulting program. Default: False

cfFullUnicode :: CompileFlags -> Bool

Use full Unicode compatibility for Data.Char and friends? Default: False

cfOwnNamespace :: CompileFlags -> Bool

Put generated code in a separate namespace? Default: False

cfStart :: CompileFlags -> ProgStart

How should the program be started? Default: OnLoad

cfJSFiles :: CompileFlags -> [FilePath]

Javascript files to include in the final program. Default: []

cfTarget :: CompileFlags -> HasteTarget

Where to place the compilation output. Default: TargetString

cfUseStrict :: CompileFlags -> Bool

'use strict';? Default: True

data HasteInput

Instances

compile :: CompileFlags -> FilePath -> HasteInput -> IO CompileResult

Compile a Haste program using the given compiler flags and source directory. Calling this function from the client will always result in failure.