Very exciting! The current multiplicity-polymorphic syntax ("a %m -> b") is quite visually jarring; I hope they can work out something nicer. At least the unicode version for the linear arrow ("a ⊸ b") looks good.
Is there anything like a linear state monad? It seems like it would simplify something like Data.Array.Mutable.Linear, where you'd rather not deal explicitly with the "Array a" value returned by every function.
4 comments
[ 3.1 ms ] story [ 23.8 ms ] threadIs there anything like a linear state monad? It seems like it would simplify something like Data.Array.Mutable.Linear, where you'd rather not deal explicitly with the "Array a" value returned by every function.
Yes! Tweag has a blog post[0] on how there are two different kinds of Functor, linear and non-linear, and in turn, variants of Applicative and Monad.
[0] https://www.tweag.io/blog/2020-01-16-data-vs-control/
The Data.Functor vs Control.Monad explained.