Skip to content

1.19.0

Compare
Choose a tag to compare
@gcanti gcanti released this 18 Jun 08:25
· 1419 commits to master since this release

The goal of this release is to make the migration to v2 easier.

Since in v2 data types are no more implemented with classes, chainable APIs will be deprecated (in v1.20.0).

As an alternative, a pipe function is provided, along with suitable data-last top level functions (one for each deprecated method).

Example

Before

import * as O from 'fp-ts/lib/Option'

O.some(1)
  .map(n => n * 2)
  .chain(n => n === 0 ? O.none : O.some(1 / n))
  .filter(n => n > 1)
  .foldL(() => 'ko', () => 'ok')

After

import * as O from 'fp-ts/lib/Option'
import { pipe } from 'fp-ts/lib/pipeable'

pipe(
  O.some(1),
  O.map(n => n * 2),
  O.chain(n === 0 ? O.none : O.some(1 / n)),
  O.filter(n => n > 1),
  O.fold(() => 'ko', () => 'ok')
)

Custom tslint rule

In order to make easier to spot all the occurrences of chainable APIs without depending on @deprecated, which would force you to migrate in one shot, a custom tslint rule is provided (@obsolete).

Configuration

Add the following lines to your tslint.json to turn the @obsolete rule on:

{
+  "rulesDirectory": ["./node_modules/fp-ts/rules"],
   "rules": {
+    "obsolete": true
   }
}
  • New Feature
    • add Eq module (@gcanti)
    • backport top level data-last functions from v2 (@gcanti)
    • backport pipeable module form v2 (@gcanti)
    • backport pipe function form v2 (@gcanti)
    • backport flow function form v2 (@gcanti)
    • Array
    • IOEither
      • add foldIO and foldIOEither (@bwlt)
    • Record
    • Map
    • Ord
      • make Ord a contravariant functor (@gcanti)
  • Bug Fix
    • fix MonadThrow definition (@gcanti)
    • TraversableWithIndex
      • fix TraverseWithIndex2 definition (@gcanti)
      • fix TraverseWithIndex2C definition (@gcanti)
  • Deprecations
    • HKT
      • deprecate URI2HKT<n> in favour of URItoKind<n> (@gcanti)
      • deprecate Type<n> in favour of Kind<n> (@gcanti)
    • deprecate Setoid in favour of Eq (@gcanti)
    • Applicative
    • Apply
      • deprecate applyFirst, use pipeable's apFirst (@gcanti)
      • deprecate applySecond, use pipeable's apSecond (@gcanti)
    • Array
      • deprecate catOptions in favour of compact (@gcanti)
      • deprecate mapOptions in favour of filterMap (@gcanti)
      • deprecate uncurried filter in favour of curried, data-last filter (@gcanti)
      • deprecate uncurried partition in favour of curried, data-last partition (@gcanti)
      • deprecate uncurried partitionMap in favour of curried, data-last partitionMap (@gcanti)
      • deprecate fold / foldL in favour of foldLeft (@gcanti)
      • deprecate foldr in favour of foldRight (@gcanti)
      • deprecate take in favour of takeLeft (@gcanti)
      • deprecate takeEnd in favour of takeRight (@gcanti)
      • deprecate takeWhile in favour of takeLeftWhile (@gcanti)
      • deprecate span in favour of spanLeft (@gcanti)
      • deprecate drop in favour of dropLeft (@gcanti)
      • deprecate dropEnd in favour of dropRight (@gcanti)
      • deprecate dropWhile in favour of dropLeftWhile (@gcanti)
      • deprecate uncurried findIndex in favour of curried, data-last findIndex (@gcanti)
      • deprecate uncurried findFirst in favour of curried, data-last findFirst (@gcanti)
      • deprecate uncurried findFirstMap in favour of curried, data-last findFirstMap (@gcanti)
      • deprecate uncurried findLast in favour of curried, data-last findLast (@gcanti)
      • deprecate uncurried findLastMap in favour of curried, data-last findLastMap (@gcanti)
      • deprecate uncurried findLastIndex in favour of curried, data-last findLastIndex (@gcanti)
      • deprecate uncurried insertAt in favour of curried, data-last insertAt (@gcanti)
      • deprecate uncurried updateAt in favour of curried, data-last updateAt (@gcanti)
      • deprecate uncurried deleteAt in favour of curried, data-last deleteAt (@gcanti)
      • deprecate uncurried modifyAt in favour of curried, data-last modifyAt (@gcanti)
      • deprecate uncurried rotate in favour of curried, data-last rotate (@gcanti)
      • deprecate uncurried chop in favour of curried, data-last chop (@gcanti)
      • deprecate split in favour of splitAt (@gcanti)
      • deprecate uncurried chunksOf in favour of curried, data-last chunksOf (@gcanti)
    • Chain
      • deprecate flatten, use pipeable's flatten (@gcanti)
    • Const
      • deprecate Const constructor in favour of make (@gcanti)
    • Contravariant
      • deprecate lift, use pipeable's contramap (@gcanti)
    • Exception module is deprecated (@gcanti)
    • Extend
      • deprecate duplicate, use pipeable's duplicate (@gcanti)
    • Foldable2v
    • Free module is deprecated (@gcanti)
    • FreeGroup module is deprecated (@gcanti)
    • function
      • deprecate Function* types, use FunctionN (@gcanti)
      • deprecate Kleisli type (@gcanti)
      • deprecate Cokleisli type (@gcanti)
      • deprecate concat function, use Array's getSemigroup (@gcanti)
      • deprecate compose function in favour of flow (@gcanti)
      • deprecate pipe function in favour of flow (@gcanti)
      • deprecate curried function (@gcanti)
      • deprecate curry function (@gcanti)
      • deprecate toString function, use Show type class (@gcanti)
      • deprecate apply function (@gcanti)
      • deprecate applyFlipped function (@gcanti)
      • deprecate constIdentity function (@gcanti)
      • deprecate phantom (@gcanti)
      • deprecate or (@gcanti)
      • deprecate and (@gcanti)
      • deprecate on (@gcanti)
      • deprecate BinaryOperator (@gcanti)
    • Functor
    • Validation
      • deprecate Validation module in favour of Either's:
    • Either
      • deprecate getCompactable, getFilterable in favour of getWitherable (@gcanti)
    • IOEither
      • deprecate right in favour of rightIO (@gcanti)
      • deprecate left in favour of leftIO (@gcanti)
      • deprecate fromLeft in favour of left2v (@gcanti)
      • add right2v (@gcanti)
    • IxIO module is deprecated (@gcanti)
    • IxMonad module is deprecated (@gcanti)
    • Map
      • deprecate insert in favour of insertAt (@gcanti)
      • deprecate remove in favour of deleteAt (@gcanti)
    • MonadThrow
    • Monoid
      • deprecate getArrayMonoid in favour of Array's getMonoid (@gcanti)
    • Monoidal module is deprecated (@gcanti)
    • NonEmptyArray
      • deprecate uncurried groupBy in favour of curried, data-last groupBy (@gcanti)
      • deprecate findFirst in favour of Array's findFirst (@gcanti)
      • deprecate findLast in favour of Array's findLast (@gcanti)
      • deprecate findIndex in favour of Array's findIndex (@gcanti)
      • deprecate findLastIndex in favour of Array's findLastIndex (@gcanti)
      • deprecate uncurried insertAt in favour of curried, data-last insertAt (@gcanti)
      • deprecate uncurried updateAt in favour of curried, data-last updateAt (@gcanti)
      • deprecate uncurried modifyAt in favour of curried, data-last modifyAt (@gcanti)
      • deprecate uncurried filter in favour of curried, data-last filter (@gcanti)
      • deprecate uncurried filterWithIndex in favour of curried, data-last filterWithIndex (@gcanti)
    • Ord
      • deprecate lessThan in favour of lt (@gcanti)
      • deprecate greaterThan in favour of gt (@gcanti)
      • deprecate lessThanOrEq in favour of leq (@gcanti)
      • deprecate greaterThanOrEq in favour of geq (@gcanti)
      • swap contramap arguments (@gcanti)
    • Pair module is deprecated (@gcanti)
    • Profunctor
    • ReaderTaskEither
      • deprecate right in favour of rightTask (@gcanti)
      • deprecate left in favour of leftTask (@gcanti)
      • deprecate fromReader in favour of rightReader (@gcanti)
      • deprecate fromIO in favour of rightIO (@gcanti)
      • deprecate fromLeft in favour of left2v (@gcanti)
      • add right2v (@gcanti)
    • Record
      • deprecate uncurried collect in favour of curried, data-last collect (@gcanti)
      • deprecate insert in favour of insertAt (@gcanti)
      • deprecate remove in favour of deleteAt (@gcanti)
      • deprecate uncurried pop in favour of curried, data-last pop (@gcanti)
      • deprecate mapWithKey in favour of mapWithIndex (@gcanti)
      • deprecate reduceWithKey in favour of reduceWithIndex (@gcanti)
      • deprecate foldMapWithKey in favour of foldMapWithIndex (@gcanti)
      • deprecate foldrWithKey in favour of reduceRightWithIndex (@gcanti)
      • deprecate traverseWithKey in favour of traverseWithIndex (@gcanti)
      • deprecate traverse in favour of traverse2v (@gcanti)
      • deprecate uncurried filterWithIndex in favour of curried, data-last filterWithIndex (@gcanti)
      • deprecate uncurried partitionMap in favour of curried, data-last partitionMap (@gcanti)
      • deprecate uncurried partition in favour of curried, data-last partition (@gcanti)
      • deprecate wither in favour of record.wither (@gcanti)
      • deprecate wilt in favour of record.wilt (@gcanti)
      • deprecate uncurried filterMap in favour of curried, data-last filterMap (@gcanti)
      • deprecate uncurried partitionMapWithKey in favour of curried, data-last partitionMapWithIndex (@gcanti)
      • deprecate uncurried partitionWithKey in favour of curried, data-last partitionWithIndex (@gcanti)
      • deprecate uncurried filterMapWithKey in favour of curried, data-last filterMapWithIndex (@gcanti)
      • deprecate uncurried filter in favour of curried, data-last filter (@gcanti)
      • deprecate uncurried map in favour of curried, data-last map (@gcanti)
      • deprecate uncurried foldMap in favour of curried, data-last foldMap (@gcanti)
      • deprecate foldr in favour of reduceRight (@gcanti)
    • StrMap module is deprecated (@gcanti)
    • Task
      • deprecate delay in favour of delay2v (@gcanti)
    • TaskEither
      • deprecate right in favour of rightTask (@gcanti)
      • deprecate left in favour of leftTask (@gcanti)
      • deprecate fromIO in favour of rightIO (@gcanti)
      • deprecate fromLeft in favour of left2v (@gcanti)
      • add right2v (@gcanti)
    • These
      • deprecate this_ in favour of left (@gcanti)
      • deprecate that in favour of right (@gcanti)
      • deprecate fromThese in favour of toTuple (@gcanti)
      • deprecate theseLeft in favour of getLeft (@gcanti)
      • deprecate theseRight in favour of getRight (@gcanti)
      • deprecate isThis in favour of isLeft (@gcanti)
      • deprecate isThat in favour of isRight (@gcanti)
      • deprecate thisOrBoth in favour of leftOrBoth (@gcanti)
      • deprecate thatOrBoth in favour of rightOrBoth (@gcanti)
      • deprecate theseThis in favour of getLeftOnly (@gcanti)
      • deprecate theseThat in favour of getRightOnly (@gcanti)
    • Trace module is deprecated (@gcanti)
    • Validation module is deprecated, use Either's getValidation (@gcanti)
    • Writer
      • deprecate listens in favour of listens2v (@gcanti)
      • deprecate censor in favour of censor2v (@gcanti)
    • Zipper module is deprecated (@gcanti)