Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!stl!tom@nw.stl.stc.co.uk From: tom@nw.stl.stc.co.uk (Tom Thomson) Newsgroups: comp.lang.functional Subject: Re: What is strong typing? (Was: I like strong typing) Message-ID: <3282@stl.stc.co.uk> Date: 6 Aug 90 00:42:20 GMT References: <4387@uqcspe.cs.uq.oz.au> <1689@opal.tubopal.UUCP> <4424@uqcspe.cs.uq.oz.au> <3263@stl.stc.co.uk> <5448@castle.ed.ac.uk> Sender: news@stl.stc.co.uk Reply-To: "Tom Thomson" Organization: ICL Manchester M12 5DR UK Lines: 23 In article <5448@castle.ed.ac.uk> nick@lfcs.ed.ac.uk (Nick Rothwell) writes: >0 is an integer, just like 17 is. Milner-style typechecking is structural, >so it knows about, say, integers, but not about positive integers, primes, >and non-structural entities of this kind. > I think this misses the point completely. The reason for introducing zero-division as an example was precisely to point that Milner-style type checking doesn't cover this case - - in fact any type checking system that insists on operating at compile time and not at run time (while leaving it possible to write a reasonable range of programs) will fail to cover this case. Also, what does structural mean in this context? In terms of structural types, I can easily define positive integers as a type distinct from natural numbers including zero. I have never come across a functional language that would stop me doing this. I think it might be useful to think about why we have type systems (to limit the damage when we apply a function to arguments outside its domain) rather than what a particular type system (or class of type systems) can do. Tom Thomson [tom@nw.stl.stc.co.uk