Fixed previously incorrect type equality check, commented code, add test

This commit is contained in:
sebastianselander 2023-03-28 14:31:20 +02:00
parent 85f31b129b
commit b1d3e31efd
3 changed files with 335 additions and 311 deletions

View file

@ -187,6 +187,31 @@ bes =
" Nil => 0 ;"
" };"
)
, testBe
"length function on int list infers correct signature"
( D.do
"data List () where {"
" Nil : List ()"
" Cons : Int -> List () -> List ()"
"};"
"length xs = case xs of {"
" Nil => 0 ;"
" Cons _ xs => 1 + length xs ;"
"};"
)
( D.do
"data List () where {"
" Nil : List ()"
" Cons : Int -> List () -> List ()"
"};"
"length : List () -> Int ;"
"length xs = case xs of {"
" Nil => 0 ;"
" Cons _ xs => 1 + length xs ;"
"};"
)
]
testSatisfy desc test satisfaction = specify desc $ run test `shouldSatisfy` satisfaction