write interfaces for algebras #4

Open
opened 2025-04-01 04:52:25 +02:00 by rowan · 1 comment
Owner

to ensure algebraic lawfulness, structures should implement against common interfaces (Functor, Plus, Foldable, etc)

challenges
jsdoc/typescript is Not Good at this kind of thing. there is no higher kinded type support. with the way kojima is currently implemented (closures around anonymous functions and cached functions), jsdoc seemingly has no easy way of documenting them. implements and extends only apply to structures decorated with class which means that if it's not called with new, jsdoc will get upset

to ensure algebraic lawfulness, structures should implement against common interfaces (Functor, Plus, Foldable, etc) challenges jsdoc/typescript is Not Good at this kind of thing. there is no higher kinded type support. with the way kojima is currently implemented (closures around anonymous functions and cached functions), jsdoc seemingly has no easy way of documenting them. `implements` and `extends` *only* apply to structures decorated with `class` which means that if it's not called with `new`, jsdoc will get upset
Author
Owner

this may involve a full conversion to typescript which i'm not willing to do. features like declaration merging are only supported if the declarations fully live within jsdoc or typescript. this might be worth it if TS had first class HKT support, but right now it's hacky and hard to read which isn't much better than the solution kojima has right now.

this may involve a full conversion to typescript which i'm not willing to do. features like declaration merging are only supported if the declarations fully live within jsdoc or typescript. this might be worth it if TS had first class HKT support, but right now it's hacky and hard to read which isn't much better than the solution kojima has right now.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: rowan/kojima#4
No description provided.