core-typed

2024-05-08T01:00:32.080569Z

Is typed.clojure capable of creating generators like you can from specs for use in test.check? Also, I see there is a way to auto generate types from specs would that work for most specs? Would that be equivalent to if I just wrote the types from the beginning or is there limitations with the static checks that provides? I'm just curious if I can write specs and just get static typing essentially for free from that. I'm sure its not that simple but figured i'd ask.

2024-05-08T15:47:52.433479Z

Here's a wip namespace for types->generators https://github.com/typedclojure/typedclojure/blob/main/typed/clj.checker/src/typed/clj/generators.clj

2024-05-08T15:50:07.990869Z

The spec->types conversion is not well tested, not sure where the limitations are atm.

2024-05-08T15:51:19.627579Z

I think I need to add type-level support for predicates to make it more viable. a nat-int? or even? type.