string-interpolate-0.3.4.0: Haskell string/text/bytestring interpolation that just works

Copyright | (c) William Yao 2019-2023
License | BSD-3
Maintainer | williamyaoh@gmail.com
Stability | experimental
Portability | POSIX
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.String.Interpolate.Parse

Description

YOU SHOULD NOT USE THIS MODULE.

This is exported mainly so tests can introspect on the implementation.

Synopsis

- data ParseOutput = ParseOutput {
  - poHeaderWS :: Lines
  - poContent :: Lines
  - poFooterWS :: Lines
  }
- parseInput :: String -> Either String ParseOutput
- parseInterpSegments :: String -> Either String Lines
- dosToUnix :: String -> String

# Documentation

data ParseOutput Source #

Each section here is a list of lines.

Content here is defined by the contiguous sequence of lines begining with the first non-blank line and ending with the last non-blank line

Constructors

ParseOutput |

Fields

- poHeaderWS :: Lines
- poContent :: Lines
- poFooterWS :: Lines

#### Instances

Instances details

Show ParseOutput Source # |
Instance details Defined in Data.String.Interpolate.Parse Methods showsPrec :: Int -> ParseOutput -> ShowS Source # show :: ParseOutput -> String Source # showList :: [ParseOutput] -> ShowS Source #
Eq ParseOutput Source # |
Instance details Defined in Data.String.Interpolate.Parse Methods (==) :: ParseOutput -> ParseOutput -> Bool Source # (/=) :: ParseOutput -> ParseOutput -> Bool Source #

parseInput :: String -> Either String ParseOutput Source #

Like `parseInterpSegments`, but for cases where we need to do more complicated transformations on the input. Separates the interpolation input into its content, whitespace header, and whitespace footer.

parseInterpSegments :: String -> Either String Lines Source #

Given the raw input from a quasiquote, parse it into the information we need to output the actual expression.

Returns an error message if parsing fails.

dosToUnix :: String -> String Source #