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.
Turns out it's some kind of bags and accessories brand!
You won't (write software to) do that without knowing a whole bunch of linear algebra and ODEs.
The fortune-telling part is not what needs the math degree.
The average Visual Basic programmer and the world's best mathematician are going to be about equally good at writing the fortune-telling part, but the mathematician will have a much easier time getting the factual part right.
The "whale" users who account for a disproportionately large percentage of an astrologer's revenue tend to know the factual information surrounding their birth fairly well. An app/astrologer who doesn't get these facts right, even for a handful of clients, will get a bad reputation fairly quickly.
I reckon the same principle would hold in cultural bubbles where reading tea leaves is a customary means of divination. If the client recognizes recognize black tea, but the fortuneteller insists it is rooibos, there won't be much trust in the rest of the prophecy.
Advertising that the horoscope shop uses Haskell is actually a solid business idea. It pre-filters for the sort of dev who will be able to do the math.
My impression (not interested in pseudo sciences so I haven't looked into this hard) was that Astrology froze before Kepler explains how the planets move, and so the model used by astrologers is just wrong and won't actually tell you what was in the sky when you were born for example?
You don't need Newton (who figured out why they do that) but you do need Kepler or your physical data will be wrong surely? It won't matter because this isn't actually a way to divine the future, but it will be wrong AIUI
Modern ascendant calculations are "correct", in the sense that they'll match what you see in the sky. Apps like AstroMatrix work from NASA data.
As you rightly observed, it doesn't make a difference when it comes to foretelling the future. But it does make a difference if your aim is to make money selling it. The big spenders on these applications often care a great deal about getting the particulars just so.
https://www.typescriptlang.org/docs/handbook/utility-types.h...
Edit: nevermind, LLM fooled me.
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAcg9gOwK...
You can do this trick for type-checking emptiness of string literals
https://www.typescriptlang.org/play/?jsx=0#code/C4TwDgpgBAsg...
declare const brand: unique symbol;
type NonEmptyString = string & { readonly [brand]: 'NonEmptyString' };
// the ONLY non-cast way to produce one
export function nonEmptyString(s: string): NonEmptyString | undefined {
return s.length > 0 ? (s as NonEmptyString) : undefined;
}
export type { NonEmptyString };