git.iko.soy/rowtype-yoga/purescript-arraybuffer-builder
on master help sign in
packaging
d0b8760James Brock
psc-package.json+1−1
@@ -1,5 +1,5 @@
1{
1{
2− "name": "purescript-easy-nix-example",
2+ "name": "purescript-arraybuffer-builder",
3 "set": "psc-0.13.8",
3 "set": "psc-0.13.8",
4 "source": "https://github.com/purescript/package-sets.git",
4 "source": "https://github.com/purescript/package-sets.git",
5 "depends": [
5 "depends": [
spago.dhall+1−1
@@ -2,7 +2,7 @@
2Welcome to a Spago project!
2Welcome to a Spago project!
3You can edit this file as you like.
3You can edit this file as you like.
4-}
4-}
5−{ name = "purescript-easy-nix-example"
5+{ name = "purescript-arraybuffer-builder"
6, dependencies =
6, dependencies =
7 [ "arraybuffer-types"
7 [ "arraybuffer-types"
8 , "arraybuffer"
8 , "arraybuffer"
src/Data/ArrayBuffer/Builder.purs+13−4
@@ -392,7 +392,7 @@ putFloat64le = putArrayBuffer <=< encodeFloat64le
392-- | * *O(1)* monoid append
392-- | * *O(1)* monoid append
393-- | * *O(n)* fold
393-- | * *O(n)* fold
394-- |
394-- |
395−-- | Our `Builder` monoid implementation is an unbalanced binary tree.
395+-- | Our `Builder` implementation is an unbalanced binary tree.
396-- |
396-- |
397-- | For monoid `append`, what we actually get is *O(1)* when either the
397-- | For monoid `append`, what we actually get is *O(1)* when either the
398-- | left or right tree is a singleton. If that's not true, then in the
398-- | left or right tree is a singleton. If that's not true, then in the
@@ -439,8 +439,7 @@ putFloat64le = putArrayBuffer <=< encodeFloat64le
439-- |
439-- |
440-- | We hope that this implementation is fairly fast, but we
440-- | We hope that this implementation is fairly fast, but we
441-- | haven't chosen this implementation because it's fast, we've chosen
441-- | haven't chosen this implementation because it's fast, we've chosen
442−-- | this implementation because it's simple. This library provides basic
442+-- | this implementation because it's simple.
443−-- | ArrayBuffer serialization with the familar “put monad” style.
444-- | The only currently existing Purescript libary which does ArrayBuffer
443-- | The only currently existing Purescript libary which does ArrayBuffer
445-- | serialization is
444-- | serialization is
446-- | https://pursuit.purescript.org/packages/purescript-arraybuffer-class
445-- | https://pursuit.purescript.org/packages/purescript-arraybuffer-class
@@ -451,4 +450,14 @@ putFloat64le = putArrayBuffer <=< encodeFloat64le
451-- | one is fast.
450-- | one is fast.
452-- |
451-- |
453-- | One relatively cheap and simple performance improvement for this library would be to
452-- | One relatively cheap and simple performance improvement for this library would be to
454−-- | remove the Null constructor of `Builder` and instead use Javascript nulls.
453+-- | remove the Null constructor of `Builder` and instead use Javascript nulls.
454+-- |
455+-- | In the longer term, it might make sense to try to change the Builder so
456+-- | that it works like the
457+-- | https://hackage.haskell.org/package/bytestring/docs/Data-ByteString-Builder.html
458+-- |
459+-- | Here are some benchmarks of different Haskell ByteString builders
460+-- | https://github.com/haskell-perf/strict-bytestring-builders
461+-- |
462+-- | We've tried to design the API for this library with minimal assumptions,
463+-- | so that if we want to change the Builder implementation later then we can.