Commit d2eb344a authored by Alec Theriault's avatar Alec Theriault Committed by Ben Gamari

Fix tests for `integer-simple`

A bunch of tests for `integer-simple` were now broken for a foolish reason:
unlike the `integer-gmp` case, there is no CorePrep optimization for turning
small integers directly into applications of `S#`.

Rather than port this optimization to `integer-simple` (which would involve
moving a bunch of `integer-simple` names into `PrelNames`), I switched
as many tests as possible to use `Int`.

The printing of `Integer` is already tested in `print037`.
parent f7def747
...@@ -467,9 +467,6 @@ def have_gdb( ): ...@@ -467,9 +467,6 @@ def have_gdb( ):
def have_readelf( ): def have_readelf( ):
return config.have_readelf return config.have_readelf
# Many tests sadly break with integer-simple due to GHCi's ignorance of it.
broken_without_gmp = unless(have_library('integer-gmp'), expect_broken(16043))
# --- # ---
def high_memory_usage(name, opts): def high_memory_usage(name, opts):
......
...@@ -9,7 +9,7 @@ data SafeList x y where ...@@ -9,7 +9,7 @@ data SafeList x y where
safeHead :: SafeList x NonEmpty -> x safeHead :: SafeList x NonEmpty -> x
safeHead (Cons x _) = x safeHead (Cons x _) = x
foo = Cons 3 (Cons 6 (Cons 9 Nil)) foo = Cons (3 :: Int) (Cons 6 (Cons 9 Nil))
data Dict x where data Dict x where
...@@ -17,4 +17,4 @@ data Dict x where ...@@ -17,4 +17,4 @@ data Dict x where
DictE :: Eq x => x -> Dict x DictE :: Eq x => x -> Dict x
data Exist where data Exist where
Exist :: forall a. a -> Exist Exist :: forall a. a -> Exist
\ No newline at end of file
...@@ -5,7 +5,7 @@ qsort [] = [] ...@@ -5,7 +5,7 @@ qsort [] = []
qsort (a:as) = (qsort left) ++ [a] ++ (qsort right) qsort (a:as) = (qsort left) ++ [a] ++ (qsort right)
where (left,right) = (filter (<=a) as, filter (>a) as) where (left,right) = (filter (<=a) as, filter (>a) as)
run = qsort [8, 4, 0, 3, 1, 23, 11, 18] run = qsort [8 :: Int, 4, 0, 3, 1, 23, 11, 18]
-- > run -- > run
-- [0,1,3,4,8,11,18,23] -- [0,1,3,4,8,11,18,23]
\ No newline at end of file
:seti -XMonomorphismRestriction :seti -XMonomorphismRestriction
:l T2740.hs :l T2740.hs
:step f 1 2 3 :step f (1 :: Int) 2 3
:print x :print x
:print y :print y
:force x :force x
......
Stopped in Test.f, T2740.hs:3:11-13 Stopped in Test.f, T2740.hs:3:11-13
_result :: Bool = _ _result :: Bool = _
x :: Integer = 1 x :: Int = 1
y :: Integer = 2 y :: Int = 2
x = 1 x = 1
y = 2 y = 2
x = 1 x = 1
......
...@@ -3,22 +3,22 @@ setTestOpts([extra_run_opts('-ignore-dot-ghci'), ...@@ -3,22 +3,22 @@ setTestOpts([extra_run_opts('-ignore-dot-ghci'),
normalise_slashes]) normalise_slashes])
test('print001', broken_without_gmp, ghci_script, ['print001.script']) test('print001', normal, ghci_script, ['print001.script'])
test('print002', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print002.script']) test('print002', extra_files(['../Test.hs']), ghci_script, ['print002.script'])
test('print003', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print003.script']) test('print003', extra_files(['../Test.hs']), ghci_script, ['print003.script'])
test('print004', broken_without_gmp, ghci_script, ['print004.script']) test('print004', normal, ghci_script, ['print004.script'])
test('print005', [broken_without_gmp, extra_files(['../QSort.hs'])], ghci_script, ['print005.script']) test('print005', extra_files(['../QSort.hs']), ghci_script, ['print005.script'])
test('print006', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print006.script']) test('print006', extra_files(['../Test.hs']), ghci_script, ['print006.script'])
test('print007', extra_files(['../Test.hs']), ghci_script, ['print007.script']) test('print007', extra_files(['../Test.hs']), ghci_script, ['print007.script'])
test('print008', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print008.script']) test('print008', extra_files(['../Test.hs']), ghci_script, ['print008.script'])
test('print009', normal, ghci_script, ['print009.script']) test('print009', normal, ghci_script, ['print009.script'])
test('print010', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print010.script']) test('print010', extra_files(['../Test.hs']), ghci_script, ['print010.script'])
test('print011', extra_files(['../Test.hs']), ghci_script, ['print011.script']) test('print011', extra_files(['../Test.hs']), ghci_script, ['print011.script'])
test('print012', [broken_without_gmp, extra_files(['../GADT.hs', '../Test.hs'])], ghci_script, ['print012.script']) test('print012', extra_files(['../GADT.hs', '../Test.hs']), ghci_script, ['print012.script'])
test('print013', [broken_without_gmp, extra_files(['../GADT.hs'])], ghci_script, ['print013.script']) test('print013', extra_files(['../GADT.hs']), ghci_script, ['print013.script'])
test('print014', [broken_without_gmp, extra_files(['../GADT.hs'])], ghci_script, ['print014.script']) test('print014', extra_files(['../GADT.hs']), ghci_script, ['print014.script'])
test('print016', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print016.script']) test('print016', extra_files(['../Test.hs']), ghci_script, ['print016.script'])
test('print017', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print017.script']) test('print017', extra_files(['../Test.hs']), ghci_script, ['print017.script'])
test('print018', extra_files(['../Test.hs']), ghci_script, ['print018.script']) test('print018', extra_files(['../Test.hs']), ghci_script, ['print018.script'])
test('print019', extra_files(['../Test.hs']), ghci_script, ['print019.script']) test('print019', extra_files(['../Test.hs']), ghci_script, ['print019.script'])
...@@ -31,12 +31,12 @@ test('print021', normal, ghci_script, ['print021.script']) ...@@ -31,12 +31,12 @@ test('print021', normal, ghci_script, ['print021.script'])
test('print022', test('print022',
[when(arch('powerpc64'), expect_broken(14455))], [when(arch('powerpc64'), expect_broken(14455))],
ghci_script, ['print022.script']) ghci_script, ['print022.script'])
test('print023', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print023.script']) test('print023', extra_files(['../Test.hs']), ghci_script, ['print023.script'])
test('print024', [broken_without_gmp, extra_files(['../Test.hs'])], ghci_script, ['print024.script']) test('print024', extra_files(['../Test.hs']), ghci_script, ['print024.script'])
test('print025', normal, ghci_script, ['print025.script']) test('print025', normal, ghci_script, ['print025.script'])
test('print026', normal, ghci_script, ['print026.script']) test('print026', normal, ghci_script, ['print026.script'])
test('print027', normal, ghci_script, ['print027.script']) test('print027', normal, ghci_script, ['print027.script'])
test('print028', broken_without_gmp, ghci_script, ['print028.script']) test('print028', normal, ghci_script, ['print028.script'])
test('print029', normal, ghci_script, ['print029.script']) test('print029', normal, ghci_script, ['print029.script'])
test('print030', extra_files(['print029.hs']), ghci_script, ['print030.script']) test('print030', extra_files(['print029.hs']), ghci_script, ['print030.script'])
test('print031', normal, ghci_script, ['print031.script']) test('print031', normal, ghci_script, ['print031.script'])
...@@ -47,11 +47,11 @@ test('print035', extra_files(['../Unboxed.hs']), ghci_script, ['print035.script' ...@@ -47,11 +47,11 @@ test('print035', extra_files(['../Unboxed.hs']), ghci_script, ['print035.script'
test('print036', expect_broken(9046), ghci_script, ['print036.script']) test('print036', expect_broken(9046), ghci_script, ['print036.script'])
test('print037', normal, ghci_script, ['print037.script']) test('print037', normal, ghci_script, ['print037.script'])
test('break001', [broken_without_gmp, extra_files(['../Test2.hs'])], ghci_script, ['break001.script']) test('break001', extra_files(['../Test2.hs']), ghci_script, ['break001.script'])
test('break002', extra_files(['../Test2.hs']), ghci_script, ['break002.script']) test('break002', extra_files(['../Test2.hs']), ghci_script, ['break002.script'])
test('break003', extra_files(['../Test3.hs']), ghci_script, ['break003.script']) test('break003', extra_files(['../Test3.hs']), ghci_script, ['break003.script'])
test('break005', [broken_without_gmp, extra_files(['../QSort.hs'])], ghci_script, ['break005.script']) test('break005', extra_files(['../QSort.hs']), ghci_script, ['break005.script'])
test('break006', [broken_without_gmp, extra_files(['../Test3.hs'])], ghci_script, ['break006.script']) test('break006', extra_files(['../Test3.hs']), ghci_script, ['break006.script'])
test('break007', extra_files(['Break007.hs']), ghci_script, ['break007.script']) test('break007', extra_files(['Break007.hs']), ghci_script, ['break007.script'])
test('break008', extra_files(['../Test3.hs']), ghci_script, ['break008.script']) test('break008', extra_files(['../Test3.hs']), ghci_script, ['break008.script'])
test('break009', [extra_files(['../Test6.hs']), test('break009', [extra_files(['../Test6.hs']),
...@@ -74,12 +74,10 @@ test('break020', extra_files(['Break020b.hs']), ghci_script, ['break020.script'] ...@@ -74,12 +74,10 @@ test('break020', extra_files(['Break020b.hs']), ghci_script, ['break020.script']
test('break021', extra_files(['Break020b.hs', 'break020.hs']), ghci_script, ['break021.script']) test('break021', extra_files(['Break020b.hs', 'break020.hs']), ghci_script, ['break021.script'])
test('break024', combined_output, ghci_script, ['break024.script']) test('break024', combined_output, ghci_script, ['break024.script'])
test('break025', normal, ghci_script, ['break025.script']) test('break025', normal, ghci_script, ['break025.script'])
test('break026', broken_without_gmp, ghci_script, ['break026.script']) test('break026', normal, ghci_script, ['break026.script'])
test('break027', [broken_without_gmp, extra_files(['../QSort.hs'])], ghci_script, ['break027.script']) test('break027', extra_files(['../QSort.hs']), ghci_script, ['break027.script'])
test('break028', normal, ghci_script, ['break028.script'])
test('dynbrk001', extra_files(['../QSort.hs']), ghci_script, ['dynbrk001.script']) test('dynbrk001', extra_files(['../QSort.hs']), ghci_script, ['dynbrk001.script'])
test('dynbrk002', [broken_without_gmp, extra_files(['../QSort.hs'])], ghci_script, ['dynbrk002.script']) test('dynbrk002', extra_files(['../QSort.hs']), ghci_script, ['dynbrk002.script'])
test('dynbrk003', normal, ghci_script, ['dynbrk003.script']) test('dynbrk003', normal, ghci_script, ['dynbrk003.script'])
test('dynbrk004', extra_files(['../mdo.hs']), ghci_script, ['dynbrk004.script']) test('dynbrk004', extra_files(['../mdo.hs']), ghci_script, ['dynbrk004.script'])
test('dynbrk005', [extra_files(['TupleN.hs']), expect_broken(1530)], test('dynbrk005', [extra_files(['TupleN.hs']), expect_broken(1530)],
...@@ -94,12 +92,12 @@ test('listCommand001', [extra_files(['../Test3.hs']), ...@@ -94,12 +92,12 @@ test('listCommand001', [extra_files(['../Test3.hs']),
combined_output], ghci_script, ['listCommand001.script']) combined_output], ghci_script, ['listCommand001.script'])
test('listCommand002', normal, ghci_script, ['listCommand002.script']) test('listCommand002', normal, ghci_script, ['listCommand002.script'])
test('hist001', [broken_without_gmp, extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')], test('hist001', [extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')],
ghci_script, ['hist001.script']) ghci_script, ['hist001.script'])
test('hist002', [broken_without_gmp, extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')], test('hist002', [extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')],
ghci_script, ['hist002.script']) ghci_script, ['hist002.script'])
test('T2740', broken_without_gmp, ghci_script, ['T2740.script']) test('T2740', normal, ghci_script, ['T2740.script'])
test('getargs', extra_files(['../getargs.hs']), ghci_script, ['getargs.script']) test('getargs', extra_files(['../getargs.hs']), ghci_script, ['getargs.script'])
test('T7386', normal, ghci_script, ['T7386.script']) test('T7386', normal, ghci_script, ['T7386.script'])
......
:l Test2 :l Test2
:b 3 :b 3
:b 5 :b 5
f (1 :: Integer) f (1 :: Int)
:st :st
-- Test that the binding for x is now gone -- Test that the binding for x is now gone
:show bindings :show bindings
......
Breakpoint 0 activated at Test2.hs:3:7-9 Breakpoint 0 activated at Test2.hs:3:7-9
Breakpoint 1 activated at Test2.hs:5:7 Breakpoint 1 activated at Test2.hs:5:7
Stopped in Test2.f, Test2.hs:3:7-9 Stopped in Test2.f, Test2.hs:3:7-9
_result :: Integer = _ _result :: Int = _
x :: Integer = 1 x :: Int = 1
Stopped in Test2.g, Test2.hs:5:7 Stopped in Test2.g, Test2.hs:5:7
_result :: Integer = _ _result :: Int = _
y :: Integer = 1 y :: Int = 1
y :: Integer = 1 y :: Int = 1
_result :: Integer = _ _result :: Int = _
1 1
y = 1 y = 1
() ()
......
:l QSort :l QSort
:st qsort [1::Integer,2] :st qsort [1::Int,2]
:step :step
seq left () seq left ()
:print left :print left
Stopped in QSort.qsort, QSort.hs:5:16-51 Stopped in QSort.qsort, QSort.hs:5:16-51
_result :: [Integer] = _ _result :: [Int] = _
a :: Integer = 1 a :: Int = 1
left :: [Integer] = _ left :: [Int] = _
right :: [Integer] = _ right :: [Int] = _
Stopped in QSort.qsort, QSort.hs:5:17-26 Stopped in QSort.qsort, QSort.hs:5:17-26
_result :: [a] = _ _result :: [a] = _
left :: [a] = _ left :: [a] = _
......
:l Test3.hs :l Test3.hs
:st mymap (+1) [1::Integer,2,3] :st mymap (+1) [1::Int,2,3]
:show bindings :show bindings
f x -- should fail, unknown return type f x -- should fail, unknown return type
let y = f x let y = f x
...@@ -7,6 +7,6 @@ y ...@@ -7,6 +7,6 @@ y
:p y :p y
:force y :force y
:show bindings :show bindings
-- we know the result is Integer now -- we know the result is Int now
f x f x
-- should work now -- should work now
Stopped in Main.mymap, Test3.hs:2:18-31 Stopped in Main.mymap, Test3.hs:2:18-31
_result :: [a] = _ _result :: [a] = _
f :: Integer -> a = _ f :: Int -> a = _
x :: Integer = 1 x :: Int = 1
xs :: [Integer] = [2,3] xs :: [Int] = [2,3]
xs :: [Integer] = [2,3] xs :: [Int] = [2,3]
f :: Integer -> a = _ f :: Int -> a = _
x :: Integer = 1 x :: Int = 1
_result :: [a] = _ _result :: [a] = _
y = (_t1::a) y = (_t1::a)
y = 2 y = 2
xs :: [Integer] = [2,3] xs :: [Int] = [2,3]
f :: Integer -> Integer = _ f :: Int -> Int = _
x :: Integer = 1 x :: Int = 1
_result :: [Integer] = _ _result :: [Int] = _
y :: Integer = 2 y :: Int = 2
_t1 :: Integer = 2 _t1 :: Int = 2
2 2
:load break026 :load break026
:step foldl (+) 0 [1::Integer .. 5] :step foldl (+) 0 [1::Int .. 5]
:step :step
:step :step
:force c :force c
-- answer should be 1 -- answer should be 1
:load break026 :load break026
:step foldl (+) 0 [1::Integer .. 5] :step foldl (+) 0 [1::Int .. 5]
:step :step
:step :step
-- a diversion to single-step the evaluation of c: -- a diversion to single-step the evaluation of c:
......
Stopped in Test.foldl, break026.hs:5:16-22 Stopped in Test.foldl, break026.hs:5:16-22
_result :: Integer = _ _result :: Int = _
c :: Integer = 0 c :: Int = 0
go :: Integer -> [t1] -> Integer = _ go :: Int -> [t1] -> Int = _
xs :: [t1] = _ xs :: [t1] = _
Stopped in Test.foldl.go, break026.hs:7:23-35 Stopped in Test.foldl.go, break026.hs:7:23-35
_result :: Integer = _ _result :: Int = _
c :: Integer = 0 c :: Int = 0
f :: Integer -> Integer -> Integer = _ f :: Int -> Int -> Int = _
x :: Integer = 1 x :: Int = 1
xs :: [Integer] = _ xs :: [Int] = _
Stopped in Test.foldl.go, break026.hs:7:23-35 Stopped in Test.foldl.go, break026.hs:7:23-35
_result :: t = _ _result :: t = _
c :: t = _ c :: t = _
f :: t -> Integer -> t = _ f :: t -> Int -> t = _
x :: Integer = 2 x :: Int = 2
xs :: [Integer] = _ xs :: [Int] = _
c = 1 c = 1
Stopped in Test.foldl, break026.hs:5:16-22 Stopped in Test.foldl, break026.hs:5:16-22
_result :: Integer = _ _result :: Int = _
c :: Integer = 0 c :: Int = 0
go :: Integer -> [t1] -> Integer = _ go :: Int -> [t1] -> Int = _
xs :: [t1] = _ xs :: [t1] = _
Stopped in Test.foldl.go, break026.hs:7:23-35 Stopped in Test.foldl.go, break026.hs:7:23-35
_result :: Integer = _ _result :: Int = _
c :: Integer = 0 c :: Int = 0
f :: Integer -> Integer -> Integer = _ f :: Int -> Int -> Int = _
x :: Integer = 1 x :: Int = 1
xs :: [Integer] = _ xs :: [Int] = _
Stopped in Test.foldl.go, break026.hs:7:23-35 Stopped in Test.foldl.go, break026.hs:7:23-35
_result :: t = _ _result :: t = _
c :: t = _ c :: t = _
f :: t -> Integer -> t = _ f :: t -> Int -> t = _
x :: Integer = 2 x :: Int = 2
xs :: [Integer] = _ xs :: [Int] = _
Stopped in Test.foldl.go, break026.hs:7:27-31 Stopped in Test.foldl.go, break026.hs:7:27-31
_result :: Integer = _ _result :: Int = _
c :: Integer = 0 c :: Int = 0
f :: Integer -> Integer -> Integer = _ f :: Int -> Int -> Int = _
x :: Integer = 1 x :: Int = 1
() ()
1 1
:l QSort :l QSort
:break qsort :break qsort
qsort [3::Integer,2,1] qsort [3::Int,2,1]
:i a :i a
Breakpoint 0 activated at QSort.hs:4:12-13 Breakpoint 0 activated at QSort.hs:4:12-13
Breakpoint 1 activated at QSort.hs:5:16-51 Breakpoint 1 activated at QSort.hs:5:16-51
Stopped in QSort.qsort, QSort.hs:5:16-51 Stopped in QSort.qsort, QSort.hs:5:16-51
_result :: [Integer] = _ _result :: [Int] = _
a :: Integer = 3 a :: Int = 3
left :: [Integer] = _ left :: [Int] = _
right :: [Integer] = _ right :: [Int] = _
a :: Integer -- Defined in ‘interactive:Ghci1’ a :: Int -- Defined in ‘interactive:Ghci1’
Breakpoint 0 activated at QSort.hs:5:16-51 Breakpoint 0 activated at QSort.hs:5:16-51
Stopped in QSort.qsort, QSort.hs:5:16-51 Stopped in QSort.qsort, QSort.hs:5:16-51
_result :: [Integer] = _ _result :: [Int] = _
a :: Integer = 8 a :: Int = 8
left :: [Integer] = _ left :: [Int] = _
right :: [Integer] = _ right :: [Int] = _
...@@ -5,7 +5,15 @@ let f = Just (1.2::Float) ...@@ -5,7 +5,15 @@ let f = Just (1.2::Float)
f f
:p f :p f
let i = Just (10::Integer) -- With @integer-gmp@, small integer literals get converted directly into
-- @S# 10#@. This optimization means that small integers are always already
-- evaluated in the output for @:p@.
--
-- Since we want this test to work on @integer-simple@ too, we explicitly
-- force the literal.
let ten = 10 :: Integer
:f ten
let i = Just ten
:p i :p i
case i of Just j -> Control.Exception.evaluate j case i of Just j -> Control.Exception.evaluate j
...@@ -16,4 +24,4 @@ case i of Just j -> Control.Exception.evaluate j ...@@ -16,4 +24,4 @@ case i of Just j -> Control.Exception.evaluate j
let s = S1 'a' 'b' 'c' let s = S1 'a' 'b' 'c'
s s
:p s :p s
:sp s :sp s
\ No newline at end of file
Just 1.2 Just 1.2
f = Just 1.2 f = Just 1.2
ten = 10
i = Just 10 i = Just 10
10 10
i = Just 10 i = Just 10
......
-- Simple Recovery of types - opaque types -- Simple Recovery of types - opaque types
:set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving :set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:l Test :l Test
let t = O (map Just [[1,1],[2,2]]) let t = O (map Just [[1 :: Int,1],[2,2]])
:p t :p t
-- should have bound _t1 now -- should have bound _t1 now
:show bindings :show bindings
......
...@@ -9,7 +9,6 @@ it :: () = () ...@@ -9,7 +9,6 @@ it :: () = ()
_t3 :: [a0] = _ _t3 :: [a0] = _
_t2 :: a0 = _ _t2 :: a0 = _
() ()
t = O (Just [1,1] : (_t4::[Maybe [Integer]])) t = O (Just [1,1] : (_t4::[Maybe [Int]]))
() ()
t = O (Just [1,1] : (_t5::Maybe [Integer]) : t = O (Just [1,1] : (_t5::Maybe [Int]) : (_t6::[Maybe [Int]]))
(_t6::[Maybe [Integer]]))
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
:l QSort :l QSort
:break 5 :break 5
qsort [8::Integer, 4] qsort [8::Int, 4]
:p right :p right
seq right () seq right ()
......
Breakpoint 0 activated at QSort.hs:5:16-51 Breakpoint 0 activated at QSort.hs:5:16-51
Stopped in QSort.qsort, QSort.hs:5:16-51 Stopped in QSort.qsort, QSort.hs:5:16-51
_result :: [Integer] = _ _result :: [Int] = _
a :: Integer = 8 a :: Int = 8
left :: [Integer] = _ left :: [Int] = _
right :: [Integer] = _ right :: [Int] = _
right = (_t1::[Integer]) right = (_t1::[Int])
() ()
right = [] right = []
left = (_t2::[Integer]) left = (_t2::[Int])
() ()
left = 4 : (_t3::[Integer]) left = 4 : (_t3::[Int])
1 1
left = [4] left = [4]
Stopped in QSort.qsort, QSort.hs:5:16-51 Stopped in QSort.qsort, QSort.hs:5:16-51
_result :: [Integer] = _ _result :: [Int] = _
a :: Integer = 4 a :: Int = 4
left :: [Integer] = _ left :: [Int] = _
right :: [Integer] = _ right :: [Int] = _
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving :set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:l Test :l Test
let t = O (map Just [[1,1],[2,2]]) let t = O (map Just [[1 :: Int,1],[2,2]])
:p t :p t
seq _t1 () -- The contents of the opaque seq _t1 () -- The contents of the opaque
:p t :p t
...@@ -14,4 +14,4 @@ seq _t5 () -- The 2nd element of the list ...@@ -14,4 +14,4 @@ seq _t5 () -- The 2nd element of the list
seq _t7 () -- The 1st element of the outer list seq _t7 () -- The 1st element of the outer list
:p t :p t
-- The 1st Just must be completely typed, as we know the type of the list -- The 1st Just must be completely typed, as we know the type of the list
\ No newline at end of file
...@@ -4,7 +4,6 @@ t = O ((_t2::a0) : (_t3::[a0])) ...@@ -4,7 +4,6 @@ t = O ((_t2::a0) : (_t3::[a0]))
() ()
t = O ((_t4::a1) : (_t5::a1) : (_t6::[a1])) t = O ((_t4::a1) : (_t5::a1) : (_t6::[a1]))
() ()
t = O ((_t7::Maybe [Integer]) : Just [2,2] : t = O ((_t7::Maybe [Int]) : Just [2,2] : (_t8::[Maybe [Int]]))
(_t8::[Maybe [Integer]]))
() ()
t = O (Just [1,1] : Just [2,2] : (_t9::[Maybe [Integer]])) t = O (Just [1,1] : Just [2,2] : (_t9::[Maybe [Int]]))
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving :set -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:l Test :l Test
let t = O (map Just [[1,1],[2,2]]) let t = O (map Just [[1 :: Int,1],[2,2]])
:p t :p t
:t _t1 :t _t1
...@@ -11,4 +11,4 @@ seq _t1 () ...@@ -11,4 +11,4 @@ seq _t1 ()
:p t :p t
seq _t2 () seq _t2 ()
:p t :p t
:t _t4 :t _t4
\ No newline at end of file
...@@ -3,5 +3,5 @@ _t1 :: a0 ...@@ -3,5 +3,5 @@ _t1 :: a0
() ()
t = O ((_t2::a0) : (_t3::[a0])) t = O ((_t2::a0) : (_t3::[a0]))
() ()
t = O (Just [1,1] : (_t4::[Maybe [Integer]])) t = O (Just [1,1] : (_t4::[Maybe [Int]]))
_t4 :: [Maybe [Integer]] _t4 :: [Maybe [Int]]
o = O (_t1::a0) o = O (_t1::a0)
() ()
_t1 :: SafeList Integer NonEmpty _t1 :: SafeList Int NonEmpty
o = O (Cons 3 (_t4::SafeList Integer y0)) o = O (Cons 3 (_t4::SafeList Int y0))
() ()
o = O (Cons 3 (Cons 6 (_t9::SafeList Integer y0))) o = O (Cons 3 (Cons 6 (_t9::SafeList Int y0)))
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:set -XGADTs -XRankNTypes :set -XGADTs -XRankNTypes
:l GADT :l GADT
let d = DictN (1 :: Integer) let d = DictN (1 :: Int)
:p d :p d
seq _t1 () seq _t1 ()
:p d :p d
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
:set -XGADTs -XRankNTypes :set -XGADTs -XRankNTypes
:l GADT :l GADT
let e = Exist 1 let e = Exist (1 :: Int)
:p e :p e
let test = 0 :: Integer let test = 0 :: Int
:show bindings :show bindings
:force test :force test
:show bindings