On Sep 6, 2010, at 12:23 PM, Johannes Waldmann wrote:

We have overloaded numerical literals (Num.fromInteger)
and we can overload string literals (IsString.fromString),
so how about using list syntax ( [], : )
for anything list-like (e.g., Data.Sequence)?

As lists of some type A represent the free monoid over A, what if

    [x,y,z]

would be syntactic sugar for

    mconcat (map point (x:y:z:[]))

with

    class Pointed p where point :: a -> p a

Then list literals could be used for every pointed monoid.

Note that this only considers list literals. The (:) and [] constructors would not be overloaded.

Sebastian


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to