Proposal: Add IsString instance for (Maybe a) to base

Anton Nikishaev me at lelf.lu
Sun Jul 14 16:04:17 CEST 2013


Simon Hengel <sol at typeful.net> writes:

> Hi,
> what about adding
>
>     instance IsString a => IsString (Maybe a) where
>       fromString = Just . fromString
>
> It makes specifying optional String/Text/... values more convenient.
> Here is an example that uses System.Process.shell:
>
> Use
>
>     shell "ls -l" { cwd = "/home/me" }
>
> instead of
>
>     shell "ls -l" { cwd = Just "/home/me" }
>
> I'm not yet sure how essential it is.  But I somehow can't see any
> issues with it.  So why not?

-1.  It's called *IsString*.



-- 
lelf






More information about the Libraries mailing list