https://github.com/gnlow/curry
https://github.com/gnlow/curry
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gnlow/curry
- Owner: gnlow
- Created: 2021-09-06T05:45:17.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-06T07:42:31.000Z (almost 5 years ago)
- Last Synced: 2025-10-16T02:22:31.254Z (9 months ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# curry
Simple type library for combining functions.
```
import type { V, Eval } from "./mod.ts"
type t1 = Eval, [V<[1], 1>, V<[2, 3], 2>]> // ( (1, 2) => 3 )( (1 => 1), ((2, 3) => 2) ) == (1, 2, 3) => 3
type check1 = V<[1, 2, 3], 3> extends t1 ? true : false // true
type check2 = V<[1, 3, 3], 3> extends t1 ? true : false // false
type check3 = V<[1, 2], 3> extends t1 ? true : false // false
type check4 = V<[1, 2, 3], 4> extends t1 ? true : false // false
```
Since TypeScript doesn't have higher-order generic type([TypeScript#1213](https://github.com/microsoft/TypeScript/issues/1213)), you should copy-paste whole code to customize `V`.