[Haskell-beginners] Using Show

Kostiantyn Rybnikov k-bx at k-bx.com
Wed Apr 15 16:50:29 UTC 2015


+ is a function of two arguments, and applying via (*) against a list would
apply each item as first argument of plus

Doing

pure (+) <*> [1,2,3] <*> [4,5,6]

would work.

What are you trying to achieve?
15 квіт. 2015 15:48 "Shishir Srivastava" <shishir.srivastava at gmail.com>
пише:

> hi,
>
> I am trying to naively print an applicative functor using 'show' like this
> -
>
> show (pure (+) <*> [1, 2, 3])
>
> I know there is something fundamentally wrong with that expression but not
> sure what.
>
> Can anyone please point it out.
>
> Thanks,
> Shishir
>
>
> _______________________________________________
> 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/20150415/ef5c5a22/attachment.html>


More information about the Beginners mailing list