sifflet-lib-1.2: Library of modules shared by sifflet and its tests and its exporters.

Sifflet.Foreign.Haskell

Description

Abstract syntax tree and pretty-printing for Haskell 98. This is only a small subset of the Haskell 98 syntax, so we do not need to pull in haskell-src and all its complexity. Moreover, haskell-src gives too little control over the format of pretty-printed text output.

Synopsis

Documentation

class HsPretty a whereSource

Instances

HsPretty Operator 
HsPretty Expr

HsPretty expressions. This is going to be like in Python.hs.

HsPretty Symbol 
HsPretty Decl 
HsPretty ImportDecl 
HsPretty ExportSpec 
HsPretty Module 

data Module Source

A Haskell module; moduleDecls are functions and variables.

data ExportSpec Source

A Haskell module's export spec: a list of function and variable identifiers

Constructors

ExportSpec [String] 

data ImportDecl Source

A Haskell modules import decls: a list of module identifiers. No support for qualified or as or for selecting only some identifiers from the imported modules.

Constructors

ImportDecl [String] 

data Decl Source

A Haskell function or variable declaration. An explicit type declaration is optional. Thus we have just enough for name :: type name [args] = expr. Of course [args] would be empty if it's just a variable.

Constructors

Decl 

Instances

operatorTable :: Map String OperatorSource

The Haskell operators. Now what about the associativity of (:)? It really doesn't even make sense to ask if (:) is associative in the usual sense, since (x1 : x2) : xs == x1 : (x2 : xs) is not only untrue, but the left-hand side is a type error, except maybe in some very special cases (and then the right-hand side would probably be a type error). Is (:) what is called a right-associative operator? And do I need to expand my Operator type to include this? And then what about (-) and (/)??? Does this affect their relationship with (+) and (-)?