A possible alternative to dot notation for record access

Mike Ledger eleventynine at gmail.com
Fri Jul 12 08:01:52 CEST 2013


6 even:

foo :: (Maybe :: * -> *) Foo -> Bar
foo (fromMaybe def -> x) = \x -> case x of
    Foo x -> x->y->z

On Mon, Jul 1, 2013 at 4:27 PM, John Wiegley <johnw at fpcomplete.com> wrote:

> >>>>> Edward Kmett <ekmett at gmail.com> writes:
>
> > If you really want to hunt for unused syntax and we wind up needing a (.)
> > analogue then (->) is currently a reserved operator, so opening it up for
> > use at the term level could be made to work, and there is a precedent
> with
> > c/c++ pointer dereferencing.
>
> Imagine this possible code:
>
>     foo :: Maybe Foo -> Bar
>     foo (fromMaybe def -> x) = \x -> case x of
>         Foo x -> x->y->z
>
> I think it might get a bit ugly to give it a 5th meaning.
>
> --
> John Wiegley
> FP Complete                         Haskell tools, training and consulting
> http://fpcomplete.com               johnw on #haskell/irc.freenode.net
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20130712/3106d06b/attachment.htm>


More information about the Glasgow-haskell-users mailing list