Clean's type system.

Nick Kallen phantom@earthlink.net
Wed, 5 Nov 1997 16:35:11 -0800


In the draft of the book on functional programming in Clean, chapter II.08
(Machine Architecture) outlines how it will use instructions.
    Since instructions change the state of the machine,

:: Instruction :== State -> State.

Then it goes on to define jump--a function that takes the address of an
operator (in memory) and modifies the state with it. Thus,

jump :: Addr State -> State.

A more elegant way of looking at jump is as a function that takes an address
and ruturns an Instruction. Thus,

jump :: Addr -> Instruction.

"Unfortunately, the Clean type system does not allow us to write [this]" (p.
257).
    Considering that the Clean type system is so overwhelmingly powerful,
you'd imagine something as (seemingly) simple as this would be an obvious
feature. Why doesn't the Clean type system allow this? What exactly is the
term for this kind of type? Is the Clean type system to be expanded in the
(near) future to support this? What other spiffy kinds of types does the
Clean type system not support?

I realize thoroughly answering any of my questions is a large task, but any
information would be appreciated.

-Nick