-
Notifications
You must be signed in to change notification settings - Fork 4
Fix trie lookup, added a test to ensure memoized function doesn't get… #9
Conversation
Much simpler, thanks! Could you please merge with master here as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I reviewed this ages ago and forgot to submit the review :(
modifyRef called (_ + 1) | ||
pure $ fn n | ||
quickCheck' 10000 $ \(SmallInt x) -> fn x == msin x | ||
ncalled <- readRef called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! 😄
test/Main.purs
Outdated
pure $ fn n | ||
quickCheck' 10000 $ \(SmallInt x) -> fn x == msin x | ||
ncalled <- readRef called | ||
quickCheck' 1 $ ncalled < 2000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use Test.Assert
here and provide an error message.
test/Main.purs
Outdated
@@ -18,12 +24,25 @@ data Ints | |||
= Int1 Int | |||
| Int2 Int | |||
|
|||
derive instance genericInts :: Generic Ints _ | |||
instance genericInts :: G.Generic Ints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please leave this as-is? It should build with the compiler in master
.
Thanks! |
… called too much