on f209971 help sign in
3 files changed+2−15
since splitsnapshots
unifiedsplit
Data/Syntax.hs−4 Data/Syntax/Combinator.hs+1−10 syntax.cabal+1−1
Data/Syntax.hs−4
@@ -166,10 +166,6 @@ instance Syntax syn => Syntax (ReaderCT env syn) where
166166 takeWhile1 = clift . takeWhile1
167167 takeTill = clift . takeTill
168168 takeTill1 = clift . takeTill1
169− vecN n e = ReaderCT $ vecN n . runReaderCT e
170− ivecN n e = ReaderCT $ ivecN n . runReaderCT e
171− uvecN n e = ReaderCT $ uvecN n . runReaderCT e
172− uivecN n e = ReaderCT $ uivecN n . runReaderCT e
173169
174170-- | Execute a computation in an isolated context.
175171--
Data/Syntax/Combinator.hs+1−10
@@ -26,9 +26,6 @@ module Data.Syntax.Combinator
2626 sepBy,
2727 sepBy1,
2828
29− -- * Arrowized combinators.
30− takeArr,
31−
3229 -- * Vectors.
3330 vecNSepBy,
3431 ivecNSepBy,
@@ -51,11 +48,10 @@ import Control.Category.Structures
5148import Control.Lens
5249import Control.Lens.SemiIso
5350import Control.SIArrow
54−import qualified Data.MonoTraversable as Seq
5551import Data.Syntax
5652import qualified Data.Vector as V
5753import qualified Data.Vector.Unboxed as VU
58−import Prelude hiding (id, (.), take)
54+import Prelude hiding (id, (.))
5955
6056-- | One or zero occurences of @f@.
6157optional :: SIArrow cat => cat () a -> cat () (Maybe a)
@@ -93,11 +89,6 @@ sepBy v s = sepBy1 v s /+/ sipure _Empty
9389sepBy1 :: SIArrow cat => cat () a -> cat () () -> cat () [a]
9490sepBy1 v s = _Cons /$/ v /*/ (s */ sepBy1 v s /+/ sipure _Empty)
9591
96−-- | A string of given length.
97−takeArr :: Syntax syn => syn Int (Seq syn)
98−takeArr = sibind $ iso (\n -> constant n #>> take n)
99− (\s -> constant (Seq.olength s) #>> take (Seq.olength s))
100−
10192-- | Constant size vector with separators.
10293--
10394-- @vecNSepBy n e sep@ describes a size @n@ vector with elements @e@ separated by @sep@.
syntax.cabal+1−1
@@ -22,7 +22,7 @@ description:
2222 a reader category transformer that tracks current indentation level. I plan on implementing Haskell layout rule in the
2323 future.
2424 .
25− The library can work with both text and binary data. Alas, there are no binary combinators implemented yet.
25+ Note that the library can work with both text and binary data. Alas, there are no binary combinators implemented yet.
2626 I will implement them when i have the time (but these category transformers look so much more interesting for now ;).
2727 .
2828 EXAMPLES! See @syntax-example@ and @syntax-example-json@ for examples.