GroteTrap-0.5.1: Parser and selection library for expression languages.

Safe HaskellSafe-Inferred
LanguageHaskell98

Language.GroteTrap.Unparse

Contents

Description

The Unparse type class and its ParseTree instance, as well as some text manipulation.

Synopsis

Class Unparse

class Unparse p where Source

Types that are unparsable. Unparsing is like prettyprinting, except that instead of pretty source the original source code is retrieved. This means unparsing is only possible for values that were the result of an earlier parse.

Methods

unparse :: p -> String Source

Instances

Text utility functions

merge :: [String] -> String Source

Merge folds many strings over each other.

over :: String -> String -> String Source

over upper lower places upper over lower. The resulting string has the same characters as upper does, except where upper contains spaces; at those positions, the character from lower shows. If lower is longer than upper, upper is padded with enough spaces to show all rest of lower.