Closed danielepolencic closed 6 years ago
TOption
is useful for type level computations that can fail, for example Sub
import { Sub, _1, _2, _3 } from 'typelevel-ts'
type A = Sub<_2, _1> // TSome<_1>
// -1 is not a Nat
type B = Sub<_2, _3> // TNone
This looks very interesting, but I'm struggling to get my head around how to use Option.
Would you be able to provide an example, please?