[Haskell-beginners] Confusing Show/print error

Tobias Brandt to_br at uni-bremen.de
Thu Sep 9 21:56:58 UTC 2021


Hi Lawrence,

it seems that you are trying to print your defined function. Most likely 
you just forgot to apply an argument to fswp. So 'fswp (1,2)' should 
just work fine.

Cheers,

Tobias

On 9/9/21 11:25 PM, Galaxy Being wrote:
> I've got this
>
> import Data.Tuple
> fswp :: (a, b) -> (b, a)
> fswp = Data.Tuple.swap
>
> and get this
>
> • No instance for (Show ((a0, b0) -> (b0, a0)))
>         arising from a use of ‘print’
>         (maybe you haven't applied a function to enough arguments?)
>     • In a stmt of an interactive GHCi command: print it
>
> Not sure why or what to do to correct it.
>
>> Lawrence Bottorff
> Grand Marais, MN, USA
> borgauf at gmail.com <mailto:borgauf at gmail.com>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20210909/a00b99aa/attachment.html>


More information about the Beginners mailing list