[clean-list] Wish list =+ New *World

Edsko de Vries devriese at cs.tcd.ie
Wed Aug 22 23:19:08 MEST 2007


Clean is a pure functional language. If you want to have side effects at
arbitrary places in your code, you should use something like OCaml. The
whole point of a *Unique* world is that it is *Unique*. If one could
create worlds at arbitrary places, referential transparency (the 'pure'
in pure functional) is lost. For example, I could easily write a
function such as: 

getInt :: Integer
getInt = getTime createWorld

(assuming a function getTime :: *World -> Int)

Once I can write this function, all the nice properties that come with pure functional languages are lost. For example, I can no longer assume that

forall (i :: Integer), i + i = 2 * i

because 

  getInt + getInt /= 2 * getInt

Edsko


More information about the clean-list mailing list