Skip to content

Releases: purescript-node/purescript-node-buffer

v9.0.0

05 Jul 21:11
8263037
Compare
Choose a tag to compare

Breaking changes:

  • Expose Buffer API using typeclass-less API without removing typeclass API (#53 by @JordanMartinez)

    Previously, compiler would fail to infer the type of Buffer.create 1 as Effect Buffer
    because the Buffer API was exposed only via the multiparameter typeclass MonadBuffer.
    Due to the functional dependency between the two parameters, the monadic type cannot be inferred
    until the buffer type is known (either Buffer or STBuffer).:

    import Node.Buffer as Buffer
    
    -- Example 1
    main :: Effect Unit
    main = do
      x <- Buffer.create 1 -- compiler: is this `Int -> Effect Buffer` or `Int -> ST h (STBuffer h)?
      pure unit

    The workaround was to add a type annotation, indicating the x is a Buffer:

    import Node.Buffer as Buffer
    
    -- Example 2
    main :: Effect Unit
    main = do
      x :: Buffer <- Buffer.create 1 -- compiler: Oh! It's `Int -> Effect Buffer`
      pure unit

    This change does not break anyone's code if one was using a create (or another such typeclass member)
    to get Int -> Effect Buffer. Rather, such users can now drop the :: Buffer annotation
    (i.e. Example 1 above now compiles).

    If one was using create to get forall m buf. MonadBuffer buf m => Int -> m buf,
    then one will need to update their imports:

    -import Node.Buffer (class MonadBuffer)
    +import Node.Buffer.Class (class MonadBuffer)

New features:

Bugfixes:

Other improvements:

v8.0.0

27 Apr 20:26
7be7bd0
Compare
Choose a tag to compare

Breaking changes:

v7.0.1

06 May 17:13
0721f1e
Compare
Choose a tag to compare

Other improvements:

v7.0.0

26 Feb 22:50
8ec2415
Compare
Choose a tag to compare

Breaking changes:

  • Updated code for PureScript 0.14 and dropped the proxy dependency as the proxy library has been migrated into prelude (#39).

Other improvements:

  • Removed primes from the concat' function in FFI in preparation for ES modules support (#36)
  • Migrated CI to use GitHub Actions and updated installation instructions to use Spago (#38)
  • Stopped returning empty objects in foreign implementations for functions which return Unit for a small performance benefit (#40)
  • Added a CHANGELOG.md file and pull request template to the repository (#41)

v6.0.0

24 Jul 18:18
dac7d47
Compare
Choose a tag to compare
  • Add a MutableBuffer type class with instances for both Effect and ST, to allow mutating buffers in either monad, and potentially other monads too (#24, @Dretch)
  • Remove the Show Buffer instance, as reading from a mutable buffer is effectful (@Dretch)
  • Use Number for reading and writing with Buffers (#25, @hdgarrood)

v5.0.0

26 May 23:45
d279daa
Compare
Choose a tag to compare

Updated for PureScript 0.12

v4.1.0

11 Dec 00:08
ef44e27
Compare
Choose a tag to compare

Add fromArrayBuffer (@matthewleon)

v4.0.0

19 Nov 23:09
9298bf8
Compare
Choose a tag to compare

v3.0.1

20 Jun 00:05
Compare
Choose a tag to compare

Fix an encoding issue in writeString (@justinwoo)

v3.0.0

04 Apr 03:53
Compare
Choose a tag to compare

Updates for 0.11 (@anilanar)