cl-algebraic-data-type
cl-algebraic-data-type copied to clipboard
Algebraic data types in Common Lisp
``` (defdata bool true false) (defdata (fuzzy-bool :include bool) (fuzzy (real (0) (1)))) (typep (fuzzy 0.1) 'bool) ;; => T (typep true 'fuzzy-bool) ;; => NIL ``` Is this really...
Daniel K says that CCL uses slot names to determine things, and those aren't saveable. We should use interned symbols.
Saving the constructor types along with constructor name and arity would allow for features such as automatically deriving definitions for `Functor` (`fmap`), `Foldable` (`fold`), or what have you[0]. Either we...
There's a bug depending on when/how things are compiled/loaded. The constructor database gets blown away, or isn't updated in time, or something. This is a placeholder for an issue that...
The last commit (852a01bee427ae9e60e40234b5202ceebde5f188) breaks the library in Clozure when using nullary constructors. Because the base class does not exist when the nullary constructor is evaluated, it is implicitly assigned...
Add built-in support for the Optima pattern matching library.
Define the following ``` (defdata foo a) ``` and ``` (defdata bar a) ``` Here, `a` will still refer to that of `foo`. It should probably error instead.
This should error: ``` (adt:defdata ty (a t) b) (adt:match ty x ((a _) nil) ((b _) nil)) ```
Coalton does this library but 10x better. Coalton is much heavier-weight, but you get more out of it.