From b3163aefcecd596fe200f9d3cb5ea82443767269 Mon Sep 17 00:00:00 2001 From: simonm Date: Wed, 7 Jan 1998 18:27:53 +0000 Subject: [PATCH] [project @ 1998-01-07 18:27:51 by simonm] add nofib/GHC_ONLY/array002 to the array test suite. --- ghc/tests/array/should_run/arr013.hs | 17 +++++++++++++++++ ghc/tests/array/should_run/arr013.stdout | 1 + 2 files changed, 18 insertions(+) create mode 100644 ghc/tests/array/should_run/arr013.hs create mode 100644 ghc/tests/array/should_run/arr013.stdout diff --git a/ghc/tests/array/should_run/arr013.hs b/ghc/tests/array/should_run/arr013.hs new file mode 100644 index 0000000..8dafb42 --- /dev/null +++ b/ghc/tests/array/should_run/arr013.hs @@ -0,0 +1,17 @@ +import Ratio -- 1.3 +import Array -- 1.3 +infix 1 =: +(=:) a b = (a,b) + +main = putStr (shows sub_b "\n") + where + sub_b :: Array Int Double + sub_b = ixmap (102, 113) id b + + b :: Array Int Double + b = map ( \ r -> fromRational r / pi ) + (ixmap (101,200) (\ i -> toInteger i - 100) a) + + a :: Array Integer (Ratio Integer) + a = array (1,100) ((1 =: 1) : [i =: fromInteger i * a!(i-1) + | i <- [2..100]]) diff --git a/ghc/tests/array/should_run/arr013.stdout b/ghc/tests/array/should_run/arr013.stdout new file mode 100644 index 0000000..a4093df --- /dev/null +++ b/ghc/tests/array/should_run/arr013.stdout @@ -0,0 +1 @@ +array (102, 113) [(102, 0.6366197723675814), (103, 1.909859317102744), (104, 7.639437268410976), (105, 38.197186342054884), (106, 229.1831180523293), (107, 1604.281826366305), (108, 12834.25461093044), (109, 115508.29149837396), (110, 1155082.9149837396), (111, 1.2705912064821135e7), (112, 1.5247094477785364e8), (113, 1.9821222821120973e9)] -- 1.7.10.4