Purify v0.14

December 16, 2019
Not sure what purify is? Check out the Getting Started page. Not sure if you want to introduce purify as a dependency to your project? Check out the FAQ page!

New Codec module

Purify now has a JSON validation/deserialization module called Codec. It's inspired by JSON decoders and encoders from Elm and various TypeScript libraries like io-ts and runtypes.
Check it out!

New, optimized build

In 0.13.1, the build target was changed to "es5" to support IE11 and other older browsers.
To balance out all of the regressions that resulted from this (bigger bundle, slower performance) GitHub user imcotton added an ES6 build
which you can now use as of 0.14 if your project runs on the server or you don't care about browser compatibility.
//Before
import { Either } from 'purify-ts/Either'

//After
import { Either } from 'purify-ts/es/Either'
The new "es" build is 30% smaller and hopefully a little bit faster.

A lot of improvements to this site

Although this is not related to the update, this website received a lot of typo/stylistic fixes, examples and notes added, and some embarrassing copy-paste errors were removed.

Other changes

  • The implementation of Either.lefts and Either.rights was refactored
  • The Just constructor now returns the correct type (Maybe<T>) instead of Just<T>
  • Added a .prettierrc file to the repository for consistency across contributions