On 15/02/2014, at 9:20 AM, Martin DeMello wrote: > You can, but the thing is that you want to enforce a consistent error type > everywhere otherwise it's not as much use. Incidentally, I think rust's > Result = Ok of T | Err of E is less general but nicer than haskell's Either = > Left of a | Right of b - limiting the meaning of left/right by explicit > naming rather than convention is a good thing.
But what is E? If this type is polymorphic in both T and E you have solved very little, you still need to know the type of E. One thing you could do for copyfiles is return the number of files copies and just use -1 for error. Not very nice, and it would require it to be a generator (function with side effects) rather than a procedure. -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language