4 ms·
Hi! We write almost everything in Haskell. By the way, Num in IO in IO is completely ok function signature - it means that you have a function that uses IO to
by wdanilo 9y ago
Hi! We write almost everything in Haskell.
By the way, Num in IO in IO is completely ok function signature - it means that you have a function that uses IO to optain a function which will return a number while performing another IO action :) However it is completely ok in Luna for the end user to type it simpler, like `a :: Num` and the compiler will keep track of all "monad transformers" under the hood.
- rjeli 9y agoI think this is a really good idea -- many people, myself included, get really excited about Haskell and then are turned off by the complexity of monad transformers. I would recommend that you focus on good error messages that explain monad-related errors in "user land" and not force them to either guess about what's wrong or suddenly learn all the stuff under the hood. It's a terrible experience and you see it in C++ with incomprehensible template errors or any kind of transpiled language like ClojureScript that gives you errors from the underlying implementation.
- wdanilo 9y agoThat is a very good point. We treat "monads" in a very special way in Luna - they have their own type section and we can analyse them and report errors much clearer than Haskell can for example. This does NOT mean that we limit them in any way. You are free to define your monads and convert them to ordinary types or back as you wish :) But we normally dont describe them as monads, just as "context", because it is easier to understand.