For Programmers: Free Programming Magazines  


Home > Archive > Functional > July 2007 > Re: shootout: implementing an interpreter for a simple procedural language Minim









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: shootout: implementing an interpreter for a simple procedural language Minim
Jon Harrop

2007-07-30, 8:05 am

Rainer Joswig wrote:
> Say, my program needs primes as inputs. How will that be expressed in
> types other than it is an integer? In SML? In Haskell?


You can tag the int with a phantom static type reflecting its primality.

> How will it effect input of primes?


The result of the code responsible for inputting primes would have a static
type.

> Most domain dependent constraints on input data cannot be expressed
> as types.


Yes. Static types are of little benefit at boundaries like input of user
data or remote procedure calls.

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/produc...entists/?usenet
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com