Commit e954c4d1 authored by Pepe Iborra's avatar Pepe Iborra
Browse files

Added more tests with newtypes

parent b358d0fd
......@@ -13,6 +13,18 @@ data List1 a = Nil | a :^ (List1 a)
newtype MyInt = My Int
deriving (Eq,Show,Num, Enum)
newtype MkT a = MkT a
deriving (Show)
data MkT2 a = MkT2 (MkT a)
deriving Show
data Param2 s r = P2 (FakeSTRef r (s(Param2 s r)))
| P2Nil
data FakeSTRef r s = Ref s
testParam2 = O (P2 (Ref P2Nil))
infixr 5 :^
--test T{t=t1} = undefined
......
......@@ -12,4 +12,8 @@ test('print010', normal, ghci_script, ['print010.script'])
test('print011', normal, ghci_script, ['print011.script'])
test('print012', normal, ghci_script, ['print012.script'])
test('print013', normal, ghci_script, ['print013.script'])
test('print014', normal, ghci_script, ['print014.script'])
\ No newline at end of file
test('print014', normal, ghci_script, ['print014.script'])
test('print015', normal, ghci_script, ['print015.script'])
test('print016', normal, ghci_script, ['print016.script'])
test('print017', normal, ghci_script, ['print017.script'])
\ No newline at end of file
-- Data.Set makes for a wondeful test of unboxed fields
:m +Data.Set
let s = fromList [1,2,3]
s
:p s
-- Type reconstruction with newtypes involved, more gruesome. Can't solve this one for now
:set -fglasgow-exts
:l ../Test
let a = map MkT [1..2]
:p a
seq _t1 ()
:p a
seq _t2 ()
:p a
\ No newline at end of file
a = (_t1::[MkT Integer])
()
a = [(_t2::MkT Integer) | (_t3::[MkT Integer])]
()
a = [MkT 1 | (_t4::[MkT Integer])]
-- More newtypes goodness
:set -fglasgow-exts
:l ../Test
let a = map (MkT2 . MkT) [1..2]
:p a
seq _t1 ()
:p a
seq _t2 ()
:p a
seq _t4 ()
:p a
a = (_t1::[MkT2 Integer])
()
a = [(_t2::MkT2 Integer) | (_t3::[MkT2 Integer])]
()
a = [MkT2 (_t4::MkT Integer) | (_t5::[MkT2 Integer])]
()
a = [MkT2 (MkT 1) | (_t6::[MkT2 Integer])]
Supports Markdown
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