8 ms·
Free applicatives, the handle pattern, and remote systems
- rich_sasha 1y agoBellroy, the maker of quirky travel accessories and wallets, has a software stack written in Haskell?? TIL
- titanomachy 1y agoThe 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-different-stages-of-a-systems-life.html https://exploring-better-ways.bellroy.com/designing-for-the-...
- oncallthrow 1y agoSeems like an insane choice to me
- bobnamob 1y agoThey're based in Collingwood, any Australian would tell you that an n year Haskel rewrite is the most normal thing about them
- cosmic_quanta 1y agoI'd love to hear more about why you think this is insane.
- internet_points 1y agoMy 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 1y agoI 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.
- riwsky 1y agoSo is Costar, the horoscope app, of all things
- rich_sasha 1y agoAt least the product is pretty esoteric too.
- throwthrow0987 1y agoThey must be making a lot of money!
- nikita2206 1y agoAlso 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.
- spiffytech 1y agoI'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 1y agoMy Bellroy wallet is great too.
- leohonexus 1y agoAnd they even use Nix, to add to the craziness. [0] https://flox.dev/nixinthewild/nix-in-the-wild-bellroy/ https://flox.dev/nixinthewild/nix-in-the-wild-bellroy/
- cosmic_quanta 1y agoNix isn't so exotic anymore. Every company for which I interviewed about a year ago used Nix
- YuukiRey 1y agoAnd 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 1y agoIt 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.
- chaboud 1y agoI 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.
- ksec 1y agoI 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 1y agoI believe this is a case of “developers who went into the wallet business”, actually.
- farhanhubble 1y agoI have loved their bags and mobile cases for their aesthetics and their website too and now the blog!
- tinyspacewizard 1y agoWeird feeling knowing that an ecommerce / wallet store has employees with more advanced programming knowledge than most financial institutions.
- vjerancrnjak 1y agoA 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.
- _jackdk_ 1y ago> I have queries that depend on responses of preceding queries , how will my runAp_ give me this? It probably won’t. It definitely won't, which is what I was trying to get at with the discussion of monads and data dependencies. Applicatives by definition cannot have one "effectful" computation depend on the result of another. You could do a large bunch of parallel work until you need to pass a result into a function that decides what additional work to perform, at which point you need a monad. More advanced frameworks like Haxl apparently make this distinction explicit, so your computation proceeds as a sequence of batched parallel options, combining as much work as possible.
- vjerancrnjak 1y agoI guess we just need pipelining systems that batch. These patterns constantly appear yet we continue writing code step by step.
- Joker_vD 1y 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?
- kqr 1y agoThat'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.
- _jackdk_ 1y agoThat would work if the API we were querying could return results of different types in response to a single query. But we might have a single operation that needs to know a couple of FooIds, a BarId, and a BazId, and they all need to be at least three requests against the remote system.
- lkey 1y agoCreating specialized and constrained DSLs is a common and useful pattern for folks that write Haskell (or really any FP lang that has ADTs).
- cryptonector 1y agojq was originally a Haskell-coded, in-Haskell DSL.
- marcosdumay 1y agoI 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?
- munchler 1y agoI 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.
- tome 1y ago> when I see Haskell programmers casually discussing the lengths they’ll go to to avoid side-effects Can you give an example of that happening?
- tinyspacewizard 1y agoThis seems like a cool article, but it isn't readable without Haskell background knowledge. > For an intuition why this is true, consider that the constant functor Const r has an Applicative instance whenever r is a monoid, because pure stores a mempty value and (<*>) combines the held values with (<>). For a fun exercise, implement runAp_ in terms of runAp and Const. Really?
- ronef 1y agoBellroy is. very cool and deep in tech. We actually did a Nix in the Wild with them a while back! https://flox.dev/nixinthewild/nix-in-the-wild-bellroy/ https://flox.dev/nixinthewild/nix-in-the-wild-bellroy/