[Haskell-cafe] Overloaded Strings as default

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Mon Nov 28 21:45:39 CET 2011


On 29 November 2011 07:28, Daniel Díaz Casanueva <dhelta.diaz at gmail.com> wrote:
> Hi Cafe,
>
> I only feel curious about what would be the consequences of becoming the
> Overloaded Strings feature (currently, an extension) to be default in
> Haskell. This is not a proposal. I just want to know what pros and
> cons there are.

One cons would be that you may need some more explicit type signatures
being used: I have the situation in my graphviz library where both
Text and String have instances of some classes (e.g. Labellable, which
has a method toLabel :: (Labellable a) => a -> Label) which result in
explicit "String" values in the source code result in the compiler not
knowing which instance to use (e.g. toLabel "hi").

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list