Settings

Theme

From Haskell to Java: modeling your problem domain with types

lendup.com

38 points by rowborg 9 years ago · 4 comments

Reader

thedudemabry 9 years ago

Neat article! Coming from a Haskell background in my first post-college job, I also modeled several problems using Haskell types and later translated them into C++.

It felt a little silly at first, but really did help clarify my understanding of the problem domain and let me play around with composing and operating on data structures very quickly in an interactive REPL. Once I was happy with the data structures and had a good understanding of the most complicated operations over them, it was a simple task to build the analogous C++ classes.

crb002 9 years ago

I used this on a project. Had a complex business logic I rewrote from Java to Haskell so we could understand the edge cases. Worked out great. Don't be shy about using Haskell as a specification language.

tdb7893 9 years ago

It's an interesting idea, but the example is essentially an implementation of the visitor pattern so make sure that is really what you want before following suit.

nudpiedo 9 years ago

This post was really good, it proves the point of learning an esoteric language and skills for a mainstream technology. I wish I could read more posts like this one.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection