4 ms·
Linear-base makes writing Linear Haskell easy and fun
- wyager 6y agoVery 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.
- siraben 6y ago> Is there anything like a linear state monad? 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/ https://www.tweag.io/blog/2020-01-16-data-vs-control/
- nine_k 6y agoNice! The Data.Functor vs Control.Monad explained.
- sjoerd_visscher 6y agoYes I thought the same, so I rewrote the example with the linear state monad: https://twitter.com/sjoerd_visscher/status/1359854088175964163?s=21 https://twitter.com/sjoerd_visscher/status/13598540881759641...