
28 Dec
2016
28 Dec
'16
2:29 p.m.
Tom wrote:
What about other functions from 'safe', eg headMay, atMay, readNote, etc?
The standard spelling of "headMay", already included in base, is "listToMaybe". In general, once you have readMaybe, NonEmpty, and the rich set of combinators and instances we have today for Maybe and Either, the safe library really isn't needed anymore. It was a great innovation at the time - it brought the problem of partial functions to the forefront. But I prefer using the standard names we have for those functions nowadays, or occasionally using a simple combination of two of them. The function names in the safe library always seemed a bit awkward to me. YItz