r/functionalprogramming • • Sep 02 '20

Training MIT 18.S097: Programming with Categories (MIT course with notes, videos, and more)

Thumbnail
brendanfong.com
74 Upvotes

r/functionalprogramming • • Mar 30 '25

Question Is excel functional programming?

72 Upvotes

Additionally, is it also declarative?


r/functionalprogramming • • Apr 06 '24

Question Why do people react consistently negatively to functional programming?

72 Upvotes

My sample of other developers from across multiple companies gives a homogeneous picture: People are virtually allergic to FP concepts. If you simply use `map` in e.g. Python, people get irritated. If you use `partial` they almost start calling you names. If you use `lift` to make mappings composable... that PR is never gonna make it.

This allergic reaction pattern is incredibly consistent. I wonder why. I can't figure out why. What is so incredibly more comfortable about writing loops etc. and re-inventing the wheel every time with spelled out, low level code, rather than cleanly composing code on higher level with some functional helper functions. What is so infuriating about the most innocent dialectical FP influences, like the ones mentioned. It is not like I am using Monads are other "scary, nerdy" concepts.

For context: I am always very particular about nicely readable, expressive, "prose-like, speaking" code. So by using dialectical FP elements, code in question generally becomes more readable, IF you take the few minutes to look into the definition of the occasional new high-level helper function that you come across in my code, which are in total maybe 10 of these helper functions (map, filter, take, reduce, drop, first, second, ... the usual).

Have you had that experience as well? I have been thinking of switching to a functional development studio with the next job change, just because I don't feel like putting up with this close mindedness of programming dialect anymore.


r/functionalprogramming • • Mar 28 '24

Question Python for functional programmers

72 Upvotes

Yes, you read the title right. While there’s a myriad of posts about getting into pure functional programming from a more imperative background, going the other way is (understandably) less popular.

What do you do when you’ve started thinking in monoids, algebraic datatypes, typeclasses, functors, but need to write Python during the day?

I work as a physicist/engineer in a big company, most of the daily computational work is being done in python, matlab, some julia, often excel. My background is not in CS, programming is mostly seen as a means to an end. Getting evangelic about Haskell is a no-no, but currently it feels painful to work in a dynamic language like python without the nice correctness stuff that you can get with immutability, total functions over sum types, and strict typing in general. I would love to at some point be able to replicate the “domain modeling made functional” style propagated by Wlaschin, but in my daily work.

How do you apply your functional knowledge to everyday programming? Any suggestions are welcome, tooling, books, “look at this repo for a good example”.

It’s possible that I just haven’t been exposed to the “right” kind of OOP, learning Haskell was the first time I studied a language from the fundamentals. In contrast, my Python skills just started out with doing numpy/matplotlib stuff and getting incrementally better at it over time. If the answer is that I need to properly learn python, do you have any recommendations?

Thank you!


r/functionalprogramming • • Oct 03 '19

FP xkcd: College Athletes

Thumbnail
xkcd.com
72 Upvotes

r/functionalprogramming • • Mar 29 '22

TypeScript How to Write TypeScript Like a Haskeller

Thumbnail
serokell.io
70 Upvotes

r/functionalprogramming • • Jul 20 '20

Free Haskell Conference With a Excellent Line-Up!

Thumbnail
haskell.love
70 Upvotes

r/functionalprogramming • • Sep 28 '18

OCaml Jane Street is giving out swag uniquely relevant to my interests at ICFP’18

Post image
70 Upvotes

r/functionalprogramming • • Dec 09 '23

Question Which functional programming language has the best build system/tooling?

69 Upvotes

By build system, I mean something like Haskell's Stack or Cabal. By tooling, I mean IDEs or language servers.


r/functionalprogramming • • Aug 24 '22

Question Should I pick up OCaml or Haskell?

68 Upvotes

I used to program a lot in Scala, but recently I have been doing mostly client-side development in Elm. I tried to go back to Scala but low-key hated how complicated everything is, how slow the compiler is, and how much memory it hogs on my dev machine (I can barely develop with 8GB RAM).

I'd like to switch to a language that's more like Elm: simple, delightful, and functional. I am familiar enough with FP from Elm and Scala. I am looking to get productive as fast as possible, as in actually output services that run as a web server using 3rd party libraries and a build tool as opposed to spending a lot of time with simple scripts. Which should I go with?


r/functionalprogramming • • Jun 21 '21

Question What would you consider to be the best "popular" language for FP?

68 Upvotes

Although I love functional programming, (Haskell made me not drop out because it showed me what programming can be) but I am quite aware it's very niche in terms of the job market, at least where I live. I do a lot of ML and AI with Python and in general, I just find anything that even broaches FP in Python to be ridiculously awkward and unwieldy.

I've seen some stuff with JS and TS and FP looks a lot nicer in that than Python. What would you consider the best "popular" language for FP? In a way I feel like the answer may be Scala just for the JVM


r/functionalprogramming • • Oct 21 '25

Intro to FP Why Elm is the Best Way for React Developers to Learn Real Functional Programming

Thumbnail
cekrem.github.io
67 Upvotes

r/functionalprogramming • • Jan 28 '26

FP I Am Not a Functional Programmer

Thumbnail
blog.daniel-beskin.com
66 Upvotes

r/functionalprogramming • • Feb 29 '24

Question Are "mainstream" languages dead?

65 Upvotes

I want to know what new languages are currently developed in the last few years, that have the potential to become at least some importance.

Because all new languages from the last years I know of have lots of things in common:

  1. No "Null"

  2. No OOP (or at least just a tiny subset)

  3. Immutability by default

  4. Discriminated Unions (or similar concept)

  5. Statically typed

  6. Type inference

  7. No exceptions for error handling

All newer languages I know have at least a subset of these properties like:

Rust Gleam Roc Nim Zig

Just to name a few I have in mind

In my opinion programming languages, both mainstream and new, are moving more and more towards more declarative/functional style. Even mainstream languages like C++, C# or Java add more and more functional features (but it's ugly and not really useful). Do traditional languages have any future?

In my opinion: no. Even Rust is just an intermediate step to functional first languages.

Are there any new (serious) languages that don't follow this trend?


r/functionalprogramming • • May 31 '20

Haskell Making Music with Haskell From Scratch

Thumbnail
youtube.com
65 Upvotes

r/functionalprogramming • • Mar 31 '25

FP Functors, Applicatives, and Monads: Unboxing Functional Programming Concepts

Thumbnail
thecoder.cafe
63 Upvotes

r/functionalprogramming • • Mar 09 '25

Gleam Gleam v1.9.0 released

Thumbnail
gleam.run
63 Upvotes

r/functionalprogramming • • Aug 12 '24

Data Structures Purely Functional Data Structures: Linked Lists

Thumbnail
youtu.be
62 Upvotes

Hey, sorry for the shameless self promotion—I’m trying to start a series on persistent data structures.

My idea is to go through different books on functional programming ideas and (hopefully) turn them into videos more digestible for beginners.


r/functionalprogramming • • Feb 17 '20

Haskell What I Wish I Knew When Learning Haskell 2.5 ( Stephen Diehl )

Thumbnail
dev.stephendiehl.com
62 Upvotes

r/functionalprogramming • • Jul 19 '19

Java Java Stream Busted

Post image
61 Upvotes

r/functionalprogramming • • Sep 26 '25

FP First impressions of the Koka language

60 Upvotes

I’ve been looking at Koka, an experimental functional language that’s one of several exploring algebraic effects as an alternative to monads. Overall, it’s really interesting, and I recommend checking out the big picture ideas: https://koka-lang.github.io/koka/doc/book.html#why  I thought I'd post my own (long-winded) first impressions here, in case anyone is interested in engaging on the topic.

Strengths:

  1. From among the experimental new functional languages built with algebraic effects as a defining feature, I think the only more mature one is Unison. Compared to Unison (which has other unique features), Koka provides nicer syntactic sugar to support effect handling. Overall the syntax is very clean and straightforward, even when you are doing complex things (e.g., something like Haskell do statements). One notable strength of algebraic effects is that they can be composed far more easily than monads (no need for something like monad transformers), and it's kind of amazing how simple the Koka syntax is to support this.

  2. Koka shares a couple interesting ideas with two other languages that interest me, Swift and Lean: (a) types can be used as namespaces, and (b) you can use dot-chaining to call sequences of functions. However, unlike in those other two languages, in Koka (a) and (b) are separate features. For (b), you can use the dot operator to call any function on a value that takes that value as its first argument—this is actually more similar to Nim. As for (a), namespaces are optional but can be provided when necessary to disambiguate. These features overall lead to (again) clean syntax that isn’t overly verbose, as well as an easy way to extend existing libraries with new functions that work on their types (similar to Swift, Lean, Nim, and to a certain extent OCaml, but decidedly different from Haskell).

  3. Koka does not have type classes(/traits/protocols/interfaces). However, it does have implicits, another language feature that’s getting attention these days (Scala has these, and Ocaml has talked about it; I’m sure other languages have explored these as well). This just means that you can write a function that will take any type `a` for a which there is, for example, a function called `show` with the signature `(a)` -> string`. But you don't have to pass the `show` function explicitly--the compiler will find it, even across namespaces. This provides some nice support for ad hoc polymorphism without requiring explicit conformance to type classes, etc. (However, it definitely can't support as much abstraction as type classes, or even as much as Swift protocols. If Ocaml ever implements its version of implicits, they'll be far more powerful...if it every implements them.)

  4. Koka’s compiler is designed with efficiency in mind (it uses reference counting, another newer feature found in Swift and Lean). The goal (no guarantees about how well it’s met this goal) is to run as fast as any language without manual memory management.

  5. Overall, Koka appears to have a good lsp and editor experience at present.

 

Weaknesses:

  1. Koka’s current documentation is seriously lacking. There’s an official guide https://koka-lang.github.io/koka/doc/book.html and a supplement https://koka-community.github.io/koka-docs/koka-docs.kk.html

However, neither is particularly comprehensive, and both have entire sections that are just stubs—names with no content. I think the guides could be improved noticeably even with just a day or two of effort, so I’m not sure why they are being neglected.

2) Koka, like many functional languages, allows you to create new record/struct and variant/enum types. However, there is no support for automatically generating common functions you might want for a new type (functions like ==, show, hash, etc). That is, you don't have a feature like `deriving` in Haskell/Lean (Swift can also do this, and Ocaml has a similar feature, though it depends on metaprogramming). The lsp actually can generate these functions for you in the editor (except for hash), which is nice, but obviously this clutters up the source files. Perhaps this will be addressed at a future time.

3) Despite Koka being at version 3, it seems in some respects less mature than languages that aren’t yet at version 1. Some of this may be due to Koka being an experimental language that was designed more to explore new features than to be used in production. But it’s surprising that, for example, the standard library doesn’t support sets and hash-maps, two staples of functional programming. Those types and more can be provided by the “community” standard library, but there is no current guidance on how to install a new library, given that Koka lacks a package manager or (I believe) a build system (that said, I expect it isn’t too difficult, since importing from other koka source files is quite easy).

4) My final concern is perhaps my greatest. I took a look at the github contributors page, and the results are somewhat alarming. The great majority of the work on the language has been done by a signal individual. For much of the language’s history, this individual did nearly all the work. Within the last couple years, however, another individual has gotten involved, and he seems to be making a real contribution—I also saw him answering questions on the discord. When I looked at the “community” standard library, I saw that this second individual had also done nearly all the work on that library. So at present (and throughout the language’s history), there does not seem to be any real community contributing to the language (although the language does have many stars and forks on github, indicating there's a lot of interest).

Now to be fair, that may be common for new and experimental languages—I haven’t tried comparing to other languages. But it does raise questions about the language’s long-term health. The second contributor is a graduate student, so who knows whether he’ll keep contributing after graduation, or even start a lab and recruit new students to contribute. Perhaps he’ll weigh in here—I’d be interested to hear his views on these thoughts.

Anyway, that’s all I’ve got. Much appreciation to anyone who took the time to real through all of this.


r/functionalprogramming • • May 17 '24

FP HVM2 is now production ready, and it runs on GPUs!

Thumbnail higherorderco.com
60 Upvotes

r/functionalprogramming • • Nov 25 '22

F# What's the status of F#?

60 Upvotes

I want to learn F#, but a lot of resources are about 10 years old or older. Quite a few of them no longer work.

I think F# is an interesting language, but does it worth it to learn and use?


r/functionalprogramming • • Nov 30 '19

FP Why is Learning Functional Programming So Damned Hard?

Thumbnail
medium.com
60 Upvotes