elm-street-0.1.0.2: Crossing the road between Haskell and Elm

Safe HaskellNone
LanguageHaskell2010

Elm.Print.Common

Description

This module contains some commonly used function for working with Docs and pretty printing.

Synopsis

Documentation

showDoc :: Doc ann -> Text Source #

Shows pretty-printed document.

wrapParens :: Doc ann -> Doc ann Source #

Wraps given document in parens if it contains more than single word.

arrow :: Doc ann Source #

Pretty printed arrow (->).

mkQualified :: Text -> Doc ann Source #

Add qualified prefix to the type names or functions:

T.MyType

T.showMyType

Here we add T. prefix as we only use qualified imports for Types as T module.

typeWithVarsDoc Source #

Arguments

:: Bool

Is qualified

-> Text

Type name

-> [Text]

List of type variables

-> Doc ann 

Creates a Doc of the type with its type variables (if any).

qualifiedTypeWithVarsDoc Source #

Arguments

:: Text

Type name

-> [Text]

List of type variables

-> Doc ann 

Creates a Doc of the qualified type with its type variables (if any).