Copyright | (c) 2020 comp |
---|---|
License | MIT |
Maintainer | onecomputer00@gmail.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A class for source text types. You should not need to use this, except to add new source types.
Synopsis
- class Monoid s => Source s where
- sourceToLines :: s -> [s]
- sourceToText :: s -> Text
Documentation
class Monoid s => Source s where Source #
A class for manipulating and converting source text.
For ByteString
source types, you should convert it to one of the built-in instances with your encoding of choice.
Every Source
must be a Monoid
to allow for a mempty
which will be used as a source line when a pointer references
an out-of-bounds line.
sourceToLines :: s -> [s] Source #
Splits the source into lines.
sourceToText :: s -> Text Source #
Converts the source text to Text
(strict). The given source text is a single line of the source.
Instances
Source String Source # | |
Defined in Errata.Source sourceToLines :: String -> [String] Source # sourceToText :: String -> Text Source # | |
Source Text Source # | |
Defined in Errata.Source sourceToLines :: Text -> [Text] Source # sourceToText :: Text -> Text0 Source # | |
Source Text Source # | |
Defined in Errata.Source sourceToLines :: Text -> [Text] Source # sourceToText :: Text -> Text Source # |