Conal Elliott
conal.net · Personal blog · on HN since 2008
Conal Elliott writes on functional programming, functional reactive animation, and compiling Haskell to categories and parallel hardware.
What HN saysHN commenters recommend his work on functional programming and list his site among favorite personal blogs.
156HN people shared it
98linked it in comments
76stories submitted
1.0Kstory points
4 months agolast shared
2008people per year2026
Most-shared posts
- 1The C language is purely functional (2009)43 people · 273 points · first shared 2009 · 31 comments on HN
- 2Compiling to Categories11 people · 6 points · first shared 2017 · discussion on HN
- 3Can functional programming be liberated from the von Neumann paradigm? (2010)9 people · 315 points · first shared 2010 · 82 comments on HN
- 4Fran: Functional Reactive Animation (1997)9 people · 5 points · first shared 2011 · discussion on HN
- 5“Everything is a function” in Haskell? (2010)8 people · 6 points · first shared 2011 · discussion on HN
- 6Composing Reactive Animations (1998)7 people · 39 points · first shared 2012 · 1 comments on HN
- 7Compiling Haskell to Massively Parallel Hardware [pdf]6 people · 14 points · first shared 2017 · 1 comments on HN
- 8Push-pull Functional Reactive Programming (2009)5 people · 55 points · first shared 2010 · 1 comments on HN
- 9Eros5 people · first shared 2011
- 10Homepage5 people · first shared 2011
- 11Semantic Editor Combinators4 people · 24 points · first shared 2009 · discussion on HN
- 123D rendering as functional reactive programming4 people · 8 points · first shared 2009 · discussion on HN
- 13From Haskell to hardware via cartesian closed categories4 people · 2 points · first shared 2013 · discussion on HN
- 14Reimagining Matrices3 people · 4 points · first shared 2012 · discussion on HN
- 15What is automatic differentiation, and why does it work?3 people · 3 points · first shared 2009 · discussion on HN
What HN people wrote when they linked it
goostavos · 2025-02-06
Sandy Maguire wrote a fantastic book on the topic: https://leanpub.com/algebra-driven-design
You can also checkout the work of Conal Elliott: http://conal.net/
stevekrouse · 2026-07-20
https://worrydream.com
https://macwright.com/
https://www.petemillspaugh.com/
https://www.geoffreylitt.com/
https://maggieappleton.com/
https://www.robinsloan.com/
https://thesephist.com/
https://wattenberger.com/
http://conal.net/
https://www.todepond.com/
https://devonzuegel.com/
https://nadia.xyz/
https://adamwiggins.com/
http://glench.com/
https://ncase.me/
Classic from my old Haskell professor: https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the…
ackfoobar · 2025-07-22
>> FP ZIO/Cats world
> I don’t think it’s worth all the trouble
Once you see the bijection between imperative programming and imperative programming in a monad, you'll be angry for all the wasted hours.
Then again, you'll be able to understand this satire piece, so who's to say if the time was wasted.
http://conal.net/blog/posts/the-c-language-is-purely-functional
mikhailfranco · 2024-05-19
As an aside on an aside, there is also the related classic:
Conor McBride, The Derivative of a Regular Type is its Type of One-Hole Contexts
http://strictlypositive.org/diff.pdf
related to Huet's Zipper and Hinze, Paterson Finger Trees, with a huge of follow-on literature:
https://personal.cis.strath.ac.uk/conor.mcbride/Holes.pdf
https://conal.net/blog/posts/differentiation-of-higher-order-types
and numerous old posts by sigfpe (Dan Piponi), e.g.
http://blog.sigfpe.com/2008/06/blessed-mans-formula-for-holey.html
carapace · 2022-05-25
> I can teach a programmer Lambda Calculus in a few minutes and they will be able to use it for programming.
Which programmer? Bare Lambda Calculus? Wouldn't that be pretty useless?
> Not so with CT. You need to add a lot of structure to get anything close to Lambda Calculus.
I'm not sure I follow, I've heard that "the simply typed lambda-calculus is modeled by any cartesian closed category (CCC)." http://conal.net/papers/compiling-to-categories/
1MachineElf · 2022-03-24
In the same vein, my favorite troll on this topic is "The C language is purely functional" (2009) from Haskell programmer Conal Elliott's blog: http://conal.net/blog/posts/the-c-language-is-purely-functional#:~:tex…
chriswarbo · 2021-12-07
My favourite approach for this is "compiling to categories" http://conal.net/papers/compiling-to-categories
Essentially: lambda calculus (and hence functional programming) can be given many different interpretations; whilst we usually interpret it as a computer program describing some result value, we can also interpret it as a circuit description, and turn it directly into hardware.
jadyoyster · 2020-11-17
Just a side note; it is entirely false that FP cannot work for a distributed system. You could say the same for any program that's not simply a batch computation from input to output.
Luckily things like functional reactive programming exist which allow longer running programs to be written (purely) functionally. The same can be done for distributed programming.
Highly recommend this blog post if you want to learn more:
http://conal.net/blog/posts/can-functional-programming-be-liberated-fr…
JadeNB · 2020-03-12
> The great thing about compilers is they're conceptually pure functions - take an array of characters as input and produce an array of bytes as output.
While this is undoubtedly strictly true, it seems so high-level that the same could be said of essentially any programming task, with I/O suitably modelled, and so gets awfully close to "the C language is purely functional" (http://conal.net/blog/posts/the-c-language-is-purely-functional).
nextos · 2020-01-14
Just to elaborate a bit further, the first link is a talk on the following paper:
http://conal.net/papers/compiling-to-categories/compiling-to-categorie…
It's quite interesting to see how things like automatic differentiation get expressed in this framework.
seanmcdirmid · 2019-09-06
> I saw a proof of concept of something like this in Haskell a few years back, but it's amazing it see it (probably) making it into the core of a mainstream language.
Probably Conal Elliott’s work, eg in Vertigo (http://conal.net/Vertigo/, circa 2005)? There he was using it for normal computations used in pixel shading, pretty cool stuff. He is still active in this field, and has a lot of new papers that are more ML focused. I do wonder if “general” AD support will be useful for computer graphics as well as ML?
carterschonwald · 2018-12-24
Another paper on the same topic that got best paper at icfp this fall is http://conal.net/papers/essence-of-ad/
Which shows how to connect forward and reverse mode auto differentiation in a very elegant way
philzook · 2018-10-27
I've been watching this stuff with great interest for a while now. Glad to see it's getting press here. Conal also has a paper on using this approach for automatic differentiation.
https://www.youtube.com/watch?v=MmkNSsGAZhw
http://conal.net/papers/essence-of-ad/
I've been playing around with his approach. It's super cool.
http://www.philipzucker.com/reverse-mode-differentiation-is-kind-of-li…
http://www.philipzucker.com/approximating-compiling-categories-using-t…
tel · 2014-09-20
This is one of my favorite papers by Conal Elliott. It demonstrates his core technique of "denotational design via typeclass morphisms"[0] while solving some relatively tough problems around the meaning of FRP as it relates to its efficient implementation.
[0] http://conal.net/papers/type-class-morphisms
Paradigma11 · 2014-06-30
Names can change over time but here is how i recall it:
FRP is a development based on the work of conal elliott:
http://conal.net/
It's main characteristic is that there is a continuous (pull)aspect. Since many interesting domains are not predominantly continuous he and many others had to add a discrete event based component.
Rx is a stream based technology (push). Basically it is a dataflow library with modern functional programming syntactic elements. It does not have a continuous aspect and as such it is not FRP.
By treating Rx as something new we are depriving our self of the dataflow and structured programming knowledge.
vijucat · 2014-03-08
As you embark on this project, I'd like to point out the relationship between spreadsheets and Functional Reactive Programming (FRP) : each cell with a formula is what one could call purely functional (referentially transparent) in FP, and their chaining together is basically functions depending on other functions.
When you use Excel's "Trace Dependents" functionality, you're basically asking for a Call Graph!
In this sense, a spreadsheet is a tangible functional programming system. @see Conal Elliot's Eros : http://conal.net/papers/Eros/eros.pdf
I get the feeling there is a GREAT idea in this space waiting to happen, so by all means, go ahead and rock it! :-)
zohebv · 2012-08-18
Some examples
1. Purely declarative animations in a general purpose language
http://conal.net/fran/tutorial.htm
2. A recursive descent parser where you can declare your grammar as in yacc i.e. it is not a separate compiler generator but a regular library, and the code is type safe unlike yacc. The best part is that the actual library is just 2 lines of code, thanks to the magic of lazy evaluation and a powerful type system.
result v = \inp -> [(v,inp)]
p `bind` f = \inp -> concat [f v out | (v,out) <- p inp]
http://eprints.nottingham.ac.uk/237/1/monparsing.pdf
jmah · 2008-12-03
If the images on http://conal.net/pan/ are any indication, we'd best stay away (and stick to Processing http://processing.org/).
cben · 2025-12-25
Computers are not a kitchen. They are clay, they are Lego, they are jungles of imagination. It's true that our current trajectory devolves their universality to a set of discrete isolated applications == multiplexing a set of appliances on one device.
That's an economic win sure, but it's tragic if we fail to unlock more of their flexibility for "end users"! IMHO that's the biggest unsolved problems of computer science: that it takes so much professional learning to unlock the real potential (and even that fails us programmers much of the time! How frequently do you say "I'll solve it myself" and the time invested is actually worth it? In the words of Steve Krouse we've not quite solved "End-programmer Programming" yet.)
I do want FOSS to follow through and offer live inspectors for everything, but no, I no longer believe users should "learn to code" as the salvation. We're nowhere near it being worth their time, we actually went downhill on that :-( Conversational AI and "vibe using" will play a role, but that's more like "adversarial interoperability", doesn't cover what I mean either.
I want cross-app interoperability to be designed in, as something everyone'd understand users want. I want agency over app state — snapshot, fork, rewind, diff etc. I want files back (https://jenson.org/files/), and more¹. I want things like versioning and collaboration to work cross-app. I want ideas and metaphors we haven't found yet — I mean it when I call it unsolved problem…
mrkeen · 2024-04-29
> As far as I know, one can create a denotational semantics for any well-defined language. In practical terms, you could pick, say, JavaScript and do a similar representation as explained in the article: Every “non-pure function” is evaluated to a description of the state change that is caused by that function.
Yes this argument has been done before [1], so it's important not to lose sight of the real value proposition:
I want the ability to write a function which returns the same output for the same input, regardless of when/where it's called, number of threads, whether it's in a test or in prod, and so on. But I can already do that in an any programming language, so the real value here is being able to mark the function as such, and have the compiler reject me if I'm wrong.
> However, the more I look into this the less I buy into the whole “functional semantics” for side-effects argument. Immutable data is great, explicit dependencies are great, but those are about minimizing the use of side-effects, not about dressing them up.
A function with minimal side-effects is a function with side-effects [2].
> effectful computations are marked with an ! so they are easier to spot
There's two important steps that you've rolled into one. The first step is the 'functional semantics (with explicit effects)'. E.g. you take your straight-line imperative program:
html = Http.getUtf8(url); path = Path.fromStr(filename); File.writeUtf8(path, html); Stdout.line ("Wrote…
mananaysiempre · 2023-11-23
> You can replace bash with JS
Noo-ot really except in a Turing-tarpit sort of way. Like it or not, once learned (!) Bourne shell together with the traditional tools is a well-designed user interface and works even better for that than, say, Tcl[1]. Not an automation or scripting language, a user interface for all daily interaction. I would absolutely hate to manually sort through my files in JS, while in shell I can often do it faster than in a GUI file manager.
And, of course, it’s also a fairly strong contender as a programming language in the paradigm of many pipelined imperative processes—probably because that paradigm remains largely unexplored. I can only maybe name Icon as a viable competitor, and Icon’s also very nice. (Python, no matter how “inspired” it is by Icon, has traded its command of streams for more mainstream ease of use.) By comparison, the old complement of parallellized JS build tools (Gulp? Grunt? I forgot, it’s been a while) always surprised me with how awkwardly it accomplished shell-script-equivalent tasks.
To be clear, it’s not that Bourne shell is good and JS is bad. JS is a passable Fortran[2], while shell is at best a marginally functional one—there’s a reason Awk exists. But shell competes in categories that most other languages don’t even try to qualify for.
[Yes, I know about rc. I happen to think rc’s focus on one-level lists of strings (incidentally shared by Jam, an attempt at a better make) is a mistake, and more consistent…
User23 · 2021-10-16
Any imperative algorithm admits functional mathematical interpretations. While humorous, the observation that programming in C is purely functional[1] isn't wrong. Also consider, for example, that the formalism for the Turing Machine, the archetypical imperative automata, is purely functional.
More seriously, the semantics of an imperative algorithm are perhaps always best understood as mathematical functions. Predicate transformer semantics reduce verifying an imperative program to proving a first-order formula. Leslie Lamport, who most people doing so-called "formal verification"[2] know for TLA+, is also a shining light in this area of research. They are observably complementary cognitive tools for the task of writing correct programs, even if one is attracting more grants. The trick is learning to write programs that reduce to formula that can practicably be solved, automatically or not.
Granted, for many languages that first-order formula might be difficult to solve for many programs, but that doesn't change the fact that there exists a functional description of the procedure's semantics, even if the process the hardware actually executes isn't so analyzed[3]. But then that's true for Haskell too. It's just Haskell and its cousins do a comprehensive job of beating you over the head that you're reasoning about program semantics and not processes.
[1] http://conal.net/blog/posts/the-c-language-is-purely-functional
[2] Correctly it should be called automatic…
tpetricek · 2015-02-14
Can I please quote your debating which particular brand of natural spring water should be given to millions of people who are thirsty in the desert when I get a chance :-)? It is a great summary of the problem with functional programming.
As a person with academic background interested in real-world FP (using F# in my case), this is exactly why I'm not very enthusiastic about most functional programming papers that appear in conferences like ICFP - they might be solving fun problems, but I'm not convinced they are problems that actually matter if we're going to ignore the main issue.
I think interesting functional libraries that demonstrate how to apply FP to some interesting problem can help here - for example, the paper on financial DSLs (http://research.microsoft.com/en-us/um/people/simonpj/papers/financial… or the original paper on Functional Reactive Programming (http://conal.net/papers/icfp97/).
Rusky · 2011-09-08
Language innovation is tightly tied into computer science innovation. There are plenty of paradigms that are fundamentally different and quite potentially better than UNIX and LISP out there- you just need to get out of that rut.
Mozilla's language [Rust](https://www.github.com/graydon/rust/wiki) is working on static verification (using typestate) and concurrency in a C/C++ level language.
The Haskell community has several people ([Conal Elliot](http://conal.net), [Luke Palmer](http://lukepalmer.wordpress.com)) who are working on new models of functional I/O such as functional reactive programming.
There is a lot of programming language innovation in parallel/concurrent programming that's just hitting mainstream- actor model, asynchronous programming, CUDA/OpenCL, etc.
The way you talk to the machine is an extremely important part of "how to get problems solved." If you can't express something without absurd amounts of overhead, you're not going to solve the problem that way.
Peaker · 2011-03-21
I think saying that FP is bad for "manipulating state" is misleading.
FP is great at manipulating state. A pure Haskell function (State -> State) manipulates state.
What's being discussed is whether or not the state is manipulated destructively. And personally I don't see any real benefits to the destructive method, except performance issues in some cases, and arguably stylistic ones.
Returning new values instead of in-place updates may seem cumbersome before you get to know the abstractions that make it easy to use.
As an example, in Haskell, if you want to update a value deep inside multiple nested records, you do something like:
movePlayer :: (Pos -> Pos) -> GameState -> GameState
movePlayer f gs = gs { player = oldPlayer { position = f oldPos } }
where
oldPlayer = player gs
oldPos = position oldPlayer
That looks horrible, compared to something like:
gs.player.position = f(gs.player.position);
But then, if you discover the Semantic Editor Combinators abstraction (http://conal.net/blog/posts/semantic-editor-combinators/), then you can write that as:
movePlayer :: (Pos -> Pos) -> GameState -> GameState
movePlayer f = (atPlayer . atPosition) f
or just:
movePlayer = atPlayer . atPosition
Then you can use:
movePlayer (+delta)
to add delta to the position.
Now one nice thing about the return-new-value approach is that it is more composable than the destructive update approach. When you compose state…
jmstevers · 2025-04-11
this is how signals are described in the functional reactive programming world. here is the paper by the guy http://conal.net/papers/push-pull-frp/push-pull-frp.pdf
boxfire · 2024-11-04
Elliott Conal has to covered there: http://conal.net/papers/convolution/
evanjrowley · 2024-03-09
This is way over my head, but I was reminded of The C language is purely functional by Conal Elliott: http://conal.net/blog/posts/the-c-language-is-purely-functional
Pet_Ant · 2023-08-16
I’m guessing this is the reference?
http://conal.net/blog/posts/the-c-language-is-purely-functional
harveywi · 2023-03-07
Based on Conal Elliott's new formulation of two dual parsing implementations [1] using inductive regular expressions and coinductive tries, where the former corresponds to symbolic differentiation and the latter corresponds to automatic differentation, the dual statment of "parse, don't validate" might be: "Do or do not. There is no trie."
[1] http://conal.net/papers/language-derivatives/