Changes between Version 15 and Version 16 of Language/Overview/EffectSystem

Show
Ignore:
Timestamp:
08/26/10 02:04:54 (4 years ago)
Author:
benl (IP: 203.206.176.236)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Overview/EffectSystem

    v15 v16  
    6363The Disciplined Disciple Compiler (DDC) uses this ''effect discipline'' to track which parts of the program cause computational effects and which are pure. This allows it to check the type safety of programs that use these effects, and to perform the same sort of code transformation style optimizations as done by other Haskell compilers such as GHC. 
    6464 
    65 However, none of this would be useful if you actually had to write these extended types in regular programs. It's a good thing then that, for the most part, you can ignore the extended information when writing programs. Because all the extra information is ''orthogonal'' to the main shape of the type, ie its argument and return data types, the compiler can fill this in for you behind the scenes. We call this ''type elaboration''. The extra information is present in the interface files and core language, but you'll only have to worry about it if you import foreign functions from C land or start to mix laziness with destructive update in the same program. 
     65However, none of this would be useful if you actually had to write these extended types in regular programs. It's a good thing then that, for the most part, you can ignore the extended information when writing programs. Because all the extra information is ''orthogonal'' to the main shape of the type, ie its argument and return data types, the compiler can fill this in for you behind the scenes. This is called ''type elaboration''. The extra information is present in the interface files and core language, but you'll only have to worry about it if you import foreign functions from C land or start to mix laziness with destructive update in the same program. 
    6666 
    6767The definition of `map` that you would write in a real Disciple program is just the same as in Haskell, including the type signature: