This repository has been archived by the owner on May 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement Kinds interface for accumulating type substitution schemes * implement simplified (read: unindexed) type classes using generics and type inferrence to handle adts of various lengths * update all adts to register their kind and to use the new type classes (this is mostly removing now unneeded types since inferrence works very well) * start the process of updating the testing assertions
- Loading branch information
Showing
69 changed files
with
4,075 additions
and
7,038 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.vscode | ||
.vim-lsp-settings | ||
draft | ||
draft.ts | ||
bundle |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
# hkts ![Deno](https://github.com/nullpub/hkts/workflows/Deno/badge.svg?branch=master) | ||
|
||
Higher kinded types for [Deno](https://deno.land). As an avid user of [fp-ts](https://github.com/gcanti/fp-ts) I wanted to have a similarly full featured environment in Deno. Unfortunately, the fp-ts port to Deno is clunky to use with other functional libraries like [@nll/datum](https://github.com/nullpub/datum), [io-ts](https://github.com/gcanti/io-ts), and [monocle-ts](https://github.com/gcanti/monocle-ts). While I could have ported fp-ts directly, I've come to like the exploratory work done by pelotom in the original [hkts](http://github.com/pelotom/hkts). Thus, I've decided to port the functionality of fp-ts, io-ts, and monocle-ts to Deno using the HKT substitution developed by pelotom. | ||
|
||
This library is primarily an exercise, but I intend to maintain 100% test coverage. Instead of breaking out the clones of io-ts, monocle-ts, and datum into other Deno modules they will all be landed here. There will be no barrel exports as importing in Deno is much cleaner without them. Contributions are welcome. | ||
Higher kinded types for [Deno](https://deno.land). As an avid user of | ||
[fp-ts](https://github.com/gcanti/fp-ts) I wanted to have a similarly full | ||
featured environment in Deno. Unfortunately, the fp-ts port to Deno is clunky to | ||
use with other functional libraries like | ||
[@nll/datum](https://github.com/nullpub/datum), | ||
[io-ts](https://github.com/gcanti/io-ts), and | ||
[monocle-ts](https://github.com/gcanti/monocle-ts). While I could have ported | ||
fp-ts directly, I've come to like the exploratory work done by pelotom in the | ||
original [hkts](http://github.com/pelotom/hkts). Thus, I've decided to port the | ||
functionality of fp-ts, io-ts, and monocle-ts to Deno using the HKT substitution | ||
developed by pelotom. | ||
|
||
This library is primarily an exercise, but I intend to maintain 100% test | ||
coverage. Instead of breaking out the clones of io-ts, monocle-ts, and datum | ||
into other Deno modules they will all be landed here. There will be no barrel | ||
exports as importing in Deno is much cleaner without them. Contributions are | ||
welcome. | ||
|
||
## Installation | ||
|
||
This library is meant to be used with Deno, thus it follows the [Deno imports](https://deno.land/manual/examples/import_export) syntax. | ||
This library is meant to be used with Deno, thus it follows the | ||
[Deno imports](https://deno.land/manual/examples/import_export) syntax. | ||
|
||
## Conventions | ||
|
||
This library focuses first on implementing [static-land](https://github.com/fantasyland/static-land) type classes for a given Algebraic Data Type (ie. Either or Option). These type class modules are then exported from the ADT's namespace (eg. `import { Monad } from 'https://deno.land/x/hkts/option.ts'`). | ||
This library focuses first on implementing | ||
[static-land](https://github.com/fantasyland/static-land) type classes for a | ||
given Algebraic Data Type (ie. Either or Option). These type class modules are | ||
then exported from the ADT's namespace (eg. | ||
`import { Monad } from 'https://deno.land/x/hkts/option.ts'`). | ||
|
||
With the exception of instance constructors (ie. getShow or getSemigroup) other ADT functions should all be pipeable. For functions that derive from type class modules, like `chain` or `map`, there are helpers in `derivations.ts` that will generate the pipeable versions for you. | ||
With the exception of instance constructors (ie. getShow or getSemigroup) other | ||
ADT functions should all be pipeable. For functions that derive from type class | ||
modules, like `chain` or `map`, there are helpers in `derivations.ts` that will | ||
generate the pipeable versions for you. | ||
|
||
For good examples of the above conventions look at the `either.ts` or `option.ts`. | ||
For good examples of the above conventions look at the `either.ts` or | ||
`option.ts`. | ||
|
||
# Documentation | ||
|
||
For the foreseeable future this library will not focus on documentation. Questions are welcome via [github issues](https://github.com/nullpub/hkts/issues) but I can't guaruntee speedy responses. Once a decent collection of ADTs and other utilities are ported and all the pre-1.0.0 todo items in `TODO.md` are complete I'll shift to documentation. Even then it's likely that I'll auto-generate the raw docs from exported function and statement types and will devote any time to building an example library that doubles as extra tests. | ||
For the foreseeable future this library will not focus on documentation. | ||
Questions are welcome via | ||
[github issues](https://github.com/nullpub/hkts/issues) but I can't guaruntee | ||
speedy responses. Once a decent collection of ADTs and other utilities are | ||
ported and all the pre-1.0.0 todo items in `TODO.md` are complete I'll shift to | ||
documentation. Even then it's likely that I'll auto-generate the raw docs from | ||
exported function and statement types and will devote any time to building an | ||
example library that doubles as extra tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# Initial Push Todos | ||
|
||
- port monocle-ts | ||
- need to finish Traversal | ||
- implement tests for other algebraic modules | ||
- need Traversal and ChainRec still | ||
- port hyper-ts to Deno | ||
- revisit middleware structure | ||
- look into implementing MiddlewareStateEither (might require length 5 constructor) | ||
|
||
# Version 1.0.0 features | ||
|
||
- look at TODO items across codebase | ||
- curry semigroup and anything else that should be curried | ||
- work through adt by adt to add any useful missing modules | ||
- show | ||
- semigroup | ||
- ord | ||
- etc | ||
- stack safe recursion for sequence constructors | ||
- trampoline? | ||
- auto documentation (port docs-ts) | ||
- auto documentation (port docs-ts?) | ||
- just use deno docs | ||
- spend a week on examples and introduction posts | ||
- work with tmueller? | ||
- consider migrating from const arrows to functions | ||
- TESTS! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.