@@ -34,25 +34,27 @@ newtype Indent cat a b = Indent { unIndent :: ReaderCT (Int, cat () ()) cat a b
34instance CategoryTrans Indent where
34instance CategoryTrans Indent where
35 clift = Indent . clift
35 clift = Indent . clift
37+-- Generalized newtype deriving cannot derive this :(
37instance Syntax syn => Syntax (Indent syn) where
39instance Syntax syn => Syntax (Indent syn) where
38 type Seq (Indent syn) = Seq syn
40 type Seq (Indent syn) = Seq syn
39− anyChar = clift anyChar
41+ anyChar = Indent anyChar
40− char = clift . char
42+ char = Indent . char
41− notChar = clift . notChar
43+ notChar = Indent . notChar
42− satisfy = clift . satisfy
44+ satisfy = Indent . satisfy
43− satisfyWith ai = clift . satisfyWith ai
45+ satisfyWith ai = Indent . satisfyWith ai
44− string = clift . string
46+ string = Indent . string
45− take = clift . take
47+ take = Indent . take
46− takeWhile = clift . takeWhile
48+ takeWhile = Indent . takeWhile
47− takeWhile1 = clift . takeWhile1
49+ takeWhile1 = Indent . takeWhile1
48− takeTill = clift . takeTill
50+ takeTill = Indent . takeTill
49− takeTill1 = clift . takeTill1
51+ takeTill1 = Indent . takeTill1
51instance SyntaxChar syn => SyntaxChar (Indent syn) where
53instance SyntaxChar syn => SyntaxChar (Indent syn) where
52− decimal = clift decimal
54+ decimal = Indent decimal
53− hexadecimal = clift hexadecimal
55+ hexadecimal = Indent hexadecimal
54− scientific = clift scientific
56+ scientific = Indent scientific
55− realFloat = clift realFloat
57+ realFloat = Indent realFloat
57-- | @runIndent m tab@ runs the 'Indent' transformer using @tab@ once for each
59-- | @runIndent m tab@ runs the 'Indent' transformer using @tab@ once for each
58-- level of indentation.
60-- level of indentation.