Module

Data.Array.Builder

Package
purescript-array-builder
Repository
paluh/purescript-array-builder

#Builder Source

newtype Builder a

Constructors

Instances

#unsafeCons Source

unsafeCons :: forall a. a -> Array a -> Array a

#unsafeConsArray Source

unsafeConsArray :: forall a. Array a -> Array a -> Array a

#unsafeSnoc Source

unsafeSnoc :: forall a. a -> Array a -> Array a

#unsafeSnocArray Source

unsafeSnocArray :: forall a. Array a -> Array a -> Array a

#appendCons Source

appendCons :: forall a. a -> Builder a -> Builder a

#appendBuilders Source

appendBuilders :: forall a. Builder a -> Builder a -> Builder a

#(<+>) Source

Operator alias for Data.Array.Builder.appendBuilders (right-associative / precedence 5)

#(:>) Source

Operator alias for Data.Array.Builder.appendCons (right-associative / precedence 6)

Like a List.Cons - it expects that the second argument is a Builder. So usually you want to do something like:

x = build $ e1 :> e2 :> e3 :> mempty

#appendSnoc Source

appendSnoc :: forall a. Builder a -> a -> Builder a

#(<:) Source

Operator alias for Data.Array.Builder.appendSnoc (left-associative / precedence 7)

x = build $ mempty <: e1 <: e2 <: e3

#snocArray Source

snocArray :: forall a. Array a -> Builder a

#appendSnocArray Source

appendSnocArray :: forall a. Builder a -> Array a -> Builder a

#(<+) Source

Operator alias for Data.Array.Builder.appendSnocArray (left-associative / precedence 7)

build $ <> -3 :> [-2, -1] +> 0 :> 1 :> 2 :> mempty <+ [3,4] <: 5 <: 6 <+ [7, 8] <: 9 <: 10

#consArray Source

consArray :: forall a. Array a -> Builder a
cons 1 <> consArray [2,3,4] <> cons 5 <> mempty

#appendConsArray Source

appendConsArray :: forall a. Array a -> Builder a -> Builder a

#(+>) Source

Operator alias for Data.Array.Builder.appendConsArray (right-associative / precedence 6)

#cons Source

cons :: forall a. a -> Builder a

#snoc Source

snoc :: forall a. a -> Builder a

#buildImpl Source

buildImpl :: forall a. Builder a -> Nullable (Array a)

#build Source

build :: forall a. Builder a -> Maybe (Array a)

#unsafeBuild Source

unsafeBuild :: forall a. Builder a -> Array a