baetheus / fun

Functional programming for deno and javascript. Monads, semigroups, optics, parsers, state management, yadda yadda yadda.

Home Page:https://jsr.io/@baetheus/fun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type Extractors

baetheus opened this issue · comments

Almost every exported Kind and Type in fun could use an extraction type. The goal of this issue is:

  1. Decide on a cohesive naming design for the type level extractors.
  2. Implement type extractors for all exported types that can use it.

A type extractor looks like the following:

type MyArray<A> = readonly A[];

type ExtractMyArray<T> = T extends MyArray<infer A> ? A : never;