equal
deleted
inserted
replaced
2 |
2 |
3 import Control.Monad; |
3 import Control.Monad; |
4 import Control.Exception; |
4 import Control.Exception; |
5 import System.IO; |
5 import System.IO; |
6 import System.Exit; |
6 import System.Exit; |
|
7 import qualified Typerep; |
7 import qualified Generated_Code; |
8 import qualified Generated_Code; |
8 |
9 |
9 type Pos = [Int]; |
10 type Pos = [Int]; |
10 |
11 |
11 -- Term refinement |
12 -- Term refinement |
65 sumMapM f n [] = return n; |
66 sumMapM f n [] = return n; |
66 sumMapM f n (a:as) = seq n (do m <- f a ; sumMapM f (n+m) as); |
67 sumMapM f n (a:as) = seq n (do m <- f a ; sumMapM f (n+m) as); |
67 |
68 |
68 -- Testable |
69 -- Testable |
69 |
70 |
70 instance Show Generated_Code.Typerep where { |
71 instance Show Typerep.Typerep where { |
71 show (Generated_Code.Typerep c ts) = "Type (\"" ++ c ++ "\", " ++ show ts ++ ")"; |
72 show (Typerep.Typerep c ts) = "Type (\"" ++ c ++ "\", " ++ show ts ++ ")"; |
72 }; |
73 }; |
73 |
74 |
74 instance Show Generated_Code.Term where { |
75 instance Show Generated_Code.Term where { |
75 show (Generated_Code.Const c t) = "Const (\"" ++ c ++ "\", " ++ show t ++ ")"; |
76 show (Generated_Code.Const c t) = "Const (\"" ++ c ++ "\", " ++ show t ++ ")"; |
76 show (Generated_Code.App s t) = "(" ++ show s ++ ") $ (" ++ show t ++ ")"; |
77 show (Generated_Code.App s t) = "(" ++ show s ++ ") $ (" ++ show t ++ ")"; |