[Haskell-cafe] Ambiguous type variable

Christopher Done chrisdone at googlemail.com
Fri Oct 15 18:51:14 EDT 2010


On 16 October 2010 00:47, Jacek Generowicz <jacek.generowicz at cern.ch> wrote:
> -- why does "show 2" compile, while "view 2" gives an
> -- 'Ambiguous type variable' error
>
> fine                  = view (2::Int)
> noProblem             = show 2
> ambiguousTypeVariable = view 2

Don't integral literals default to Integer, of which there is a Show
instance but no View instance?


More information about the Haskell-Cafe mailing list