Proposal: Add IsString instance for (Maybe a) to base
Roman Cheplyaka
roma at ro-che.info
Fri Jul 12 08:13:27 CEST 2013
* John Lato <jwlato at gmail.com> [2013-07-12 13:56:31+0800]
> The programmer is being explicit; the type specifies the value is a Maybe.
> If it weren't, the Just wouldn't be inserted.
Not necessarily — take Simon's original example:
(shell "ls -l") { cwd = "/home/me" }
If I didn't know the type of 'cwd', it would never occur to me while
reading this code that you can supply Nothing there.
Also, the fact that you can omit Just with string literals but not with
string values or values of other types creates an unnecessary
irregularity in the language.
Roman
More information about the Libraries
mailing list