r/functionalprogramming • • Apr 11 '26

Question Need to the understand the connection between type theory, lambda calculus and functional programming

28 Upvotes

So i come from a automata and and languages background. I know lambda calculus to be an alternative to turing machine.

ik the basics. how we encode numbers in lambda calculus, carrying etc.

I see it's relationship with functional programming. but I don't see how type theory is related to it.

type theory from what I know is just like every object has some data type. all the operations you do should be legal (i.e. it should follow the type of the function). but this can be done in programming language. why is it always grouped / bunched with functional programming languages like Haskell and Ocaml.


r/functionalprogramming • • Sep 22 '25

Question What should I go for Haskell or OCaml?

28 Upvotes

Hi All, I have some time on my hands and decided to learn a FP language. I'm not sure which one I should go for. Haskell looks more interesting whereas OCaml has more industrial uses.


r/functionalprogramming • • Mar 01 '25

Gleam Gleam, coming from Erlang

Thumbnail
olano.dev
28 Upvotes

r/functionalprogramming • • Jan 11 '25

Question Based on your experience, what functional languages have good standard library and tooling? My issue with OCaml

28 Upvotes

I like OCaml, a great language and its tooling has made leaps when it comes to developer experience, but something that I could never put up with is having to resort to alternative standard libraries like Base and Core for basic things to the degree where it's ubiquitous. When it comes to building small utilities, one shouldn't even need to think about the package manager, yet OCaml's own community tells you certain parts of stdlib are arcane and suggest you depend on these 3rd party libraries as the back bone of everything you build.

If you experimented with multiple FP languages, how would rate them based on this?

  1. stdlib

  2. tooling

  3. ecosystem


r/functionalprogramming • • Nov 24 '24

Question Functional programming and games?

28 Upvotes

I'm writing simple top-down 2D game from scratch to deepen my understanding of applicability of functional programming and programming in general. It is very refreshing, can highly recommend.

However, I'm struggling to introduce any FP technique due to specifics of game development: huge and complex state which mutates 60 times per second with strict time limits and there is little regularity: everything can be read/changed anywhere from any part of code.

Games have lots of asynchronous/parallel processes (bullets fly, actors jump and fall) but I can't find any abstraction to simplify their management. Mutable state and updating it every tick looks like simplest and the best solution despite it is far from simple.

Does anyone have any experience/ideas applying functional concepts to games? Besides common knowledge like pure functions and using immutable structures to keep invariants.


r/functionalprogramming • • Nov 19 '24

Question Which functional or language with functional features for web dev?

28 Upvotes

I'm hesitating between Fsharp and Ocaml. I believe Fsharp has a bigger ecosystem but you have to constantly interface with libraries written in C#. Ocaml has probably worse tooling from what I heard and the ecosystem is not mature but you can write more functional code without being boggled down by impure code.


r/functionalprogramming • • Aug 15 '24

OO and FP Explaining Wadler's pretty-printer by porting it to an imperative language

Thumbnail benjamin.pizza
28 Upvotes

r/functionalprogramming • • Jul 13 '24

Question What are some current research topics in the realm of functional programming?

28 Upvotes

Hi all!

I'm a computer science student with a long-time immense interest in the field. For years, my research + development background has been in compiler design, embedded software, and operating systems; however, recently I've developed a keen interest in functional programming. Having used my favourite language (Rust) for a few years now, I started learning about some more functional concepts and discovered Haskell a while back. Since then, I've used Haskell near daily, and the things I've learnt from functional programming and using Haskell have entirely changed how I write and understand code today.

After eagerly doing research into everything I could uncover about the language - monadic design, laziness, type families, persistent data structures, continuation passing style, free monads, HFM, MTL / monadic transformers, and the like - I've started to branch out and learn more about the field, including algebraic effects, linear and affine types, dependent type theory, total functional programming, etc. Most recently I've been exploring the relationship and comparisons between algebraic effects and monads -- how algebraic effects compose more easily but cannot be used to express undelimited continuations the way monads can, and how utilising monadic transformers and / or free monads can and has been used to model algebraic effects in languages like Haskell. While exploring algebraic effects, I realised that they're relatively "new" - that is, much research into them has been done since 2010, and languages that implement native effects are ubiquitously research languages.

Reflecting on this has made me wonder: what are some of the most modern research topics concerning functional programming? What sort of pioneer research is currently being explored? Unfortunately, I'm still just starting out in university (I'm very well acquainted with computer science but I'm pursuing a degree for employment) and my university doesn't even offer programmes concerning PLT and functional programming, so I'm curious on what sorts of things are being done recently and possibly interested in giving myself a head-start on what to be teaching myself just out of personal interest for the field, and a desire to contribute :)

Thank you!


r/functionalprogramming • • Jun 18 '24

Question What do functional programmers think of kitchen sink languages like Swift?

28 Upvotes

As someone who frequently programs in Clojure for work, I recently have been enjoying exploring what alternative features compiled functional languages might offer. I spent a little while with Ocaml, and a little while longer with Haskell, and then I stumbled on Swift and was kind of amazed. It feels like a "kitchen sink" language--developers ask for features, and they toss them in there. But the result is that within Swift there is a complete functional language that offers features I've been missing elsewhere. It has first-class functions (what language doesn't, these days), immutable collections, typical list processing functions (map, filter, reduce), function composition (via method chaining, which might not be everyone's favorite approach), and pattern matching.

But beyond all that, it has a surprisingly rich type system, including protocols, which look a lot like haskell type classes to me, but are potentially more powerful with the addition of associated types. What really clinches it for me, even compared to Haskell, is how easy it is to type cast data structures between abstract types that fulfill a protocol and concrete types, thereby allowing you to recover functionality that was abstracted away. (As far as I know, in Haskell, once you've committed to an existential type, there's no way to recover the original type. Swift's approach here allows you to write code that has much of the flexibility of a dynamically typed language while benefiting from the type safety of a statically typed language. It likely isn't the most efficient approach, but I program in Clojure, so what do I care about efficiency.)

I'm not an expert on any of these compiled languages, and I don't know whether, say, Rust also offers all of these features, but I'm curious whether functional programming enthusiasts would look at a language like Swift and get excited at the possibilities, or if all its other, non-functional features are a turn off. Certainly the language is far less disciplined than a pure language like Haskell or, going in another direction, less disciplined than a syntactically simple language like Go.

There's also the fact that Swift is closely tied to the Apple ecosystem, of course. I haven't yet determined how constraining that actually is--you _can_ compile and run Swift on linux, but it's possible you'll have trouble working with some Swift packages without Apple's proprietary IDE xcode, and certainly the GUI options are far more limited.


r/functionalprogramming • • May 06 '24

Question Immutable data structures and efficiency: what am I missing?

28 Upvotes

Hello everyone! I've recently been playing around with functional programming languages (mostly lisp specifically), and I came to an interesting (I think) realization, and I want to know if I am right or if I'm missing something.

Data structures in imperative languages are normally stored in contiguous memory. This makes both access and modification O(1), but copying is O(n). But for non-contiguous memory such as linked lists, copying is O(1), but access of arbitrary elements (meaning elements other than the beginning or end) is O(n). Is it impossible to have an array-like data structure that can be copied AND accessed in constant time? If so, is immutable state therefore inherently inefficient whenever arbitrary element access is required (because either copying or access is O(n))?

I'm not trying to dunk on anyone, I'm actually curious. I have heard that imperative programming can always be more efficient than functional programming, with the tradeoff being ergonomics and safety. I'm wondering if this is what people are referring to when they say that.


r/functionalprogramming • • Apr 08 '24

Question First pure functional programming language to begin with?

28 Upvotes

I'm quite experienced in programming and recently I've been interested in purely functional programming languages, I've heard wonders about people switching from C# to F# and would like to try it out but I want to first consider other options.


r/functionalprogramming • • Jan 19 '24

Jobs Optimizing FP compiler development job (intern & full-time)

28 Upvotes

Hey all, I'm the hiring manager for a functional programming compiler job. We use Common Lisp and Coalton. Coalton is an open-source, statically typed functional programming language with eager evaluation semantics and a Haskell-like type system. We develop this language for our quantum compiler development. More info at coalton-lang.github.io.

The job is in SoCal, USA at HRL Labs. It's on-site only. Application page is here.

You're welcome to DM me, ask questions, etc.! Happy hacking. :)


r/functionalprogramming • • Mar 28 '23

Conferences Big news! LambdaConf returns Sept 16-19th and is better than ever! đŸ”¥

28 Upvotes

Join us in the Rockies for an unforgettable conference featuring thought-provoking talks, workshops, craft beer tasting, hiking, and immersive experiences that will change the way you think about software development. Grab your Early Bird Ticket: https://www.eventbrite.com/e/lambda-conf-colorado-usa-in-person-only-tickets-540887036687


r/functionalprogramming • • Mar 19 '23

TypeScript Ready to Learn Functional Programming with TypeScript? Follow My Comprehensive Course on YouTube as I Build It from Scratch!

Thumbnail
youtube.com
28 Upvotes

r/functionalprogramming • • Mar 16 '23

Conferences Call for Papers: Functional Software Architecture - FP in the Large

28 Upvotes

The first ACM SIGPLAN Workshop on "Functional Software Architecture - FP in the Large" will be held in Seattle, USA in September 2023, co-located with the ICFP conference.

Please share, and submit your best papers, experience reports, and architectural pearls on large-scale functional programming!

https://www.functional-architecture.org/events/funarch-2023/cfp/


r/functionalprogramming • • Nov 23 '22

Intro to FP Understanding Monads. A Guide for the Perplexed

Thumbnail
infoq.com
28 Upvotes

r/functionalprogramming • • Oct 19 '22

FP Trying out Unison, part 3: effects through abilities

Thumbnail
softwaremill.com
28 Upvotes

r/functionalprogramming • • Mar 09 '22

Haskell 15 Resources to Help You Learn Haskell in 2022

Thumbnail
serokell.io
28 Upvotes

r/functionalprogramming • • Jan 30 '22

Haskell Graham Hutton's Haskell courses removed from YouTube

28 Upvotes

I'd been following Graham's course for a few weeks now and really enjoying it. This morning I went to view the next in the series and they've all been taken down. I'm bummed.

Does anyone know an alternate source where these can be found?

I see from his university bio that he has a Haskell course on FutureLearn, but it's unclear to me if it's the same one I was following.


r/functionalprogramming • • Dec 24 '21

Question Best functional front-end languages?

28 Upvotes

I am a Scala functional developer for the backend and I'd like to learn frontend developer. Scala.js has large bundle sizes due to the size of the standard library, although that can be mitigated if one doesn't use the standard library. I can do a bit of React and Typescript but honestly I don't really like it at all. Besides the language itself and how nice it is to program in, I also take into consideration how easy it is to do basic things (e.g., make a beautiful/styled UI, deploy to the web, make it into a PWA, make it work easily in mobile), tooling, component libraries, and a community.

Through my Googling, I have found these options. All opinions are based off things I read, not personal experience:

  • Elm: seems super ergonomic and nice. I really like TEA (the elm architecture) as it's implicitly how I did a lot of my React stuff as well. However, I heard it's tough to debug, missing core features (WebSockets, local storage, service workers) and that its community support model is weird as of 0.19.

  • ReasonML: has a great community and would be a good line on my resume when I retire and join Jane Street. Also apparently has great debugging. But, it looks a bit too close to JS/React, in that it has some nice functional elements like union types but still basically uses React and that model of a front-end as opposed to TEA/MVU that I like

  • PureScript: my favorite based purely on what the language looks like, but I am concerned that the community seems more backend-heavy and creating a front-end doesn't seem to be that first class/out of the box. It's not clear that it's easy and painless to make a front-end that will just work and where I don't have to spend tons of time configuring it to run on many platforms/do PWA things.

  • Dart/Flutter: if the language itself weren't so OO and had ADTs and union types, it would be a no brainer. Seems like creating beautiful UIs that can run anywhere is all the focus it has and the community seems great. Wondering if I can make the actual development experience tolerably functional by using either bloc or dartea. I am a bit concerned about the long-term support of the latter though.


r/functionalprogramming • • Oct 29 '21

FP From Whitespace to Idris: Interview With Edwin Brady

Thumbnail
youtube.com
28 Upvotes

r/functionalprogramming • • May 25 '21

Scala Programming with Functions #7: Expressions over statements

Thumbnail
youtu.be
28 Upvotes

r/functionalprogramming • • Apr 14 '21

Lisp Should I Learn Lisp Or Haskell (Or Something Else)?

28 Upvotes

Before I start, please note that I am NOT asking which is better. I don't believe either is "better," they both have their strengths and (presumably) weaknesses. I'm asking which you think would be better for me to learn, given my situation.

So, with that out of the way, here is the picture. My day job involves writing desktop aps and web sites using C#. That's highly unlikely to change, so any thoughts of learning another language here are not career-oriented. Therefore, neither the practicality of producing commercial apps in a language, nor the chances of getting a job using that language are of relevance.

My main interests here are entertainment and education. I am interested in learning something different from C#, as I enjoy learning, and want to stimulate my mind. I have also heard from many people that learning Lisp or Haskell will make you a better programmer, even if you don't use the languages.

However, I'm not sure which of the two would be better, and am looking for some suggestions. I have been leaning towards functional programming for some years, but am only partly there. I use the LanguageExt Nuget package, which allows you to do pretty functional stuff in C#, and think that one of these languages (Haskell in particular, as it seems very pure, unlike Lisp which seems a little more multi-paradigm) would help concentrate my mind into thinking in an FP way.

Obviously, if you feel that a different language altogether would be of benefit, please feel free to suggest it.

Any comments? Thanks in advance.


r/functionalprogramming • • Mar 17 '21

Scala What is a Monad​? In 60 seconds!

Thumbnail
youtube.com
28 Upvotes