On Fri, Jul 12, 2013 at 2:45 AM, John Lato <jwlato@gmail.com> wrote:It does to me! Concrete types help me read. I have a lot of trouble
> On Fri, Jul 12, 2013 at 2:13 PM, Roman Cheplyaka <roma@ro-che.info> wrote:
>>
>> * John Lato <jwlato@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.
>
> So? If you're just reading the code, it doesn't matter. If you want to
understanding libraries that make extensive use of typeclasses, both
reading their documentation and reading code that uses them.
I probably wouldn't, because I know the process package uses Strings.
> OverloadedStrings (and number literals) are already a mess for this.
> Currently, we have
>
> (shell "ls -l") { cwd = Just "/home/me" }
>
> If I want to replace that literal with a value and I don't know the type of
> 'cwd', I already need to look it up. Otherwise I might try to do something
> like this:
>
> dirFromUser <- Text.getLine
> (shell "ls -l") { cwd = Just dirFromUser }