Hi Ryan Lee
thanks for answering. I have done some investigation since and also addressed the same in fp-ts issues 1606 because Giulio Canti's examples also imported from /lib.
According to my own experiments and the comments on the issue above, the tree shakable import is without /lib, because /lib references the CJS version of the code.
Hi Ryan, I am really enjoying your series of articles about fp-ts. The pragmatic approach and real life usecases help a lot.
I'd like to give the following feedback and would be interested to see your views on that:
fp-ts/lib/, but that one is the commonjs version. Wouldn't it be more flexible to import fromfp-tsinstead and rely on themainandmoduleentry point in thepackage.jsonforfp-tsto locate the best version, e.g.import * as A from 'fp-ts/Array' import { pipe } from 'fp-ts/function' ...pipeexamples you chose a version of the operators that accepts the array as a parameter. This looks a bit asymmetric to the subsequent operators that use the raw transformer function. I wonder why you chose this style instead of e.g.import * as A from 'fp-ts/Array' import { pipe } from 'fp-ts/function' const foo = [1, 2, 3, 4, 5] const sum = pipe( foo, A.map((x) => x - 1), A.filter((x) => x % 2 === 0), A.reduce(0, (prev, next) => prev + next), ) console.log(sum) // 6-