TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Functional Programming in OCaml

258 pointsby gstipiabout 5 years ago

10 comments

mellingabout 5 years ago
ReasonML is Facebook’s OCaml for JavaScript.<p><a href="https:&#x2F;&#x2F;reasonml.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;reasonml.github.io&#x2F;</a><p>They have used it extensively:<p><a href="https:&#x2F;&#x2F;reasonml.github.io&#x2F;blog&#x2F;2017&#x2F;09&#x2F;08&#x2F;messenger-50-reason.html" rel="nofollow">https:&#x2F;&#x2F;reasonml.github.io&#x2F;blog&#x2F;2017&#x2F;09&#x2F;08&#x2F;messenger-50-reas...</a><p>With impressive results:<p>“ Messenger used to receive bugs reports on a daily basis; since the introduction of Reason, there have been a total of 10 bugs (that&#x27;s during the whole year, not per week)! *”
评论 #22409592 未加载
评论 #22409923 未加载
评论 #22412095 未加载
a-nikolaevabout 5 years ago
Very nice practical and modern textbook for OCaml. I were using it last year to teach this subject at my school. Here are my additional notes and exercises, if you are interested: <a href="https:&#x2F;&#x2F;a-nikolaev.github.io&#x2F;fp&#x2F;" rel="nofollow">https:&#x2F;&#x2F;a-nikolaev.github.io&#x2F;fp&#x2F;</a>
thelazydogsbackabout 5 years ago
I don&#x27;t know why they felt they had to mess with OCaml&#x27;s syntax - one of the nicest around AFAIC. With F#, even MS didn&#x27;t feel like they had to add extra braces and other baggage and change keywords (&quot;match&quot; to &quot;switch ()&quot;, etc.) to make C# programmers have an easier first ten minutes of transition time.
评论 #22409880 未加载
评论 #22412391 未加载
评论 #22409743 未加载
评论 #22409629 未加载
评论 #22409886 未加载
kernobleabout 5 years ago
An great course and a very good professor. I&#x27;m glad they&#x27;ve compiled the course into an ebook. It&#x27;s the only way I can think of FP, so I&#x27;m glad I can know point people to the same source I learned it from.<p>It would be quite awesome if they made it fully interactive; in the vein of several other textbooks that have been shared on HN recently.
评论 #22410566 未加载
评论 #22410373 未加载
wing328hkabout 5 years ago
If you want to access RESTful APIs via OCaml, you may consider using OpenAPI Generator to generate the OCaml client automatically instead of manually creating one. Here are 3 simple steps to do so:<p>1. Download the OpenAPI Generator CLI Java JAR (<a href="https:&#x2F;&#x2F;repo1.maven.org&#x2F;maven2&#x2F;org&#x2F;openapitools&#x2F;openapi-generator-cli&#x2F;4.2.3&#x2F;openapi-generator-cli-4.2.3.jar" rel="nofollow">https:&#x2F;&#x2F;repo1.maven.org&#x2F;maven2&#x2F;org&#x2F;openapitools&#x2F;openapi-gene...</a>)<p>2. Rename the JAR as &quot;openapi-generator-cli.jar&quot;<p>3. Run the following command to generate an OCaml API client for the Petstore API (<a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a>):<p>Mac&#x2F;Linux:<p>$ java -jar openapi-generator-cli.jar generate -g ocaml -i <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a> -o &#x2F;var&#x2F;tmp&#x2F;ocaml&#x2F;<p>Windows:<p>$ java -jar openapi-generator-cli.jar generate -g ocaml -i <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;2_0&#x2F;petstore.yaml" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-gener...</a> -o C:\tmp\ocaml<p>If you&#x27;ve any feedback or question, please let us know via <a href="https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;issues&#x2F;new" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;issues&#x2F;new</a>
nikiviabout 5 years ago
HN thread on 2019 edition: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19292067" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=19292067</a>
willtimabout 5 years ago
&gt; Java didn&#x27;t have generics until version 5 in 2004; the ML family had it in 1990.<p>I thought Standard ML had it in the 70&#x27;s (!)
评论 #22412344 未加载
amatechaabout 5 years ago
As I don&#x27;t have a lot of time to investigate at this moment - is this intended to be a generally-standalone guide that one could use to learn OCaml? I&#x27;m guessing not, since it doesn&#x27;t seem to dive in too deep into any subject, just giving a very broad overview.
评论 #22410588 未加载
评论 #22410779 未加载
devmunchiesabout 5 years ago
I haven&#x27;t used OCaml in a couple of years. has the stdlib story been improved&#x2F;standardized? is there still the whole async vs jwt problem or did jwt finally win out?<p>I think i remember that there wasn&#x27;t a good web framework, and that the existing popular one had a memory leak.<p>I was learning from a book (Real World OCaml, i think) and it kept pushing jane street libs like Async and Core.
评论 #22414442 未加载
评论 #22411490 未加载
评论 #22432013 未加载
评论 #22412041 未加载
crimsonalucardabout 5 years ago
How does OCaml compare with haskell?
评论 #22411877 未加载
评论 #22411822 未加载