[Haskell-cafe] Drastic Prelude changes imminent

adam vogt vogt.adam at gmail.com
Tue Jan 27 18:05:59 UTC 2015


On Tue, Jan 27, 2015 at 11:03 AM, Johan Tibell <johan.tibell at gmail.com> wrote:
> Looking at the generalizations in Data.List I find them pretty odd now when
> I think about it. I'd expect Data.List functions to be monomorphic to lists,
> just like I expect functions in Data.Map to be monomorphic to maps. Now
> there might be generalized versions of these functions in e.g. the Prelude,
> but generalizing Data.List means that I don't even have the monomorphic
> versions available if I want to resolve ambiguity by using them*.
>
> * It turns out resolving ambiguity is pretty annoying. The type signatures
> are awkward to write so I end having to write something akin to
>
>     mymap :: (a -> b) -> [a] -> [b]
>     mymap = map

Unless you're using -XOverloadedLists, you can throw in a

(`asTypeOf` [])

to disambiguate. Or is that the annoyance you were talking about?


More information about the Haskell-Cafe mailing list