@@ -0,0 +1,41 @@
6+import Data.ArrayBuffer.Types
8+type PutM m a = forall m a. (MonadEffect m) => WriterT Builder m a
9+type Put = PutM Effect Unit
10+ -- Note: use liftEffect to call the ArrayBuffer Effect functions
12+-- | Builder for `ArrayBuffer`s.
14+-- | It is common to build an `ArrayBuffer` by issuing a sequence of `tell`
15+-- | commands in a `WriterT Builder IO` monad.
17+-- | *O(1)* `mappend` and *O(1)* `snoc` and *O(n)* `fold`.
19+ = Node ArrayBuffer Builder Builder
22+instance semigroupBuilder :: Semigroup Builder where
23+ append Null Null = Null
26+ append (Node lx ll lr) (Node rx rl rr) = Node lx (Node )
29+-- = Tree (Nullable Builder) (Nullable Builder)
32+-- instance semigroupBuilder :: Semigroup Builder where
36+ = Tree Builder Builder
37+ | Snoc Builder ArrayBuffer
40+-- Note use `censor` instead of `tell` to accumulate, so we don't have to make
41+-- a dummy List and then strip it off.