3 ms·
This looks quite nice in the examples given :) But I'm not very fond of polymorphic return types in general. (You have this also with printf and various databas
by kreyenborgi 2y ago
This looks quite nice in the examples given :) But I'm not very fond of polymorphic return types in general. (You have this also with printf and various database read functions.) The error messages get difficult to read for beginners since everything is so abstract; experienced users end up adding type annotations to make the expressions more wieldy, at which point you might as well just have required arguments. If we're restricted to synchronous functions, what's the reason for not just letting Output be a Plain Old Product with fields for stdout/stderr/exitcode? (Then it's even theoretically possible to get autocompletion on fields (using record-dot) given a sufficiently smart language server, making it even more user-friendly.)