3 ms·
Haskell looks a heck lot like F#, even more than Ocaml if you ask me
by jcmontx 1y ago
Haskell looks a heck lot like F#, even more than Ocaml if you ask me
- gowld 1y agoPaging John Harrop... https://news.ycombinator.com/item?id=1396763 https://news.ycombinator.com/item?id=1396763
- retrac 1y agoI'd say the family resemblance is the other way around. F# was influenced by Haskell, both in syntax and semantics. Just as Haskell was influenced by early ML. Haskell and ML make up one of the major language families. They are more like each other than they are like other languages. Inspired by the lambda calculus. Strong static typing with type inference. A succinct math-like syntax that emphasizes pattern matching. Haskell goes further with syntactic sugar and tries to be almost equation-like: a = 5 f = \x -> x + 1 g x = x + 2 f $ g a SML: val a = 5 val f = fn x => x + 1 fun g x = x + 2 f (g a) But F# like Haskell makes no distinction between values and functions: let a = 5 let f = fun x -> x + 1 let g x = x + 2 f (g a) The use of indent-based blocks is another Haskell-ish influence on F#. But now we're awfully close to bikeshedding.