prelude-ts

Functional programming, immutable collections and FP constructs for typescript and javascript

ISC License

Stars
376

Bot releases are visible (Hide)

prelude-ts - 1.0.6 Latest Release

Published by emmanueltouzery almost 2 years ago

prelude-ts - 1.0.5

Published by emmanueltouzery almost 2 years ago

prelude-ts - v1.0.4

Published by emmanueltouzery over 2 years ago

  • Fix #58 Tuple2 equality is broken
prelude-ts -

Published by emmanueltouzery over 3 years ago

  • Switch custom node object inspection to use Symbol.for -- fixes inspection in the node REPL and also at least bundling with vite -- thanks to @wuzzeb
prelude-ts -

Published by emmanueltouzery almost 4 years ago

  • fix HashMap hashCode() implementation with complex values (thanks to @Veramone )
prelude-ts -

Published by emmanueltouzery almost 4 years ago

  • fixes #47 hashmap & hashset had trivial hashcode collisions, were taking only the last element into account (thanks @Veramone for the report)
  • fixes #45 make allMatch a type guard
prelude-ts -

Published by emmanueltouzery over 4 years ago

1.0.0 is fully compatible with 0.8.x, the API was not broken. The version change is more to signal that prelude-ts is stable software.

new APIs:

also:

  • reduce the size of the npm packages (thanks to @aleksei-berezkin )
  • increase version of the list dependency
prelude-ts -

Published by emmanueltouzery about 5 years ago

  • fix some apidoc/README dead links
  • reduce a little the equality section in the README
  • add Seq.takeRightWhile
  • HashMap: allow valueIterable to be iterated more than once (#27, thanks @wuzzeb)
  • fix tests of Vector equality which were not effective anymore (#28 thanks @Hraun)
  • upgrade list dependency to the latest version
  • build with typescript 3.6
  • make HashSet.flatMap consistent with what we do with Vector for instance => accept only HashSet from the callback. Slight change in theory, but in practice we have only one ISet implementation for now, so no real effect.
prelude-ts - v0.8.2

Published by emmanueltouzery almost 6 years ago

Prelude-ts now requires typescript 3.1 or newer.

  • rename project from prelude.ts to prelude-ts (fixes #20). The old project prelude.ts is still available but deprecated.
  • add Seq.removeAll
  • in toString(), if the element does not have a toString() implementation, we fall back to JSON.stringify(). However that one can throw if the structure has cycles! Avoid the cycles now.
  • fix deprecation warning in node 0.10: was using the old 'inspect' mechanism: migrate to the new system, which is supported it seems since node 0.6 (tested with 0.8)
  • add new static function Vector.zip, LinkedList.zip, Stream.zip on top of the instance method, which can take any number of input iterables (the instance method can only zip two iterables). We now depend on typescript 3.1+
  • new test: make sure that links in the README/User Guide are working fine (are not 404 for instance)
prelude-ts -

Published by emmanueltouzery almost 6 years ago

  • fix bug #19 Option.ofNullable(0) returns None. Thanks @bwbuchanan for the report!
prelude-ts -

Published by emmanueltouzery almost 6 years ago

0.8.0 breaks API compatibility but mostly for Future and if you used lifting. The rest stays the same except for really minor changes.
With 0.8.0, prelude.ts now requires Typescript 3.0.

Future

  • add 'do notation' to Future, thanks @RPallas92
  • Futures: no more laziness, thanks @qm3ster
  • Futures: it was wrong to create new Futures in onFailure, onComplete and onSuccess. Return 'this' rather, now.
  • drop Future.orElse, introduce Future.recoverWith
  • Future: modify ofCallbackApi to take the same parameters as 'new Promise', and rename it to 'ofPromiseCtor'.
  • add Future.ofCallback (thanks @qm3ster for the suggestion)
  • add new option for Future.traverse: maxConcurrent

Everything else

  • add HashMap & HashSet .forEach()
  • some apidoc improvements
  • fix #15 [api change] Option.getOrThrow() should take Error as argument -- thanks @bwbuchanan
  • fix #12: [api change] move FunctionX.liftOption to Option.lift, FunctionX.liftNullable to Option.liftNullable, FunctionX.liftEither to Either.lift. Thanks @qm3ster for the tip for the implementation. This requires TS3.0
  • upgrade to funkia/list 2.0.16 and have the Vector using Funkia list again as a backend (we already had list for the backend of Vector in the past but had to revert it due to bugs in list in 0.7.10).
  • Add fuzzer to Seq to try to find possible bugs
  • add IMap.toJsMap & ISet.toJsSet.
prelude-ts -

Published by emmanueltouzery about 6 years ago

  • fix bug #17 -- Vector.appendAll() could crash in certain circumstances (depending on the length of the vector and the length of the iterable you would add) -- thanks @bwbuchanan for the report!
prelude-ts -

Published by emmanueltouzery about 6 years ago

  • fixes #14 Vector.map on empty vector (thanks to @bwbuchanan for reporting)
prelude-ts -

Published by emmanueltouzery about 6 years ago

  • fixes #13 -- support findAny on an empty HashMap (thanks to @bwbuchanan for reporting)
prelude-ts -

Published by emmanueltouzery about 6 years ago

Unfortunately a bug was discovered in the list library that prelude.ts depends on since version 0.7.7. So we're reverting to the Vector implementation that prelude had in version 0.7.6 which was free of that bug, until that issue is fixed.

prelude-ts -

Published by emmanueltouzery about 6 years ago

  • fix calling containsKey on an empty HashMap (thanks to @antoine-wdg-rmz)
prelude-ts -

Published by emmanueltouzery about 6 years ago

fix another brown paper bag Future.mapFailure bug

prelude-ts -

Published by emmanueltouzery about 6 years ago

  • Drop the internal Vector implementation, instead add a dependency to https://github.com/funkia/list which has a high-performance implementation. Especially append & prepend in loop should be much faster now
  • Optimize LinkedList.partition
  • Future.mapFailure was broken, fix it.
prelude-ts -

Published by emmanueltouzery over 6 years ago

With this release, prelude.ts now requires typescript 2.8.3 or newer (or plain javascript of course).

prelude-ts -

Published by emmanueltouzery over 6 years ago

  • fixes #5: add Option.try_, Option.tryNullable, Either.try_ thanks @davinkevin for the useful feedback & suggestions
  • add Option.mapNullable for a more handy workflow when working with code using null to represent failure
  • add Seq.scanLeft and Seq.scanRight
  • bugfix: LinkedList.of() and Stream.of() (without parameters) would return a list with a single item, undefined. That call was impossible in typescript (wouldn't compile) but it was possible in javascript. Now it returns an empty list as you would expect, while retaining the intended feature, that if there are parameters, the compiler knows we're dealing with a non-empty list (thanks to typescript overloads).