From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.146.194 with SMTP id j185mr30236466ywg.26.1447666422033; Mon, 16 Nov 2015 01:33:42 -0800 (PST) X-Received: by 10.182.247.67 with SMTP id yc3mr307515obc.0.1447666421957; Mon, 16 Nov 2015 01:33:41 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!i2no3526458igv.0!news-out.google.com!l1ni6088igd.0!nntp.google.com!i2no3846559igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 16 Nov 2015 01:33:39 -0800 (PST) In-Reply-To: <1vbqjk2gw3ml3$.1htxd6ry37jn1$.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=158.110.27.77; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 158.110.27.77 References: <1vbqjk2gw3ml3$.1htxd6ry37jn1$.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <67791e0e-47e1-4dd8-933f-2e7926f73340@googlegroups.com> Subject: Re: Haskell, anyone? From: mockturtle Injection-Date: Mon, 16 Nov 2015 09:33:42 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28395 Date: 2015-11-16T01:33:39-08:00 List-Id: On Monday, November 16, 2015 at 9:33:57 AM UTC+1, Dmitry A. Kazakov wrote: > On Sun, 15 Nov 2015 14:11:07 -0800 (PST), mockturtle wrote: >=20 > > function add(X, Y: Integer) return Integer; > >=20 > > rather than > >=20 > > add :: Integer -> Integer -> Integer > >=20 > > (Yes, I understand that this means that add is a function that maps an > > integer into a function that maps integers to integers... [confused? :-= )] >=20 > Hmm, but that is not an equivalent of "add." In mathematical notation "ad= d" > is: >=20 > add : Integer x Integer -> Integer >=20 > a mapping of pairs (Integer, Integer) to Integer. >=20 I'm not an expert, I am still at the tutorial level. What follows is what = I understood so far... :-) I agree, but in Haskell tutorials I found the point of view that I describe= d above. The reason is that in Haskell functions can have only one argumen= t, so if you wants more than argument you need this kind of "iteration." T= o be honest, you can also define "add" as a function that maps a pair (x,y)= into an Integer, you still have a one-argument function that operates on a= single object, that is, a pair. The iterated function approach allows you= to do something like inc =3D add 1 In this case, inc is the Integer -> Integer function returned by "add" call= ed with argument 1. Source: https://www.haskell.org/tutorial/functions.html