Something spinning in my head since yesterday, it's known that a pure FP language can be represented as a Category where objects are types and morphisms are functions. I was always asking: what is the dual of this 'FP category' ? ... (1/n)
**⚠️ following is a brain dump 🚧**
Some recent reading on continuations gave me an idea (it's a lot handwavy but this is the best I can do 😅). In the so called FP category the `void` type (i.e. with no values) is the initial object : there's a unique function from it to every other type ... (2/n)
Nov 7, 2018 • 16 tweets • 2 min read
Wanted to share a thing about my optics lib "focused". One could assume that code like
_.person.freinds[0].name
Hides some complicated dark magic but in reality it's really simple. It all boils down to function composition, let me explain...
To start, An optic could be seen as simply a function of the form
(A => A) => (S => S)
It takes a function acting on a 'thing' (A) and turns it into a function acting on a 'bigger thing' (S)