Hacker News new | ask | show | jobs
by dagheti 5814 days ago
I find that F#'s (close to OCaml) type system helps me think through problems and lets me get correct programs faster, that somehow just seem to work correctly the first time.

Usually when writing a program in F# I usually write out the types of the functions I need first, before worrying about how the functions work. Because the type system is so descriptive I can validate that a plan to solve a problem is going to work before I start writing code.

Because the type system is powerful, when I need to make a change, it is simple to determine where my assumptions are broken and make the correct fixes.

1 comments

> Usually when writing a program in F# I usually write out the types of the functions I need first, before worrying about how the functions work.

And that kind of things can give rise to such wonderful tools as hoogle (a type-based Haskell search engine, specify the type you need and it'll find the matching functions, whose types are often quite good insight as to their purpose)