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.

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.

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