fay-0.24.0.1: A compiler for Fay, a Haskell subset that compiles to JavaScript.

Safe HaskellNone
LanguageHaskell98

Fay.Types

Description

All Fay types and instances.

Synopsis

Documentation

data JsLit Source #

Literal value type.

Instances

Eq JsLit Source # 

Methods

(==) :: JsLit -> JsLit -> Bool #

(/=) :: JsLit -> JsLit -> Bool #

Show JsLit Source # 

Methods

showsPrec :: Int -> JsLit -> ShowS #

show :: JsLit -> String #

showList :: [JsLit] -> ShowS #

IsString JsLit Source #

Just handy to have.

Methods

fromString :: String -> JsLit #

data JsName Source #

A name of some kind.

Instances

newtype Compile a Source #

Compile monad.

Constructors

Compile 

Fields

class Printable a where Source #

Print some value.

Minimal complete definition

printJS

Methods

printJS :: a -> Printer Source #

data Fay a Source #

The JavaScript FFI interfacing monad.

Instances

Monad Fay Source # 

Methods

(>>=) :: Fay a -> (a -> Fay b) -> Fay b #

(>>) :: Fay a -> Fay b -> Fay b #

return :: a -> Fay a #

fail :: String -> Fay a #

Functor Fay Source # 

Methods

fmap :: (a -> b) -> Fay a -> Fay b #

(<$) :: a -> Fay b -> Fay a #

Applicative Fay Source # 

Methods

pure :: a -> Fay a #

(<*>) :: Fay (a -> b) -> Fay a -> Fay b #

liftA2 :: (a -> b -> c) -> Fay a -> Fay b -> Fay c #

(*>) :: Fay a -> Fay b -> Fay b #

(<*) :: Fay a -> Fay b -> Fay a #

data CompileReader Source #

Configuration and globals for the compiler.

Constructors

CompileReader 

Fields

data Config Source #

Configuration of the compiler. The fields with a leading underscore

Instances

Show Config Source # 
Default Config Source #

Default configuration.

Methods

def :: Config #

data CompileState Source #

State of the compiler.

Constructors

CompileState 

Fields

data FundamentalType Source #

These are the data types that are serializable directly to native JS data types. Strings, floating points and arrays. The others are: actions in the JS monad, which are thunks that shouldn't be forced when serialized but wrapped up as JS zero-arg functions, and unknown types can't be converted but should at least be forced.

data PrintState Source #

The state of the pretty printer.

Constructors

PrintState 

Fields

data PrintReader Source #

Global options of the printer

Constructors

PrintReader 

Fields

defaultPrintReader :: PrintReader Source #

default printer options (non-pretty printing)

data PrintWriter Source #

Output of printer

Constructors

PrintWriter 

Fields

newtype Printer Source #

The printer.

Instances

IsString Printer Source #

Write out a string, updating the current position information.

Methods

fromString :: String -> Printer #

Semigroup Printer Source # 
Monoid Printer Source # 

indented :: Printer -> Printer Source #

Print the given printer indented.

askIf :: (PrintReader -> Bool) -> Printer -> Printer -> Printer Source #

exec one of Printers depending on PrintReader property.

newline :: Printer Source #

Output a newline and makes next line indented when prPretty is True. Does nothing when prPretty is False

write :: String -> Printer Source #

Write out a raw string, respecting the indentation Note: if you pass a string with newline characters, it will print them out even if prPretty is set to False. Also next line won't be indented. If you want write a smart newline (that is the one which will be written out only if prPretty is true, and after which the line will be indented) use newline)

mapping :: SrcSpan -> Printer Source #

Generate a mapping from the Haskell location to the current point in the output.

mkModulePath :: ModuleName a -> ModulePath Source #

Construct the complete ModulePath from a ModuleName.

mkModulePaths :: ModuleName a -> [ModulePath] Source #

Construct intermediate module paths from a ModuleName. mkModulePaths A.B => [[A], [A,B]]

mkModulePathFromQName :: QName a -> ModulePath Source #

Converting a QName to a ModulePath is only relevant for constructors since they can conflict with module names.