I'd love to see clojure.spec expressed as Haskell types
aren't both Turing-complete? Though of course there is a huge difference between affordance and possibility.
-
-
so perhaps some things that you wouldn't express in Haskell types?
-
There's a lot of dependent type stuff that, in practice, people don't use.
-
The more sophisticated the type, the harder the proof.

-
I found ranges on ints what about enforcing even or odd?
-
Let's take Even as an example. Step one: define it as a newtype of int.
-
2) Add methods that respect the Even-ness. 3) Expose a single factory method int -> Maybe Even
-
This gets you pretty good guarantees that things are Even within Even world and has a runtime gatekeeper
-
Ofc, spec looks more like refinement types, for which there's a project called Liquid Haskell.
- 6 more replies
New conversation -
-
-
and I'm not trolling. I don't know either well enough but I'm trying to understand the trade offs
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.


