Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

Experiment to declare typesclasses with programmatic type signatures.

## What's new with this encoding ?
## What's new with this encoding?

The main idea is to put the effort on implementing typeclasses, and then have data implementation for free, no typing required.
The magic lies in building the correct generic variants of the typeclass automatically (programmatically).

## How ?
## How?

All the magic is done thanks to:
- a new encoding that remembers the parameters variance of a Kind (covariant, contravariant, invariant).
- a lot of meta programming like in HOTScript to builds generics functions at compille time depending on kind instance (no need to declare exponentially many functions)
- a lot of meta programming like in HOTScript to builds generics functions at compile time depending on kind instance (no need to declare exponentially many functions)

Then we let this meta-compiler (typescript itself) build the correct generic types for the typeclass at compile time.

Knowning variance allows to know if we should `&` or `|` the generic types programatically and also know what are the default values (unknown for invariants and contravariants, and never for covariants).
Knowning variance allows to know if we should `&` or `|` the generic types programatically and also know what are the default values (unknown for invariants and contravariants, and never for covariants).