| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.PureScript.Pretty.Common
Description
Common pretty-printing utility functions
Synopsis
- parensT :: Text -> Text
- parensPos :: Emit gen => gen -> gen
- intercalate :: Monoid m => m -> [m] -> m
- class Monoid gen => Emit gen where
- emit :: Text -> gen
- addMapping :: SourceSpan -> gen
- data SMap = SMap Text SourcePos SourcePos
- newtype StrPos = StrPos (SourcePos, Text, [SMap])
- newtype PlainString = PlainString Text
- runPlainString :: PlainString -> Text
- addMapping' :: Emit gen => Maybe SourceSpan -> gen
- bumpPos :: SourcePos -> SMap -> SMap
- addPos :: SourcePos -> SourcePos -> SourcePos
- data PrinterState = PrinterState {}
- blockIndent :: Int
- withIndent :: StateT PrinterState Maybe gen -> StateT PrinterState Maybe gen
- currentIndent :: Emit gen => StateT PrinterState Maybe gen
- objectKeyRequiresQuoting :: Text -> Bool
- before :: Box -> Box -> Box
- beforeWithSpace :: Box -> Box -> Box
- endWith :: Box -> Box -> Box
Documentation
intercalate :: Monoid m => m -> [m] -> m Source #
Generalize intercalate slightly for monoids
class Monoid gen => Emit gen where Source #
Instances
| Emit PlainString Source # | |
Defined in Language.PureScript.Pretty.Common | |
| Emit StrPos Source # | |
Defined in Language.PureScript.Pretty.Common | |
String with length and source-map entries
Instances
| Monoid StrPos Source # | |
| Semigroup StrPos Source # | Make a monoid where append consists of concatenating the string part, adding the lengths appropriately and advancing source mappings on the right hand side to account for the length of the left. |
| Emit StrPos Source # | |
Defined in Language.PureScript.Pretty.Common | |
newtype PlainString Source #
Constructors
| PlainString Text |
Instances
| Monoid PlainString Source # | |
Defined in Language.PureScript.Pretty.Common Methods mempty :: PlainString # mappend :: PlainString -> PlainString -> PlainString # mconcat :: [PlainString] -> PlainString # | |
| Semigroup PlainString Source # | |
Defined in Language.PureScript.Pretty.Common Methods (<>) :: PlainString -> PlainString -> PlainString # sconcat :: NonEmpty PlainString -> PlainString # stimes :: Integral b => b -> PlainString -> PlainString # | |
| Emit PlainString Source # | |
Defined in Language.PureScript.Pretty.Common | |
runPlainString :: PlainString -> Text Source #
addMapping' :: Emit gen => Maybe SourceSpan -> gen Source #
data PrinterState Source #
Constructors
| PrinterState | |
blockIndent :: Int Source #
Number of characters per indentation level
withIndent :: StateT PrinterState Maybe gen -> StateT PrinterState Maybe gen Source #
Pretty print with a new indentation level
currentIndent :: Emit gen => StateT PrinterState Maybe gen Source #
Get the current indentation level
objectKeyRequiresQuoting :: Text -> Bool Source #