Dylan R. Johnston
Dylan R. Johnston
Is there anyway to iterate over the properties of the objects? `flow-io` has `UserType.props`? But the babel transformer for this runtime is super useful.
You're not missing anything obvious, the problem is that the save callback is never called on success but the job is created asynchronously. There's no way to know when the...
I think his point is the state itself is not a profunctor, a profunctor is a generic type with two generic parameters where one is contravariant, and the other is...
Actually I don't think lenses are profunctors, or at least I'm having a very hard time writing a promap definition for one. This is as close as I could get...
From the Haskell definition, ```haskell type Lens ta tb a b = forall p. Strong p => p a b -> p ta tb ``` So a lens `Lens ta...
That's what I thought, but I was unable to write the profunctor instance for Lenses above? Are you able to figure out how to write it? Or is it not...
Yep, the expanded definition is super easy to write ```ts type Lens = { get: (s: S) => A; set: (b: B, s: S) => T; }; const promap =...
Right, so with the expanded definition, promap does make a new Lens quite easily, ```typescript type Lens_ = Lens; interface Foo { foo: string; } const fooLens: Lens_ = {...
It's possible to do this in general now using `Extract` ```ts import { Prism } from 'monocle-ts' import { some, none } from 'fp-ts/lib/Option' interface A { type: 'A', foo:...
You can simplify it by agreeing to some convention in naming the discriminator ```ts const fromDiscriminatedUnion = () => (type: Type) => new Prism( union => (union.type === type ?...