Timeline for How do you encode Algebraic Data Types in a C#- or Java-like language?
Current License: CC BY-SA 3.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 24, 2015 at 16:33 | comment | added | croyd | I think the problem here is that Right isn't generic over the type of error. Something like: class Right<R> : Either<Bot,R>, where Either is changed to an interface with covariant (out) type parameters, and Bot is the bottom type (subtype of every other type, opposite of Object). I don't think C# has a bottom type. | |
| Feb 7, 2014 at 18:37 | comment | added | Doval | I've seen a Java version of this technique before, but lambdas and named parameters make it so much readable. +1! | |
| Feb 7, 2014 at 15:57 | history | answered | Joey Adams | CC BY-SA 3.0 |