<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>Notice that our code will type check perfectly but every expression<br>has type Any and these types are essentially useless. This gives you<br>an idea of what static typing does and doesn't check. Basically types<br>are statically checked, but cases (in the discriminated union sense)<br>aren't. Cases are how you inject dynamic checks into statically typed<br>languages. </div></blockquote><br></div><div><br></div><div>Yes, I think I see what you mean... the discriminated union cases in a way threaten to "dissolve" the type system...</div><div><br></div><div>In fact, it seems to me I'm approaching this from the opposite angle somehow: Taking standard dynamic scheme as the default, I use typed scheme primarily for "educational" purposes - I like being forced to think about how, exactly, the fields of a record (for example) are defined or what exactly a function has to accept/return.</div><div>But even more, I like using the discriminated unions (with the define-datatype macro), they make me think about what "kinds of a thing there are", and they offer an easy way of structuring the code (I'll just have to handle every case and that's it).</div><div>Certainly this also depends on the domain - in my case currently, discriminated unions seem like a very suitable way to implement something "language-like" (the discriminated unions looking like some semantic equivalent of BNF anyway).</div><div>On the other hand, they really get inconvenient when there's too much pattern matching to do (speaking of pattern matching, their "natural proneness" to be used with pattern matching - if I my say so - is another reason I like them so much...)</div><div><br></div><div>- All this just from the perspective of a "normal user" (well in the end, I should perhaps also admit that using the algebraic datatypes in typed scheme might be a way of coping with the sad fact that my spare time doesn't seem sufficient to learn/practice both scheme and haskell :-;)</div><div><br></div></body></html>