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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Haskell, anyone? Date: Mon, 16 Nov 2015 09:33:27 +0100 Organization: cbb software GmbH Message-ID: <1vbqjk2gw3ml3$.1htxd6ry37jn1$.dlg@40tude.net> References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: TWQ9mg4k1m/sph/eQ+zHLA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28392 Date: 2015-11-16T09:33:27+01:00 List-Id: On Sun, 15 Nov 2015 14:11:07 -0800 (PST), mockturtle wrote: > function add(X, Y: Integer) return Integer; > > rather than > > add :: Integer -> Integer -> Integer > > (Yes, I understand that this means that add is a function that maps an > integer into a function that maps integers to integers... [confused? :-)] Hmm, but that is not an equivalent of "add." In mathematical notation "add" is: add : Integer x Integer -> Integer a mapping of pairs (Integer, Integer) to Integer. [ However, in Ada's terms nothing requires it to be a mapping. E.g. "add" may have side effects so that "add" with same arguments would return different values. Which is no mapping then. There is still no pure functions in Ada 2012, right? ] > and I guess that this is taken from the common mathematical notation of > functions) I guess one gets used to it, nevertheless, it is not the most > intuitive syntax in the world... :-) Seems so, except that doubled colon, which normally has the meaning "deduced" rather than "equal." -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de