nowdoc-0.1.1.0: Here document without variable expansion like PHP Nowdoc

Copyright(c) Yoshikuni Jujo 2018
LicenseBSD-3-Clause
MaintainerPAF01143@nifty.ne.jp
Safe HaskellSafe
LanguageHaskell2010

Text.Nowdoc

Description

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|]