fp-ts
fp-ts copied to clipboard
Examples for deprecated after version 2.10
trafficstars
📖 Documentation
I have a few deprecated implementations after upgrading to 2.10 but cant seem to find examples on how to upgrade. Would appreciate if I could get some examples to see how
export function concatIOQueries(queries: io.IO<string>[]): io.IO<string> {
return monoid.fold(io.getMonoid<string>(monoid.monoidString))(queries)
}
export function concatIOQuery(head: io.IO<string>, tail: io.IO<string>): io.IO<string> {
return io.getSemigroup(semigroup.semigroupString).concat(head, tail)
}
export function concatEitherQuery(head: either.Either<Error, string>, tail: either.Either<Error, string>):
either.Either<Error, string> {
return either.getApplySemigroup<Error, string>(semigroup.semigroupString).concat(head, tail)
}
export function concatEitherQueries(queries: either.Either<Error, string>[]): either.Either<Error, string> {
return monoid.fold(either.getApplyMonoid<Error, string>(monoid.monoidString))(queries)
}
export const equalStringFieldValue:(field:string) => eq.Eq<any> = field => eq.getStructEq({ [field]: eq.eqString} );
## this is now eroounous
export const orderByStringValue = (field:string) => array.sort(ord.contramap(ord.ordString, (row:any) => row[field] as string))
@paulvitic you can find some help (and links) in the documentation, so for example:
monoid.fold: "UseconcatAllinstead" (https://gcanti.github.io/fp-ts/modules/Monoid.ts.html#fold)io.getMonoid: "UsegetApplicativeMonoidinstead" (https://gcanti.github.io/fp-ts/modules/IO.ts.html#getmonoid)
etc...
p.s. If you find some missing infos/links please let me know, I'll fix asap
I also thing things like monoid.monoidString have been moved to their own module, so import { Monoid } from 'fp-ts/string'