Comment

Comment by shiandow

If you're creative about it you can make an interface for what is essentially a sum type.

All it takes is a method signature like:

   Z read<Z>(Func<A,Z> readA, Func<B,Z> readB)
It's a bit of a Yoneda embedding like way of forcing it in to the language, but hey it works.
parent shiandow 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton