Overloadable list type notation

Edward Kmett ekmett at gmail.com
Tue Feb 17 18:55:57 UTC 2015


View pattern support right pre-7.10 is fairly limited in that you have to
write a chunk of code that can be interpreted as both a pattern and an
expression, or limit yourself to just using the syntax for matching.

Afterwards, this opens up a bit, and we get the new syntax for complex
bidirectional pattern synonyms, as I recall, so you could make a view
pattern for `:<` or something that does this, but we don't have a standard
class for it.

-Edward

On Tue, Feb 17, 2015 at 1:44 PM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
>
> On Tue, 17 Feb 2015, Edward Kmett wrote:
>
>  The existing IsList machinery gets you the [], [x], and [x,y] cases, but
>> not (x:xs).
>>
>
> What about the view patterns?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150217/9e744ec3/attachment.html>


More information about the Libraries mailing list