sifflet-2.3.0: Simple, visual, functional language for learning about recursion.

Safe HaskellSafe
LanguageHaskell2010

Language.Sifflet.Export.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 where Source

Minimal complete definition

hsPretty

data Module Source

A Haskell module; moduleDecls are functions and variables.

newtype ExportSpec Source

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

Constructors

ExportSpec [String] 

newtype 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 

operatorTable :: Map String Operator Source

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 (-)?