5 ms·
Great, But \ is ugly
by linter 3y ago
Great, But \ is ugly
- subarctic 3y agoThat's just what I was thinking too haha. Honestly I really like the rest of the syntax though. (And of course, the type system features look neat but it's easier to have an opinion on syntax.)
- nikolay 3y agoAnd so are forA and forM!
- imoverclocked 3y agoYour username matches your comment! Also, I agree but I'm not sure what I would propose as a better token. Maybe another colon? def printAndInc(x: Int32): Int32 \ IO = becomes: def printAndInc(x: Int32): Int32 : IO = Or maybe, since functions need something after the \, even for pure functions, we just drop the \ and use the last argument? def printAndInc(x: Int32): Int32 IO =
- Too 3y agoWhy not something human readable? pure vs mut? Other languages already have readable keywords in the function definition; extends, raises, where, having, Optional, and so on. They don’t feel unnecessarily verbose.
- nrabulinski 3y agoBecause they’re working on algebraic effects so obviously IO won’t be the only effect out there. Also because “mut” is even more misleading as it doesn’t capture everything an “IO function” can do, in comparison to a pure function.
- Too 3y ago”mutates IO”? Anything is better than /{}. I don’t know, maybe one gets accustomed to it after a while? It would be rather verbose to write “returns Foo” everywhere. I’m just looking at this with fresh eyes and this aspect of the language is a token-soup. Other parts look neat though.