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: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: Haskell, anyone? Date: Sun, 15 Nov 2015 16:48:16 -0600 Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: nma@12000.org NNTP-Posting-Host: xsLQkk658PrKN3IVMCswbw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28376 Date: 2015-11-15T16:48:16-06:00 List-Id: On 11/15/2015 4:11 PM, mockturtle wrote: > I just installed ghc & C. and I am giving a try to the tutorials. >The syntax is a bit... intimidating, though :-). I mean, I find more intutive something like > > function add(X, Y: Integer) return Integer; > > rather than > > add :: Integer -> Integer -> Integer > If this is how Haskell look, then thanks but no thanks, I'll skip ;) On Ada, One of the best features is the ability to define subtypes very easily. I have not seen any other language with this feature. (one has to make Class in other languages, and define all the operations each time). This is for me what makes Ada for me. One can define a type that matche the range of the physical quantity being modeled. This helps catch many errors. Can one do this in Haskell? Say define a new integer subtype that can only take values from only 1...20. And have the compiler and run time check for this? > > Riccardo > --Nasser