I don't think I'd ever actually tried this before (although I remember discussing it on Zulip in the past), but it's really cool that this style already works today!
url = "/foo/bar/baz/hello"
when Str.split url "/" is
["", "foo", middle, "baz", last] -> ...
_ -> ...
if that style gets used a lot, that pattern match might be something we end up wanting to optimize
Mmm that is really nice. I like how explicit it is while still being succinct.
Yeah, this works really well. I use this approach on a server project right now and it’s great.
Last updated: Jul 06 2025 at 12:14 UTC