I'm interested in both functional programming and object-oriented programming and would like to explore a language that deliberately combines the two. I'm especially curious about approaches that support substantial, Haskell-like functional programming rather than merely adding lambdas or a few functional utilities to an otherwise imperative language. What languages have tried to unify these paradigms, and how do they do it?
4 Answers
OCaml and F# are strong choices. Both are primarily functional languages but include object systems, classes, and other object-oriented features. F# runs on the .NET platform, while OCaml has its own distinctive object model. They may be a better fit than trying to force a language like C# into a functional style.
OCaml isn’t purely functional, but it supports functional programming very well and has an object system when you need it.
Common Lisp is another interesting example. Its object system, CLOS, is very flexible and integrates with Lisp’s functional programming capabilities. It doesn’t enforce a purely functional style, but it demonstrates how functional techniques and object-oriented abstractions can coexist in one language.
A lot of modern languages combine ideas from both paradigms, including C#, JavaScript, TypeScript, Python, and Kotlin. They offer objects, higher-order functions, lambdas, and sometimes pattern matching. However, these languages still make mutation and imperative programming easy, so they may not provide the Haskell-level functional model you’re looking for. C# can be written in a functional style, but F# was designed around that style from the beginning.
That distinction is helpful. I’m less interested in simply having lambdas available and more interested in a language where functional programming is a central design principle.
The important thing is not to treat either paradigm as a requirement for every situation. Choose immutable data and functional composition where they help, and use objects where encapsulation or identity makes sense.
Scala is probably the clearest example. It combines classes, objects, inheritance, and interfaces with first-class functions, immutable collections, pattern matching, algebraic-style data types, and other functional features. It’s designed to let you use both styles in the same program and is also used in industry.
Thanks, I’ll look into Scala. It sounds close to what I’m trying to find.
Kotlin also mixes object-oriented features with functional tools, although Scala generally goes further toward functional programming.

I’ve heard of both but haven’t used them, so I’ll investigate them. F# sounds particularly relevant.