Fixed previously incorrect type equality check, commented code, add test
This commit is contained in:
parent
85f31b129b
commit
b1d3e31efd
3 changed files with 335 additions and 311 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue