4 ms·
Basically rust needs to be able to express generics that have the interface popularly known at monads.
by carterschonwald 3y ago
Basically rust needs to be able to express generics that have the interface popularly known at monads.
- zozbot234 3y agoEffect types as currently understood are closer to Lawvere theories than monads. The biggest difference is that the former can be composed out-of-the-box with no ambiguity, whereas you can't really compose monads without resorting to a clunky "transformers" pattern.
- carterschonwald 3y agoThat’s been clearly disproven for like a decade… you just need to have your effect monad structure be indexed by the set of symbols in question! Especially since the effects are baked into the language. The transformers formulation is only relevant for userland defined semantics! It doesn’t matter if the monadic structure is there in user syntax, it’s there in the semantics.
- Rusky 3y agoPretty important distinction when you're specifically talking about the interface being expressed in the language.
- carterschonwald 3y agoActually less than you’d think! Granted I’ve been tinkering with ways to let users choose how much they wanna see fancy info vs let a compiler do the book keeping. Keeping track of this info in the compiler ir is trivial
- Rusky 3y agoWhat I mean is, merely plopping a Monad trait into Rust and implementing everything in userspace is famously not an effective implementation approach, so your phrasing is bound to confuse people when you are instead referring to the semantics.
- carterschonwald 3y agoTo be fair I really would enjoy writing the sorts of things I like in rust if I could express monad traits sanely there. Like I’m actually trying to talk myself out of writing a type theory plus resource logic language in my not so copious free time because I want higher order traits/types and low level powah :)
- tomberek 3y agoThat seems to be what the article is trying to avoid saying. I'm surprised there is no mention of Haskell; a place where much of this has been experimented and explored. It's fine to redesign the wheel, but take a look at older designs first, and acknowledge them.
- carterschonwald 3y agoYeah. It could have just even been like “we like the idris effect set formulation” and that would have been clearer