Safe HaskellSafe

S09

Contents

Description

Solutions to Exercises for January 18, 2019

Synopsis

Exercise 2

xmlToString :: Xml -> String Source #

Transform a value of type Xml into a String.

Exercise 3

balpar :: Parser Char Int Source #

Consume longest prefix of input tokens that correspond to the grammar of balanced parentheses and return the number of matching pairs of parentheses.

Exercise 4

parseSet :: Parser Char (Set Int) Source #

A parser for Sets of Ints.

Exercise 5

data T Source #

A type of tokens for lambda terms.

Instances

Show T # 

Methods

showsPrec :: Int -> T -> ShowS #

show :: T -> String #

showList :: [T] -> ShowS #

lexTerm :: Parser Char [T] Source #

A lexer for lambda Terms.

Exercise 6

parseTerm :: Parser T Term Source #

A parser for lambda Terms that expects tokens of type T.

parseTermChar :: Parser Char Term Source #

A combined lexer/parser for lambda Terms that expects Character tokesn.