Skip to content
0:00 / 0:00

#ocaml#makeillegalstatesunrepresentable#janestreet

Effective ML

Jane Street

102K subscribers • 18 videos on Hallway

YouTube
  • Recommended by 3 people: 2 on Hacker News and 1 on Lobsters.
  • Presented by Yaron Minsky, Head of Technology at Jane Street

Intermediate. Assumes working knowledge.

29K views10 years ago3 recommendations

Programming languagesSoftware designFunctional programmingDesign patternsOCaml and F#

Yaron Minsky shares practical advice on being an effective OCaml programmer in industry, introducing the concept of making invalid states impossible.

A talk given at Harvard's CS51 class in 2010 (which is taught in OCaml), with a collection of suggestions about how to be an effective ML programmer in an industrial setting

Why it's here

3 people recommend this

What people say. Highly recommended for introducing the highly influential 'make illegal states unrepresentable' programming technique.

Moments people linked to

jasimon Hacker News • Recommends

On “Book Review: A Philosophy of Software Design”

That'll be a great addition to the book. Can I also recommend Yaron Minsky's talk on OCaml, specifically the part where he talks about "making invalid states impossible": link to this video I've found this to be the single most valuable programming technique I've learnt. Richard Feldman dives deeper into the topic with a lot more examples in link

dbremneron Lobsters • Recommends

Effective ML - Yaron Minsky (2010)

chilleeon Hacker News • Recommends

On “What Made Lisp Different (2002)”

I guess the closest thing to what you want in Ocaml is modular implicits. link As far as the tradeoff, my view on types is a bit different than yours, I think. First, a quick note: > specify manually all the types of all the functions This is usually encouraged in OCaml, in the form of a .mli file. I think types can be a lot more than "compiler checked documentation that can also work as basic tests". They allow you to encode invariants that allow the compiler to check more than basic stuff. I thought this video had a good example. link to this video

u/msbicin r/ocaml • Mentions

On “What's "One Cool Thing" about OCaml? I.e. some piece of code or language concept which is more elegant or powerful in ocaml than in most or all other mainstream languages, but that could be explained to a room of unfamiliar cs majors in under five minutes?”

This is what one of the biggest users of the language has to say link to this video

marshrayon Hacker News • Mentions

On “Why Co–Star Uses Haskell”

"Make illegal states unrepresentable" is usually attributed to Yaron Minsky of Jane Street. This video shows it at 28:02. link link to this video

u/yawaraminin r/scala • Mentions

On “Simplify my pattern matching code.”

Not really a trick, but I would capture these patterns in `Criteria` methods and then interrogate them: case class Criteria(b1: Boolean, ..., b6: Boolean) { def isFoo: Boolean = Array(b1, ..., b6) forall identity def isBar: Boolean = Array(!b1, ..., b6) forall identity ... } ... if (criteria.isFoo) // do something else if (criteria.isBar) // do something ... This has the advantage that the business logic is encapsulated and not exposed. True, it's not pattern matching, but in any case you weren't getting the full benefit of pattern matching--exhaustiveness checking--because you don't care about all possible combinations of these booleans because…
2View on Reddit