Hi everyone,
I did the NICTA course with Tony down in melbourne a few months ago, and while we didn't have property based testing set up Tony showed us a way to use the props in the REPL...
So if I had:
-- | Return the length of the list.
--
-- >>> length (1 :. 2 :. 3 :. Nil)
-- 3
--
-- prop> sum (map (const 1) x) == length x
length ::
List a
-> Int
length = undefined
I could do something like:
>> props x = sum (map (const 1) x) == length x
>> props (1:.2:.3:.4:.Nil)
true
But clearly I've forgotten how to do it properly because all I get is:
<interactive>:93:8: parse error on input ‘=’
Cheers,
Jim