Some test updates.
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)
-
-
-
main =
let
- a1 = array (1,0) [(1,'a')]
+ a1 = array (1::Int,0) [(1,'a')]
in
print (a1!0)
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
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)
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)
-- 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
fubar :: IO Int
fubar = _ccall_ f >>_ccall_ b
- --^ result type of f "lost" (never gets generalised)
+ -- ^ result type of f "lost" (never gets generalised)
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!
ds002.hs:11: Pattern match(es) are overlapped in the definition of function `g':
g x y z = ...
-
-
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 = ...
-
-
f d (j, k) p = ...
f (e, f, g) l q = ...
f h (m, n) r = ...
-
-
ds020.hs:19: Pattern match(es) are overlapped in the definition of function `f':
f (x@~[]) = ...
-
-
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 `^^^^':
^^^^ _ _ = ...
-
-
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
+