Conversation

I feel like I don't have a lot of examples of languages where a wrapper on an entity is routinely passed around as a proxy for the entity itself except for the ones in the same "we decided to make a mass-market version of OCaml around 2015" cohort as Rust.
1
1
(...Similarly the more conventional ML have the Tag(entity) vs entity problem, but those languages seem to really dislike subtyping (ie concepts such as traits) so they can't get into this particular hole so easily.)
1
1
Actually, I wonder if Haskell has variants of this problem (because typeclasses are not completely dissimilar from traits), and what their current error message is.
1
2
traits *are* typeclasses, they follow p much all the same formalisms etc. I saw this tweet out of order and forgot to reply to it, sorry but yeah, one could translate my playground examples into Haskell, and I would if I knew a Haskell playground (and weren't passing out tired)
1
1
and this is if I change it to: `foo :: Foo -> ()` nothing amazing, really, I wonder if I should try Elixir or whatever that language is that was praised for its diagnostics
Image
1
1
I didn't look at it yet but I wonder how it compared to #[rustc_on_unimplemented] but also the problem is with the Result<T, _>/Either T _ type, being used in a place where only T satisfies bounds - the specific typeclass doesn't matter and shouldn't care about accounting for th
1
*compares to and it looks much fancier, I guess in Rust we'd probably want to use consts and const generics if we wanted something like that
1
Show replies