Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude<string, "">`.
https://www.typescriptlang.org/docs/handbook/utility-types.h...
Edit: nevermind, LLM fooled me.
by ivanjermakov - Daily reminder that TypeScript's type checker is not sound.
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAcg9gOwK...
by nvme0n1p1 - Speaking of TS, there's stuff in there for typing strings / string formats: https://www.typescriptlang.org/docs/handbook/2/template-lite...by Cthulhu_
- It is very much mentioned in the article title and the first sentence. It's just HN that's truncated the title.by ralferoo
- It's simple, and it doesn't work as `Exclude` only applies to union types. For type `string` it just returns the same type `string`.by antipurist
- Empty strings are usually an artifact of lazy developers paying a minimal "empty" value for a type (just as 0 for numbers).
A type like NonEmptyString is a weak defense against that, as a lazy dev can just pass a single space character or something similar.
by VMG - But that’s not an empty stringby anon7000
- Very cool that the language allows specification of a type in this way.
I added a similar type — “non-empty-string” to a typechecker for PHP, and it’s been adopted widely in the PHP ecosystem. It turns out to be pretty handy, especially when there’s a full type system to support it.
by muglug - > Very cool that the language allows specification of a type in this way.
Check out Idris 2. Dependent types can get very hairy to work with, but that language is an absolute playground for inductive type-level verification. And the standard library is like a nice Haskell standard library to me in a lot of ways, although the language itself is (unsurprisingly) not nearly as "production ready" as Haskell.
by gwerbin - "Huh never heard of Bellroy... I wonder what they're using Haskell for..."
Turns out it's some kind of bags and accessories brand!
by IshKebab - I once saw a job ad for a company selling a horoscope app that required Haskell. An unusual conjunction for sure.by ambicapter
- I bought a leather wallet from them in 2016 (the Hide & Seek) and it is still holding up well despite a few loose stitches. It’s much slimmer than my older wallet.by kccqzy
- I pondered for a while, it IS the company I used to knowby qbane
- I've had a Bellroy bag, they're not the most fashionable but super high quality and well thought-out. Just like Haskell code—maybe that's why they like it.by flexagoon