You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

typeskell

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeskell

Experiment to declare typesclasses with programmatic type signatures.

0.0.6
latest
npmnpm
Version published
Maintainers
1
Created
Source

TypeSkell

Experiment to declare typesclasses with programmatic type signatures.

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 ?

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)

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).

FAQs

Package last updated on 18 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts