Comment

Comment by lowmagnet

It's showing you it's blending the `Box[T]` with a function that takes a function that applies over `T` to get a new type `Box[U]`. It's a bit convoluted, and it's also unnecessary. I think it's more readable like this:

`func (b Box[In]) Map[Out any](f func(In) Out)Box[Out]`

Or

`func Apply[In, Out any](in []In, f func(In) Out) []Out`

Which can be used anywhere and is not tied to a "Box"

Honestly if it wasn't written in go it'd fit right in with Java, with a Verb in the kingdom of Nouns.

parent lowmagnet 3 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton