B
Brian McKenna
brianmckenna.org · Personal blog · on HN since 2010
Brian McKenna writes about functional programming, type systems, category theory, and Scala and JavaScript tooling.
What HN saysCommenters cite his posts as clear explanations of row polymorphism, promises and category theory, and call his type annotation post a great read.
32HN people shared it
8linked it in comments
35stories submitted
518story points
1 year agolast shared
2010people per year2026
Most-shared posts
- 1How to stop functional programming4 people · 339 points · first shared 2016 · 122 comments on HN
- 2Row Polymorphism Isn't Subtyping4 people · 5 points · first shared 2013 · discussion on HN
- 3Odd Odd Even Proof in Agda3 people · 42 points · first shared 2013 · 2 comments on HN
- 4Category Theory for Promises/A+3 people · 7 points · first shared 2013 · 1 comments on HN
- 5Polymorphic Programming3 people · 2 points · first shared 2018 · discussion on HN
- 6Read-only Guest tmux Sessions2 people · 4 points · first shared 2025 · discussion on HN
- 7Architecture diagrams should be code2 people · 3 points · first shared 2023 · discussion on HN
- 8Types in JavaScript2 people · 2 points · first shared 2012 · discussion on HN
- 9Type annotation cofree2 people · first shared 2017
- 10Escaping Callback Hell with ClojureScript macros1 people · 53 points · first shared 2011 · 4 comments on HN
- 11S-expression Compiler in Scala1 people · 25 points · first shared 2011 · 5 comments on HN
- 12WebGL for node.js1 people · 6 points · first shared 2010 · discussion on HN
- 13Haskell on Heroku1 people · 5 points · first shared 2012 · discussion on HN
- 14bilby.js - Serious functional programming library for JavaScript1 people · 3 points · first shared 2012 · 1 comments on HN
- 15Tool Subsumption and Silver Bullets1 people · 3 points · first shared 2017 · discussion on HN
What HN people wrote when they linked it
efnx · 2025-03-18
From the abstract it sounds a bit like https://brianmckenna.org/blog/type_annotation_cofree, which is a great read.
pufuwozu · 2011-05-04
I wrote a small tutorial on manually setting up Android with Scala:
http://brianmckenna.org/blog/minimalist_android_scala_env
Enabling ProGuard is done by adding the following to build.xml:
<target name="-debug-obfuscation-check">
<property name="proguard.enabled" value="true" />
<path id="out.dex.jar.input.ref" />
</target>
Also add "proguard.config=proguard.cfg" to default.properties and "-dontwarn" to proguard.cfg.
cstrahan · 2023-07-17
That made me chuckle.
For those not familiar with the promise design controversy:
http://brianmckenna.org/blog/category_theory_promisesaplus
https://github.com/promises-aplus/constructor-spec/issues/24
https://github.com/promises-aplus/promises-spec/issues/94
glibgil · 2018-03-17
Some languages use polymorphic row types and eschew inheritance
https://brianmckenna.org/blog/row_polymorphism_isnt_subtyping
https://www.reddit.com/r/types/comments/73lg05/comment/dnt7q5p
https://noamlewis.wordpress.com/2015/01/20/introducing-sjs-a-type-infe…
https://github.com/purescript/documentation/blob/master/language/Types…
BalinKing · 2018-01-12
I read about isomorf yesterday... it might be kinda like what you're looking for?
Possibly relevant blog post from Brian McKenna, too: https://brianmckenna.org/blog/polymorphic_programming
[1] https://isomorf.io/
coolsunglasses · 2017-04-15
>2. Tail recursion doesn't really make much of a difference for walking trees, which is recursive, but (mostly) not tail recursive.
Non-strictness helps here more than TCO in a strict language.
>4. ADTs can be good or bad for describing ASTs. Once you enrich ASTs with semantics shared by all variants (such as source coordinates), inheritance can become a better fit than ADTs.
Since this article was written we have better ways of augmenting/annotating ASTs. There's a lot of this out there, but here's one example: https://brianmckenna.org/blog/type_annotation_cofree
There are other alternatives that are like inheritance but with better reasoning properties as well. Finally tagless comes to mind.
>I also generally find it better to explicitly annotate functions with types.
This Haskeller whole-heartedly agrees for all the reasons stated.
juliangamble · 2013-12-15
If you're interested in Agda Proofs - this is a well written post by Brian McKenna demonstrating that the sum of two odd numbers is always even.
http://brianmckenna.org/blog/plus_equals_even_take_2
splintercell · 2017-09-19
With all due respect, I don't think you understand the purpose of currying and partial application. In your defense, the article merely explains what currying is, but does not explain why you need it.
For instance while writing functional Javascript code, I never curry my methods, instead I use helper methods from functional libraries such as lodash or Ramda to curry.
Where currying is useful is in cases like this:
```javascript
//Definitions
const filterUsers = (fieldName, value, users) => //Implementation
const sortUsersBy = (fieldName, users) => //Implementation
const takeUsers = (count, users) => //Implementation
//Without currying
UserService
.getUsers()
.then(users => filterUsers('active', true, users))
.then(users => sortUsersBy('age', users))
.then(users => takeUsers(3, users));
//If these methods were curried
UserService
.getUsers()
.then(filterUsers('active', true))
.then(sortUsersBy('age'))
.then(takeUsers(3));
```
Here is a video which explains proper uses of currying (and does it very well) [1]. Here is another article if your coworker start using functional programming and you want to stop them [2].
1. https://www.youtube.com/watch?v=m3svKOdZijA
2. https://brianmckenna.org/blog/howtostopfp