Converting from Haskell 1.2 to 1.4
Haskell 1.4 (the differences is really between 1.2 and 1.3) has some
substantial differences compared to Haskell 1.2. Here is a short
guide how to convert your programs without too much pain.
I/O
The most radical change is the I/O system. You should really convert
to the new more powerful I/O system. It is described in the Haskell report.
If you feel really lazy you can use the old I/O with compatibility
libraries. To do this you should add one of these imports:
import DialogueIO
import ContinuationIO
and convert the old main function like this
main = dialogueToIO oldmain
class Text
The class Text has been split into the classes Read
and Show. If you do not use any reading (few people do :-)
all you need to do is to change Text
to Show
everywhere.
Arrays
The syntax of associations have changed and arrays have been moved
into a separate library. Change all occurences of ``x :=
e
'' to ``(x, e)
'' and do a
import Array
Old Prelude functions
Some prelude functions have moved into libraries. You need to add
imports of these if you have used any of them.
isAlpha
& co
import Char
- Rational numbers
import Ratio
- Complex numbers
import Complex
- zip4-7 & co
import List
Some Prelude entities are gone and replaced by more general ones.
ord --> fromEnum
chr --> toEnum
minInt --> minBound
maxInt --> maxBound
minChar --> minBound
maxChar --> maxBound
New Prelude stuff
There are some new useful things in the Prelude that previously needed
to be imported from libraries.
data Maybe = Nothing | Just a
data Either = Left a | Right b
lookup :: (Eq a) => a -> [(a, b)] -> Maybe b
concatMap :: (a -> [b]) -> [a] -> [b]
replicate :: Int -> a -> [a]
HBC libraries
All of the functionality of the old HBC libraries is still there, but
some of the functions have changed named to adhere to the new upcoming
library standard and to avoid clashes with the new Prelude. Consult
the library documentation and
HBC library documentation to find
out more.
To get the trace function you need to do
import NonStdTrace
Last modified: Thu Jan 30 12:38:26 MET 1997