[Haskell-cafe] Call for discussion: OverloadedLists extension

Heinrich Apfelmus apfelmus at quantentunnel.de
Mon Sep 24 15:57:11 CEST 2012


Roman Cheplyaka wrote:
> * Heinrich Apfelmus <apfelmus at quantentunnel.de> [2012-09-23 10:51:26+0200]
>> Unfortunately, making literals polymorphic does not always achieve
>> the desired effect of reducing syntax. In fact, they can instead
>> increase syntax! In other words, I would like to point out that there
>> is a trade-off involved: is it worth introducing a small syntactic
>> reduction at the cost of both a small additional conceptual
>> complexity and some syntactic enlargement elsewhere?
> 
> Can't you just disable the extension when you realise that it
> makes your life harder?

I thought so, too, but there is actually a "social" catch.

Namely, a library/DSL can be designed with that extension in mind and 
advocate its use. The [scotty][] library is an example for this.

In particular, the  RoutePattern  type is made an instance of  IsString 
  and the example code uses it extensively. If I want to disable the 
extension, I have to translate the example code first. When learning a 
library for the first time, this can be rather confusing.

   [scotty]: http://hackage.haskell.org/package/scotty

Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




More information about the Haskell-Cafe mailing list