Free applicatives, the handle pattern, and remote systems

87 pointsposted 18 hours ago
by _jackdk_

33 Comments

rich_sasha

17 hours ago

Bellroy, the maker of quirky travel accessories and wallets, has a software stack written in Haskell?? TIL

titanomachy

16 hours ago

The second-to-last post[0] talks about how they decided to migrate their stack from Ruby on Rails to Haskell, and are now in the seventh (!) year of that migration.

[0] https://exploring-better-ways.bellroy.com/designing-for-the-...

internet_points

13 hours ago

My first thought was: does that mean they've been actively migrating for seven years, or just "we migrated the most important stuff and can't see any strong business reasons to move some of these microservices that do their job just fine"? But reading the post, it seems the main reason is they no longer understand all the Ruby code!

bobbylarrybobby

6 hours ago

I thought this couldn't be correct, but... nope:

> We adopted a pragmatic approach: maintain the Ruby code but only port functionality to Haskell when we could add meaningful value in the process. This meant our Ruby codebase gradually became legacy code, maintained but not actively developed. This transition — which we expected to take a couple of years — has now stretched into its seventh year. > > Here’s where the Clean Architecture approach began to work against us. As we hired more Haskell-focused developers and our institutional knowledge of Ruby faded, those carefully crafted abstraction layers became archaeological puzzles. Reverse-engineering what a piece of code actually did — especially complex, multi-step operations with side effects — became a nightmare.

oncallthrow

14 hours ago

Seems like an insane choice to me

bobnamob

14 hours ago

They're based in Collingwood, any Australian would tell you that an n year Haskel rewrite is the most normal thing about them

rswail

8 hours ago

Speaking as someone from there (Collingwood), we're proudly weird.

pklausler

4 hours ago

Hello from Portland, Oregon!

cosmic_quanta

9 hours ago

I'd love to hear more about why you think this is insane.

spiffytech

10 hours ago

I'm very happy with my Bellroy Card Sleeve wallet. You know, just in case anyone's checking the comments on a functional programming article for wallet recs. As one does.

PaulHoule

6 hours ago

My Bellroy wallet is great too.

nikita2206

10 hours ago

Also was surprised to see their logo on the blog website.

I have had one of their cardholders for 10 years now, it is incredible how durable and practical that thing is.

leohonexus

10 hours ago

And they even use Nix, to add to the craziness.

[0] https://flox.dev/nixinthewild/nix-in-the-wild-bellroy/

cosmic_quanta

9 hours ago

Nix isn't so exotic anymore. Every company for which I interviewed about a year ago used Nix

YuukiRey

7 hours ago

And every person I met today had a parrot on their shoulder. Doesn't really mean it applies to the general public (here meaning most developers out there).

I'd say <1% of all developers world wide have even heard of Nix.

ameliaquining

3 hours ago

It is used in production much, much more widely than Haskell is, though it remains far from the most common way to do builds or deployments.

riwsky

14 hours ago

So is Costar, the horoscope app, of all things

rich_sasha

13 hours ago

At least the product is pretty esoteric too.

chaboud

10 hours ago

I thought this was a joke about two things having the same name… nope!

One funny thing about software is that beautiful things can emerge from the most unexpected places. I appreciate that there are folks out there with the bravery to share their journey.

tinyspacewizard

8 hours ago

Weird feeling knowing that an ecommerce / wallet store has employees with more advanced programming knowledge than most financial institutions.

Joker_vD

6 hours ago

> We want to build a structure that is essentially a syntax tree of the operations we want to perform.

A-a-and so we went from programming in Haskell to creating a new DSL, with an interpreter for it in Haskell, and programming in that DSL. Which kinda begs a question: you already have a perfectly serviceable programming language (i.e. Haskell) at hand; why not just use it?

lkey

5 hours ago

Creating specialized and constrained DSLs is a common and useful pattern for folks that write Haskell (or really any FP lang that has ADTs).

cryptonector

3 hours ago

jq was originally a Haskell-coded, in-Haskell DSL.

marcosdumay

4 hours ago

I don't understand your complain. Haskell is entirely aimed at creating those small languages and interpreting them. While at the same time the compiler they have in hand implements a DSL for describing imperative programs that do not allow the kind of analysis the author is doing.

What exactly you expected them do write?

cryptonector

3 hours ago

Eh, Haskell is not "entirely" aimed at creating DSLs.

marcosdumay

2 hours ago

Ok, it's not entirely.

It's just its main differentiator. But there's way more to the language.

kqr

5 hours ago

That's what I also don't quite get. I would build it as the parsing step mapped directly over the query. I suppose their approach lets them build a tree of operations but I'm skeptical it provides all that much benefit.

munchler

2 hours ago

I love me some functional programming, and spend most of days happily immersed in F#, but when I see Haskell programmers casually discussing the lengths they’ll go to to avoid side-effects, I am always in awe. It’s like overhearing monks in the Middle Ages talking about their favorite techniques for copying the Bible by hand.

ksec

13 hours ago

I am really really surprised Bellroy could afford to hire developers for their own store. I guess they are now much bigger than I thought? I watch them grow from an unknown brand that focus on slimming your wallet in the early 10s, to now I bump into people who have actually heard of used it. Or at least seen the online ads. Pretty amazing.

I remember Gwyneth Paltrow said something along the line moving away from Shopify was the biggest mistake she made with her online shop. I think that was before Pandemic and Shopify have improved a lot since then.

Which makes me wonder if it make sense for Bellroy to continue their path.

fwlr

9 hours ago

I believe this is a case of “developers who went into the wallet business”, actually.

vjerancrnjak

7 hours ago

A recurring problem, somehow making it very easy to write code that deals with 1 thing from start. When time comes , somehow hard to write code that deals with N things.

I wonder how different the code would look if it was just written to deal with N things from the start.

I’m also not sure how far this code can go, if I have queries that depend on responses of preceding queries , how will my runAp_ give me this? It probably won’t.

always wondered where are http frameworks that just give me a batch of requests to deal with from the start.

farhanhubble

8 hours ago

I have loved their bags and mobile cases for their aesthetics and their website too and now the blog!