Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.haskell > #335

Re: using list comprehension

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Mark Carroll <mtbc@bcs.org>
Newsgroups comp.lang.haskell
Subject Re: using list comprehension
Date Fri, 24 Jul 2015 10:58:50 +0100
Organization none
Lines 19
Message-ID <87pp3h7u79.fsf@ixod.org> (permalink)
References <4641db20-a273-4a84-bbba-9f2b5aeb5bb6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="1b3e5cba9e4d07a53741e6f3d1717925"; logging-data="24595"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WOWMitY5I+nI7FlOYCLEM"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock sha1:BLEE9dr18ou3mBp+y1eCRd1bZTg= sha1:YrbhceU4pbU+C859mY3ZWMSiCsA=
Xref csiph.com comp.lang.haskell:335

Show key headers only | View raw


pip7kids@gmail.com writes:
(snip)
> The following works for 2 values - 456.78 44
> perc = 44.56
> returns nav shares =
(snip)
> .......... however, what I would like to achieve is - can I use the above logic for many values in a list comprehension?
>
> eg
>
> nav = [1,2,3,4]
> shares = [5,6,7,8]
>
> I would now like my "return" function to act on the list's nav and shares.
> Is this possible and how.

Would "zipWith returns nav shares" do what you want?

--Mark

Back to comp.lang.haskell | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

using list comprehension pip7kids@gmail.com - 2015-07-24 02:06 -0700
  Re: using list comprehension Mark Carroll <mtbc@bcs.org> - 2015-07-24 10:58 +0100
  Re: using list comprehension pip7kids@gmail.com - 2015-07-24 03:45 -0700

csiph-web