Re:Introduction to Functional Programming in OCaml
by ihodes on Sunday September 04, 2016 @03:18PM
(#12426193)
You don't need to leave monads in OCaml (in fact, I'd be very sad to not be using them regularly). Typically the Lwt, Option, and Error monad. (Also speaking as a former Clojurer).
Re:Introduction to Functional Programming in OCaml
by Scarbutt on Sunday September 04, 2016 @04:37PM
(#12426587)
Could you expand on "former Clojurer"? :)
Re:Introduction to Functional Programming in OCaml
by ihodes on Sunday September 04, 2016 @05:15PM
(#12426745)
I used to write a fair bit of Clojure, in 2009-2011, but have moved to mostly OCaml these days.
Re:Introduction to Functional Programming in OCaml
by KirinDave on Monday September 05, 2016 @07:39PM
(#12432817)
Is there a reason you didn't consider F#?
I'm contemplating similar chnages to my tool chain.
Re:Introduction to Functional Programming in OCaml
by sheepmullet on Sunday September 04, 2016 @07:05PM
(#12427170)
> I founded and help maintain a very large Clojure codebase and to be honest, I am sick to death of not having a real type system to help me.
What sort of size is the breaking point in your opinion?
I've recently made the move from f# to Clojure and I'm significantly more productive but I'm worried that when I get to larger projects (10-100kloc) I will come unstuck.
Re:Introduction to Functional Programming in OCaml
by KirinDave on Monday September 05, 2016 @07:58PM
(#12432894)
It'd be much more fruitful to talk about this directly rather than via a forum where I am rate limited. :(
If you reach out to me via email you'll probably find me. You can find that email by searching for my username on the C2 wiki. Posting it here would be troublesome.
Re:Introduction to Functional Programming in OCaml
by spion on Sunday September 04, 2016 @04:24PM
(#12426523)
What about core.typed?
Re:Introduction to Functional Programming in OCaml
by KirinDave on Sunday September 04, 2016 @05:33PM
(#12426824)
What about it?
Re:Introduction to Functional Programming in OCaml
by spion on Sunday September 04, 2016 @06:18PM
(#12426994)
I believe it qualifies as a "real type system", doesn't it?
Re:Introduction to Functional Programming in OCaml
by KirinDave on Monday September 05, 2016 @07:51PM
(#12432871)
Not really? We have a lot of options for opt-in run time verification, and then we can find new and interesting ways to break static verifiers with macros.
I don't mean to imply that core.tyoed is fictitious but I wouldn't consider it a substitute for real, pervasive static typing.
Sure, we can test the crap out of our code watching for npe's. We can lint like crazy. We can write large integration tests to better understand the larger picture better. But ultimately nothing is as pervasive as the compiler relentlessly asking you to be clear.
What's more, the benefits of a language like OCaml (where Tagged unions, GADTs, direct modeling of errors via an Either composition, etc. rule the day) on your code leads you to a really good place when the codebase is sufficiently large.
Giving up s-expressions and monads is indeed a sad thing. I'd miss it.