r/functionalprogramming • • Aug 03 '24

Question What's the benefit of learning Elixir?

47 Upvotes

I'm currently learning Haskell (and F#), but I also look around to other languages.

One language that is often mentioned is Elixir. Do I have any benefit if I learn Elixir? It is dynamically typed, but I think strong static typing is a better choice to write more robust software. But maybe I'm wrong at this point and someone can clarify that for me.


r/functionalprogramming • • Apr 23 '23

Scala Indigo - A game engine for functional programmers.

Thumbnail indigoengine.io
47 Upvotes

r/functionalprogramming • • Jul 06 '22

FP Tao: A statically-typed functional language

Thumbnail
github.com
47 Upvotes

r/functionalprogramming • • Aug 28 '26

Intro to FP Pyfun: an F#-inspired language that compiles to readable Python

46 Upvotes

Pyfun is a functional-first language for the Python ecosystem. You write algebraic data types, exhaustive matching, curried functions and pipes, and it compiles to plain Python that you can read, commit, and hand to someone who has never heard of Pyfun.

The compiler is written in Rust and everything is checked before any Python exists: types, exhaustiveness, effects, units.

Here is a whole program:

type Shape =
  | Circle float
  | Rect float float

let area s =
  match s:
    case Circle r: 3.14159 * r * r
    case Rect w h: w * h

[Circle 1.0, Rect 2.0 3.0]
|> List.map area
|> print

and here is the Python it compiles to, in full:

from dataclasses import dataclass

def _pf_map(f, xs):
    return list(map(f, xs))

@dataclass(frozen=True, repr=False)
class Circle:
    _0: float
    def __repr__(self):
        return f"Circle({self._0!r})"

@dataclass(frozen=True, repr=False)
class Rect:
    _0: float
    _1: float
    def __repr__(self):
        return f"Rect({self._0!r}, {self._1!r})"

def area(s):
    match s:
        case Circle(r):
            return 3.14159 * r * r
        case Rect(w, h):
            return w * h
        case _:
            raise RuntimeError("non-exhaustive match")

print(_pf_map(area, [Circle(1.0), Rect(2.0, 3.0)]))

A match comes out as a match. A variant comes out as a frozen dataclass. The pipeline comes out as an ordinary call. There is nothing to pip install alongside the output, and if you stop using Pyfun tomorrow you keep working Python.

Delete the Rect case and the compiler names what you missed:

error: non-exhaustive match: `Rect _ _` is not matched
 --> 6:3
  |
6 |   match s:
  |   ^^^^^^^^

Also in there:

  • Hindley-Milner inference, so there are no type annotations on let at all.

  • Inferred effects, so a function that prints or mutates gets io in its type and you can assert purity with let pure. Units of measure that reject metres + seconds and erase to plain numbers.

  • Computation expressions for async, seq, and result, plus your own builders. Opaque types. A typed extern for calling any Python library you like.

Try it in the browser, nothing to install: https://simontreanor.github.io/Pyfun/playground/

22 lessons, written for people who know some Python: https://simontreanor.github.io/Pyfun/

Source, and the compiler internals tour: https://github.com/simontreanor/Pyfun

pip install pyfun-lang

I built this because most people meet programming through Python, and then to meet functional programming they have to pick up a second ecosystem to do it. I welcome all questions, bug reports, posts about things you have made, arguments about syntax, and anything else to help improve the language for everyone.


r/functionalprogramming • • Feb 07 '25

Gleam Gleam v1.8.0 released!

Thumbnail
gleam.run
46 Upvotes

r/functionalprogramming • • Oct 12 '22

Intro to FP Monads are everywhere... Maybe that's bad?

Thumbnail
youtu.be
46 Upvotes

r/functionalprogramming • • Jul 04 '21

FP Koka: A Functional Language with Effects

Thumbnail
github.com
46 Upvotes

r/functionalprogramming • • Jun 27 '21

Haskell Unison: a new programming language with immutable content-addressable code

Thumbnail
unisonweb.org
46 Upvotes

r/functionalprogramming • • Nov 08 '19

Haskell Parse, don’t validate

Thumbnail lexi-lambda.github.io
46 Upvotes

r/functionalprogramming • • Aug 21 '19

Books Grokking Simplicity - new book on FP by Eric Normand

Thumbnail
manning.com
46 Upvotes

r/functionalprogramming • • May 24 '25

Why Algebraic Effects?

Thumbnail
antelang.org
45 Upvotes

r/functionalprogramming • • Dec 31 '20

Haskell GHC 9.0 released, supporting linear types

Thumbnail
discourse.haskell.org
45 Upvotes

r/functionalprogramming • • Dec 28 '19

FP Functional programming design patterns (2015) [video]

Thumbnail
youtube.com
45 Upvotes

r/functionalprogramming • • Jun 14 '24

λ Calculus Programming with Math | The Lambda Calculus

Thumbnail
youtube.com
44 Upvotes

r/functionalprogramming • • May 09 '23

Question What is MONAD?

44 Upvotes

The title says it all. I was trying to find some good explanations and examples of what a monad could be. Any kind of simple explanation/resources would be appreciated.

Note: I didn’t know how to flair my post since I use C.


r/functionalprogramming • • Nov 01 '21

Lisp SectorLISP Now Fits in One Sector

Thumbnail
justine.lol
44 Upvotes

r/functionalprogramming • • May 21 '20

Haskell Alejandro Serrano Mena on Why Functors and Applicatives Compose but Monads Don't

Thumbnail
youtube.com
44 Upvotes

r/functionalprogramming • • Feb 02 '20

Jobs Microsoft is hiring a developer to work on the F# compiler and tools in Prague

44 Upvotes

We're hiring an additional engineer to work on the F# compiler and tools. As per the job description, the role is defined as such:

The .NET Team is looking for an engineer to work on the F# compiler and tools, adding new language features and building the tooling to make coding in F# a joy in Visual Studio, Visual Studio Code, Visual Studio for Mac, and Visual Studio Online.

If you’re up for a fun challenge and working with a great team, the link is here: https://careers.microsoft.com/us/en/job/785811/Senior-Software-Engineer-NET-CORE-F


r/functionalprogramming • • Mar 17 '26

Intro to FP What was the point? What languages are worth exploring?

43 Upvotes

I dabbled for a bit with Haskell 8 years ago and began to make progress. Then I saw Idris and moved on, but it was a mistake. So far, Elm is the only language where learning it was a pleasure and paid off in the workplace. I dabbled with Purescript and OCaml, but those were largely disappointments. I like the idea of functional programming, but I can't stand the gap between the promises and reality. Why is debugging such a pain compared to normal languages? Why backtraces make no sense?


r/functionalprogramming • • Nov 27 '25

Books Functional Data Structures and Algorithms. A Proof Assistant Approach (book)

Thumbnail fdsa-book.net
43 Upvotes

r/functionalprogramming • • Nov 06 '22

Question Any good undergraduate-level "Algorithms and Data Structures" books that are presented in a functional style?

43 Upvotes

Pretty much every Algorithms course or book that I've come across -- even language agnostic ones that deal only in theory and pseudocode -- present this topic in an imperative style. I'm looking for a book (or course, if that exist) that would cover the same material but presented in a functional style. Any recommendations?


r/functionalprogramming • • Jul 22 '22

Question If you HAD to work on a project that primarily used object-oriented design, what functional programming patterns (if any) would you keep in your tool box?

43 Upvotes

I was introduced to functional programming recently through Rich Hickey's Simple Made Easy talk and subsequently watched a few more of his videos, as well as Scott Wlaschin's talk on Domain Modeling Made Functional. In general it's fun to learn new paradigms, but I'm also very drawn to the concepts of reducing complexity, using composable types, and idempotency.

That said, I can't (and shouldn't, given how inexperienced with it I am) impose purely functional design on a team that currently uses and understands an object-oriented approach. It seems to me it should be possible to get some of the benefits of functional programming even in an OOP environment, and I'm wondering how you all would go about that. What do you keep in your tool-box, and how do you mix these two paradigms, if you do at all? Should mixing be avoided entirely?

Thanks!


r/functionalprogramming • • Apr 03 '22

Question What developments have there been in FP over the last 10 years?

43 Upvotes

I was wondering what important new developments in FP have occured during the last 10 years or so.

Most of the well-known languages that I can think of as FP languages all date from before 2010. Scala is 2004, Clojure is 2007, OCaml is 1996, Racket is 1995 and Haskell is 1990.

Have there been major developments in immutable data structures or type systems over the last 10 years? Or maybe developments in interoperation between typed and untyped languages? Have FP languages experimented with ada-spark like contracts?

What has been the main thrust of the development of FP languages over the last 10 years?


r/functionalprogramming • • Apr 13 '21

Rust Enso 2.0 is out! Visual, purely functional, polyglot (Java, Python, R, and JavaScript) programming language. Written in Rust and GraalVM. Running in WebGL.

Thumbnail
youtube.com
43 Upvotes