readme-lhs-0.8.1: Literate programming support.
Safe HaskellNone
LanguageHaskell2010

Readme.Convert

Description

Helpers for converting between lhs and hs files.

Synopsis

Documentation

data Section Source #

Type of file section

Constructors

Code 
Comment 

Instances

Instances details
Eq Section Source # 
Instance details

Defined in Readme.Convert

Methods

(==) :: Section -> Section -> Bool #

(/=) :: Section -> Section -> Bool #

Show Section Source # 
Instance details

Defined in Readme.Convert

data Block Source #

A native section block.

Constructors

Block Section [Text] 

Instances

Instances details
Eq Block Source # 
Instance details

Defined in Readme.Convert

Methods

(==) :: Block -> Block -> Bool #

(/=) :: Block -> Block -> Bool #

Show Block Source # 
Instance details

Defined in Readme.Convert

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

data Format Source #

just in case there are ever other formats (YAML haskell anyone?)

Constructors

Lhs 
Hs 

bird :: Parser Block Source #

  • .lhs bird style

normal :: Parser (Maybe (Section, Section), [Text]) Source #

Parse a .hs

Normal code (.hs) is parsed where lines that are continuation of a section (neither contain clues as to whether code or comment) are output as Nothing, and the clues as to what the current and next section are is encoded as Just (current, next).

parseHs :: [Text] -> [Block] Source #

Parse assuming a hs block of code

printHs :: [Block] -> [Text] Source #

Print a block of code to hs style

parseLhs :: [Text] -> [Block] Source #

Parse an lhs-style block of text in

printLhs :: [Block] -> [Text] Source #

Convert a block of code into lhs.

parse :: Format -> [Text] -> [Block] Source #

Parse

print :: Format -> [Block] -> [Text] Source #

Print

lhs2hs :: FilePath -> IO () Source #

Convert a file from lhs to hs

hs2lhs :: FilePath -> IO () Source #

Convert a file from hs to lhs