Re: Page 76 of OCaml by John Whitington ???
"Kenneth Miller [email protected] [ocaml_beginners]" <[email protected]> Tue, 29 Mar 2016 12:46:55 +0000 (UTC)
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Well, there are a couple more notes about the differences in language design between Haskell and OCaml and Ruby.
Ruby is great when you want to get things done fast, but just like python, when you want to build software maintainably and make it robust, it's hard to do that without a bunch of object oriented stuff. And OO was a great idea that started in industry, but for which time and reality have not really been so kind to. It's fast to work with though.
In any case, Haskell is very deeply mathematical. Not even the type inference implementations are really in common with OCaml, and while it might feel the same on the surface, it's entirely different beneath. Every fundamental language construction decision has ripple effect consequences in the remaining component. These guys care a lot about elegance and correctness, and if you happen to be some bad ass working at some top notch research institution probably you also write code that is fast too - which is hard to do to be honest. Also, your note about imperative controls isn't entirely correct - just about every language has an escape hatch to C, which will give you exactly that. Also, if you want your imperative controls to be facilitated by robust type checked correctness, then you opt for things like Hoare theory and the calculus of inductive constructions. YNot is an example, and while I haven't dabbled in Haskell to know specifically which is the sister, I wouldn't be surprised if there were something like that for Haskell; I know there are Hashmaps, and you can't get a Hashmap with imperative control.
On Tuesday, March 29, 2016 4:23 AM, "'Mr. Herr' [email protected] [ocaml_beginners]" <[email protected]> wrote:
On 29.03.2016 06:41, Douglas Lewit [email protected] [ocaml_beginners] wrote:
I also gave something like this a try, but I ended up with a couple of error messages:
let pack list = match list with |[ ] -> [ ] |head :: tail -> match tail with |[ ] -> [ ] headOfTail :: tailOfTail -> if head = headOfTail then..... ( more code )
I thought it was clever, but either I just ended up with an empty list, a one-element list, or the compiler just rejected it. I'm starting to feel a little dumb! But I'll keep at it.
tailOfTail is a list, not an element!
/Str.
#yiv4464418937 #yiv4464418937 -- #yiv4464418937ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv4464418937 #yiv4464418937ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv4464418937 #yiv4464418937ygrp-mkp #yiv4464418937hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv4464418937 #yiv4464418937ygrp-mkp #yiv4464418937ads {margin-bottom:10px;}#yiv4464418937 #yiv4464418937ygrp-mkp .yiv4464418937ad {padding:0 0;}#yiv4464418937 #yiv4464418937ygrp-mkp .yiv4464418937ad p {margin:0;}#yiv4464418937 #yiv4464418937ygrp-mkp .yiv4464418937ad a {color:#0000ff;text-decoration:none;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ygrp-lc {font-family:Arial;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ygrp-lc #yiv4464418937hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ygrp-lc .yiv4464418937ad {margin-bottom:10px;padding:0 0;}#yiv4464418937 #yiv4464418937actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv4464418937 #yiv4464418937activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv4464418937 #yiv4464418937activity span {font-weight:700;}#yiv4464418937 #yiv4464418937activity span:first-child {text-transform:uppercase;}#yiv4464418937 #yiv4464418937activity span a {color:#5085b6;text-decoration:none;}#yiv4464418937 #yiv4464418937activity span span {color:#ff7900;}#yiv4464418937 #yiv4464418937activity span .yiv4464418937underline {text-decoration:underline;}#yiv4464418937 .yiv4464418937attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv4464418937 .yiv4464418937attach div a {text-decoration:none;}#yiv4464418937 .yiv4464418937attach img {border:none;padding-right:5px;}#yiv4464418937 .yiv4464418937attach label {display:block;margin-bottom:5px;}#yiv4464418937 .yiv4464418937attach label a {text-decoration:none;}#yiv4464418937 blockquote {margin:0 0 0 4px;}#yiv4464418937 .yiv4464418937bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv4464418937 .yiv4464418937bold a {text-decoration:none;}#yiv4464418937 dd.yiv4464418937last p a {font-family:Verdana;font-weight:700;}#yiv4464418937 dd.yiv4464418937last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv4464418937 dd.yiv4464418937last p span.yiv4464418937yshortcuts {margin-right:0;}#yiv4464418937 div.yiv4464418937attach-table div div a {text-decoration:none;}#yiv4464418937 div.yiv4464418937attach-table {width:400px;}#yiv4464418937 div.yiv4464418937file-title a, #yiv4464418937 div.yiv4464418937file-title a:active, #yiv4464418937 div.yiv4464418937file-title a:hover, #yiv4464418937 div.yiv4464418937file-title a:visited {text-decoration:none;}#yiv4464418937 div.yiv4464418937photo-title a, #yiv4464418937 div.yiv4464418937photo-title a:active, #yiv4464418937 div.yiv4464418937photo-title a:hover, #yiv4464418937 div.yiv4464418937photo-title a:visited {text-decoration:none;}#yiv4464418937 div#yiv4464418937ygrp-mlmsg #yiv4464418937ygrp-msg p a span.yiv4464418937yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv4464418937 .yiv4464418937green {color:#628c2a;}#yiv4464418937 .yiv4464418937MsoNormal {margin:0 0 0 0;}#yiv4464418937 o {font-size:0;}#yiv4464418937 #yiv4464418937photos div {float:left;width:72px;}#yiv4464418937 #yiv4464418937photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv4464418937 #yiv4464418937photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv4464418937 #yiv4464418937reco-category {font-size:77%;}#yiv4464418937 #yiv4464418937reco-desc {font-size:77%;}#yiv4464418937 .yiv4464418937replbq {margin:4px;}#yiv4464418937 #yiv4464418937ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv4464418937 #yiv4464418937ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv4464418937 #yiv4464418937ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv4464418937 #yiv4464418937ygrp-mlmsg select, #yiv4464418937 input, #yiv4464418937 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv4464418937 #yiv4464418937ygrp-mlmsg pre, #yiv4464418937 code {font:115% monospace;}#yiv4464418937 #yiv4464418937ygrp-mlmsg * {line-height:1.22em;}#yiv4464418937 #yiv4464418937ygrp-mlmsg #yiv4464418937logo {padding-bottom:10px;}#yiv4464418937 #yiv4464418937ygrp-msg p a {font-family:Verdana;}#yiv4464418937 #yiv4464418937ygrp-msg p#yiv4464418937attach-count span {color:#1E66AE;font-weight:700;}#yiv4464418937 #yiv4464418937ygrp-reco #yiv4464418937reco-head {color:#ff7900;font-weight:700;}#yiv4464418937 #yiv4464418937ygrp-reco {margin-bottom:20px;padding:0px;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ov li a {font-size:130%;text-decoration:none;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv4464418937 #yiv4464418937ygrp-sponsor #yiv4464418937ov ul {margin:0;padding:0 0 0 8px;}#yiv4464418937 #yiv4464418937ygrp-text {font-family:Georgia;}#yiv4464418937 #yiv4464418937ygrp-text p {margin:0 0 1em 0;}#yiv4464418937 #yiv4464418937ygrp-text tt {font-size:120%;}#yiv4464418937 #yiv4464418937ygrp-vital ul li:last-child {border-right:none !important;}#yiv4464418937