on master help sign in
Update names and some comment.
commit43a9e3206241cf6f7ed19737cbab0540fdd059c3 authorPaweł Nowak <pawel834@gmail.com> dateThu 11 Dec 2014, 21:34 (12 years ago) parentc083497
4 files changed+10−6
Data/Syntax.hs+4−3 Data/Syntax/Char.hs+1 Data/Syntax/Combinator.hs+1 Data/Syntax/Indent.hs+4−3
Data/Syntax.hs+4−3
@@ -22,6 +22,7 @@ module Data.Syntax (
2222import Prelude hiding (take, takeWhile)
2323
2424import Control.Category.Reader
25+import Control.Category.Structures
2526import Control.Lens.Iso
2627import Control.Lens.SemiIso
2728import Control.SIArrow
@@ -34,11 +35,11 @@ packed = iso otoList fromList
3435
3536-- | An abstract syntax description based on semi-isomorphisms.
3637--
37−-- This class can be implemented by both parsers and printers (and maybe more?).
38+-- This class can be implemented by both parsers and printers.
3839--
3940-- The usual use is to write a polymorphic syntax description and instantiate it
40−-- both as a parser and a printer. An example is available in the 'syntax-example'
41−-- package.
41+-- both as a parser and a printer. Examples are available in 'syntax-example' and
42+-- 'syntax-example-json' packages.
4243--
4344-- Methods of this class try to mimic "Data.Attoparsec.Text" interface.
4445class ( SIArrow syn
Data/Syntax/Char.hs+1
@@ -26,6 +26,7 @@ module Data.Syntax.Char (
2626 ) where
2727
2828import Control.Category.Reader
29+import Control.Category.Structures
2930import Control.Lens.SemiIso
3031import Control.SIArrow
3132import Data.Bits
Data/Syntax/Combinator.hs+1
@@ -11,6 +11,7 @@ Combinators that work with any sequence type.
1111-}
1212module Data.Syntax.Combinator where
1313
14+import Control.Category.Structures
1415import Control.Lens
1516import Control.Lens.SemiIso
1617import Control.SIArrow
Data/Syntax/Indent.hs+4−3
@@ -21,6 +21,7 @@ module Data.Syntax.Indent (
2121
2222import Control.Category
2323import Control.Category.Reader
24+import Control.Category.Structures
2425import Control.SIArrow
2526import Data.Syntax
2627import Data.Syntax.Char
@@ -28,10 +29,10 @@ import Data.Syntax.Combinator
2829import Prelude hiding (takeWhile, take, id, (.))
2930
3031-- | Adds indentation to a syntax description.
31−newtype Indent cat a b = Indent { unIndent :: ReaderCT (Int, cat () ()) cat a b }
32− deriving (Category, Products, Coproducts, CategoryPlus, SIArrow)
32+newtype Indent cat a b = Indent { getIndent :: ReaderCT (Int, cat () ()) cat a b }
33+ deriving (Category, Products, Coproducts, CatPlus, SIArrow)
3334
34−instance CategoryTrans Indent where
35+instance CatTrans Indent where
3536 clift = Indent . clift
3637
3738-- Generalized newtype deriving cannot derive this :(