Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.haskell > #330
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Norbert Melzer <timmelzer@gmail.com> |
| Newsgroups | comp.lang.haskell |
| Subject | Re:Lists |
| Date | Wed, 22 Jul 2015 16:59:45 +0200 (CEST) |
| Organization | news.individual.net |
| Lines | 29 |
| Message-ID | <d19pf2FmhdkU1@mid.individual.net> (permalink) |
| References | <81e2b7cb-fa2c-4d0e-8dca-a9f33a114ef9@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net hn2ZzBJbH8zW7ek9NBCo6gKeD1J4MhFbWaBChcSQOWbxb8Vqh6 |
| Cancel-Lock | sha1:yy/xgRwsF1s7klTxYL0sQA2oVWA= |
| X-Newsreader | PiaoHong.Usenet.Client.Free:1.65 |
| X-Archive | encrypt |
| Xref | csiph.com comp.lang.haskell:330 |
Show key headers only | View raw
pip7kids@gmail.com Wrote in message: > > Hi > I was playing with the following example and was wondering how I could get to pass lists of weights and heights into the following code. > > calcBmis2 :: [(Double ,Double)] -> [Double] > calcBmis2 xs = [bmi | (w , h) <- xs, let bmi = w / h ^ 2, bmi > 25] > > main = do > print(calcBmis2[(81.5,1.8)]) -- this works fine > [25.15432098765432] > ......................................................... > > However, rather than just use 2 variables (w for weight and h for height) - how can I pass multiple arguments . > > For example - > w = [81.5,77.2] > h = [1.8.1.99] > > Regards > > What you should is simply call calcbmis with a list of tuples. -- ----Android NewsGroup Reader---- http://usenet.sinaapp.com/
Back to comp.lang.haskell | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Lists pip7kids@gmail.com - 2015-07-22 07:13 -0700 Re:Lists Norbert Melzer <timmelzer@gmail.com> - 2015-07-22 16:59 +0200 Re: Lists Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-22 16:51 +0100 Re: Lists philsivyer@googlemail.com - 2015-07-22 12:57 -0700
csiph-web