Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Futhark prettyprinter. This module defines Pretty
instances
for the AST defined in Language.Futhark.Syntax.
Synopsis
- prettyString :: Pretty a => a -> String
- prettyTuple :: Pretty a => [a] -> Text
- leadingOperator :: Name -> BinOp
- class IsName v where
- prettyName :: v -> Doc a
- toName :: v -> Name
- class Annot f where
Documentation
prettyString :: Pretty a => a -> String Source #
Prettyprint a value to a String
, appropriately wrapped.
prettyTuple :: Pretty a => [a] -> Text Source #
Prettyprint a list enclosed in curly braces.
leadingOperator :: Name -> BinOp Source #
Given an operator name, return the operator that determines its syntactical properties.
A class for types that are variable names in the Futhark source
language. This is used instead of a mere Pretty
instance because
in the compiler frontend we want to print VNames differently
depending on whether the FUTHARK_COMPILER_DEBUGGING environment
variable is set, yet in the backend we want to always print VNames
with the tag. To avoid erroneously using the Pretty
instance for
VNames, we in fact only define it inside the modules for the core
language (as an orphan instance).
Class for type constructors that represent annotations. Used in the prettyprinter to either print the original AST, or the computed decoration.