makefile fix and table with results so far added to ex3
[tt2015.git] / a3 / code / Generics / GenCompress.dcl
1 definition module GenCompress
2
3 import StdGeneric, StdMaybe
4
5 :: BitVector :== {#Int}
6
7 :: CompressSt
8
9 generic gCompress a :: !a -> *CompressSt -> *CompressSt
10 derive gCompress Int, Real, Bool, Char, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, [], {}, {!}
11
12 generic gCompressedSize a :: a -> Int
13 derive gCompressedSize Int, Real, Bool, Char, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, [], {}, {!}
14
15 generic gUncompress a :: (u:CompressSt -> ((Maybe a),u:CompressSt))
16 derive gUncompress Int, Real, Bool, Char, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, [], {}, {!}
17
18 compress :: !a -> BitVector | gCompressedSize{|*|} a & gCompress{|*|} a
19 uncompress :: (BitVector -> Maybe a) | gUncompress{|*|} a