- Tue 12 August 2014
- misc
- Tero Koskinen
Using discriminated records to return variable amount of data from function
Sometimes, you want to return different data from a function dependending on the given parameters and the program state. For example, when searching a container for a certain element, you either want to return "NOT_FOUND" information or the actual element. One way to do this is to use discriminated (or …