Copyright | (c) Yoshikuni Jujo 2018 |
---|---|
License | BSD-3-Clause |
Maintainer | PAF01143@nifty.ne.jp |
Safe Haskell | Safe |
Language | Haskell2010 |
With QuasiQuotes language extension.
Synopsis
Documentation
nowdoc :: QuasiQuoter Source #
Simplest here document. Only two transformation.
- remove head newline if exist
- remove one space from '|', space, space, ..., ']'
main :: IO () main = putStrLn [nowdoc|hello|]
main :: IO () main = putStr [nowdoc| Hello, world! |]
main :: IO () main = putStr [nowdoc| main :: IO () main = putStr [nowdoc| Hello, world! | ] |]
txtfile :: QuasiQuoter Source #
QuasiQuoter txtfile incerts file contents as string without transformation. It read file as text file (with default encoding on your system).
main :: IO () main = putStr [txtfile|foo.txt|]
binfile :: QuasiQuoter Source #
QuasiQuoter binfile incerts file contents as string without transformation. It read file as binary file.
main :: IO () main = print [binfile|foo.dat|]