3 ms·
> By far the biggest demand for HKT is from people who are requesting Haskell-like do-notation for error handling. That hasn't been my experience -- we are con
by aturon 12y ago
> By far the biggest demand for HKT is from people who are requesting Haskell-like do-notation for error handling.
That hasn't been my experience -- we are constantly running into cases in the libraries where we need HKT to express signatures in traits. The simplest example is talking about iterator return types, which often need to depend on a lifetime. See the collections reform RFC (https://github.com/aturon/rfcs/blob/collections-conventions/text/0000-collection-conventions.md#lack-of-iterator-methods https://github.com/aturon/rfcs/blob/collections-conventions/...) for details on that example. There are many, many others.
I suspect that HKT's role in Rust will be much more about extending the trait system for generic programming, rather than full-blown monadic programming.
- lostdog 12y agoThanks for posting this link. I struggled with this problem all yesterday, and hadn't realized that rust can't handle lifetimes over traits until you posted this.