Commit 4e92308f authored by simonm's avatar simonm
Browse files

[project @ 1999-02-19 17:11:59 by simonm]

Some test updates.
parent 1f4e6afc
......@@ -12,8 +12,5 @@
import Array
main =
let a1 = array (1,3) (zip ([1..4]) ['a'..'d']) in
let a1 = array (1::Int,3) (zip ([1..4]) ['a'..'d']) in
print (a1!2)
......@@ -6,6 +6,6 @@ import Array
main =
let
a1 = array (1,0) [(1,'a')]
a1 = array (1::Int,0) [(1,'a')]
in
print (a1!0)
......@@ -8,7 +8,7 @@ import Array
main =
let
a1 = array (1,0) []
a2 = array (0,1) (zip [0..] ['a'..'z'])
a1 = array (1::Int,0) []
a2 = array (0::Int,1) (zip [0..] ['a'..'z'])
in
print (a1::Array Int Int) >> print a2
......@@ -11,7 +11,7 @@ main =
a1 = array (0,10) (zip [0..10] ['a'..'z'])
in
print a1 >>
print (map (toUpper) a1) >>
print (fmap (toUpper) a1) >>
print (ixmap (3,8) (+1) a1)
......
......@@ -9,7 +9,7 @@ main = putStr (shows sub_b "\n")
sub_b = ixmap (102, 113) id b
b :: Array Int Double
b = map ( \ r -> fromRational r / pi )
b = fmap ( \ r -> fromRational r / pi )
(ixmap (101,200) (\ i -> toInteger i - 100) a)
a :: Array Integer (Ratio Integer)
......
......@@ -18,7 +18,7 @@ setup = let isz = 10
-- x <- newArray (0, omax) (error "uninitialised")
dmy <- newArray (0, imax) 0
x <- newArray (0, omax) dmy
as <- (accumulate . replicate osz) (newArray (0, imax) 6)
as <- (sequence . replicate osz) (newArray (0, imax) 6)
mapM_ (\(i,v) -> writeArray x i v) (zip [0..omax] as)
return x
......
......@@ -4,4 +4,4 @@ module ShouldCompile where
fubar :: IO Int
fubar = _ccall_ f >>_ccall_ b
--^ result type of f "lost" (never gets generalised)
-- ^ result type of f "lost" (never gets generalised)
......@@ -3,8 +3,8 @@ module Main(main) where
main :: IO ()
main = do
sequence (map putStrLn double_tests)
sequence (map putStrLn float_tests)
sequence_ (map putStrLn double_tests)
sequence_ (map putStrLn float_tests)
where
double_tests = run_tests double_numbers
float_tests = run_tests float_numbers
......
Fail: hello world!
\ No newline at end of file
Fail: hello world!
......@@ -5,5 +5,3 @@ ds002.hs:7: Pattern match(es) are overlapped in the definition of function `f':
ds002.hs:11: Pattern match(es) are overlapped in the definition of function `g':
g x y z = ...
......@@ -2,5 +2,3 @@
ds003.hs:5: Pattern match(es) are overlapped in the definition of function `f':
f (x : (x1 : (x2 : x3))) ~(y, ys) z = ...
f x y True = ...
......@@ -3,5 +3,3 @@ ds019.hs:5: Pattern match(es) are overlapped in the definition of function `f':
f d (j, k) p = ...
f (e, f, g) l q = ...
f h (m, n) r = ...
......@@ -11,5 +11,3 @@ ds020.hs:13: Pattern match(es) are overlapped in the definition of function `d':
ds020.hs:19: Pattern match(es) are overlapped in the definition of function `f':
f (x@~[]) = ...
......@@ -2,5 +2,3 @@
ds022.hs:20: Pattern match(es) are overlapped in the definition of function `i':
i 1 1.1 = ...
i 2 2.2 = ...
ds040.hs:7: Pattern match(es) are overlapped in the definition of function `^^^^':
^^^^ _ _ = ...
......@@ -2,5 +2,3 @@
ds043.hs:8: Pattern match(es) are overlapped in a group of case alternatives beginning
(B _ _ _ _ True False):
B {e = True, f = False} -> ...
dsrun005.hs:42: Non-exhaustive patterns in function f
Fail: dsrun005.hs:42: Non-exhaustive patterns in function f
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment