Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.haskell > #335
| From | Mark Carroll <mtbc@bcs.org> |
|---|---|
| Newsgroups | comp.lang.haskell |
| Subject | Re: using list comprehension |
| Date | 2015-07-24 10:58 +0100 |
| Organization | none |
| Message-ID | <87pp3h7u79.fsf@ixod.org> (permalink) |
| References | <4641db20-a273-4a84-bbba-9f2b5aeb5bb6@googlegroups.com> |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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