What Languages Combine Functional Programming with Object-Oriented Programming?

August 18, 2026 4 answers
Asked by lantern-keeper
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?

Answers

Sideout
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.

lantern-keeper: Thanks, Iโ€™ll look into Scala. It sounds close to what Iโ€™m trying to find.

bent axle: Kotlin also mixes object-oriented features with functional tools, although Scala generally goes further toward functional programming.

Reply to this answer
waxseal_4
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.

lantern-keeper: 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.

3 open drawers: 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.

Reply to this answer
~250 pottery shards
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.
Reply to this answer
cave.survey.team
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.

lantern-keeper: Iโ€™ve heard of both but havenโ€™t used them, so Iโ€™ll investigate them. F# sounds particularly relevant.

ferry~boarding: OCaml isnโ€™t purely functional, but it supports functional programming very well and has an object system when you need it.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions