hsx2hs-0.12.0: HSX (Haskell Source with XML) allows literal XML syntax in Haskell source code.

Portabilityportable
Stabilityexperimental
MaintainerNiklas Broberg, niklas.broberg@gmail.com
Safe HaskellNone

Language.Haskell.HSX.Transform

Description

Functions for transforming abstract Haskell code extended with regular patterns into semantically equivalent normal abstract Haskell code. In other words, we transform away regular patterns.

Synopsis

Documentation

transform :: Module -> ModuleSource

Transform away occurences of regular patterns from an abstract Haskell module, preserving semantics.

transformExp :: Exp -> ExpSource

Transform expressions by traversing subterms. Of special interest are expressions that contain patterns as subterms, i.e. let, case and lambda expressions, and also list comprehensions and do-expressions. All other expressions simply transform their sub-expressions, if any. Of special interest are of course also any xml expressions.