@@ -26,9 +26,6 @@ module Data.Syntax.Combinator
29− -- * Arrowized combinators.
32 -- * Vectors.
29 -- * Vectors.
33 vecNSepBy,
30 vecNSepBy,
34 ivecNSepBy,
31 ivecNSepBy,
@@ -51,11 +48,10 @@ import Control.Category.Structures
51import Control.Lens
48import Control.Lens
52import Control.Lens.SemiIso
49import Control.Lens.SemiIso
53import Control.SIArrow
50import Control.SIArrow
54−import qualified Data.MonoTraversable as Seq
55import Data.Syntax
51import Data.Syntax
56import qualified Data.Vector as V
52import qualified Data.Vector as V
57import qualified Data.Vector.Unboxed as VU
53import qualified Data.Vector.Unboxed as VU
58−import Prelude hiding (id, (.), take)
54+import Prelude hiding (id, (.))
60-- | One or zero occurences of @f@.
56-- | One or zero occurences of @f@.
61optional :: SIArrow cat => cat () a -> cat () (Maybe a)
57optional :: SIArrow cat => cat () a -> cat () (Maybe a)
@@ -93,11 +89,6 @@ sepBy v s = sepBy1 v s /+/ sipure _Empty
93sepBy1 :: SIArrow cat => cat () a -> cat () () -> cat () [a]
89sepBy1 :: SIArrow cat => cat () a -> cat () () -> cat () [a]
94sepBy1 v s = _Cons /$/ v /*/ (s */ sepBy1 v s /+/ sipure _Empty)
90sepBy1 v s = _Cons /$/ v /*/ (s */ sepBy1 v s /+/ sipure _Empty)
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))
101-- | Constant size vector with separators.
92-- | Constant size vector with separators.
103-- @vecNSepBy n e sep@ describes a size @n@ vector with elements @e@ separated by @sep@.
94-- @vecNSepBy n e sep@ describes a size @n@ vector with elements @e@ separated by @sep@.