https://github.com/pbrisbin/heredoc
https://github.com/pbrisbin/heredoc
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pbrisbin/heredoc
- Owner: pbrisbin
- License: mit
- Created: 2018-04-07T15:50:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-07T15:51:03.000Z (about 7 years ago)
- Last Synced: 2025-01-03T16:30:00.482Z (5 months ago)
- Language: Haskell
- Size: 5.86 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# heredoc
A collection of `Text`-based utilities for manipulating (conceptual) [Here
documents][heredocs]. So far, just [dedent](#todo).[heredocs]: https://en.wikipedia.org/wiki/Here_document
## Example
### `dedent`
```hs
import Data.Text (Text)
import Data.Text.Heredoc
import qualified Data.Text.IO as T
import Text.Shakespeare.Text (st)main :: IO ()
main = do
let
mydoc :: Text
mydoc = [st|
Here's a line.And another.
Thanks.
|]T.putStrLn $ dedent mydoc
``````console
% stack exec example
Here's a line.And another.
Thanks
```---
[CHANGELOG](./CHANGELOG.md) | [LICENSE](./LICENSE)