Comment

Comment by dehrmann

> The exception that is raised when an empty Maybe is used is a checked exception so you don't forget to handle it.

I think they acknowledged get() should have been getOrThrow() so it's clear what can happen, but I don't know if making it checked is an improvement.

> It implements the Collection interface, so it can be accessed with a for-loop.

I'm curious what the use cases are for this. I've used Optional, it can be annoying, it's mostly around it being verbose and APIs being inconsistent. It was never wishing I could treat it as a collection.

parent dehrmann 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton