Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Fix trie lookup, added a test to ensure memoized function doesn't get… #9

Merged
merged 4 commits into from
Apr 25, 2017

Conversation

jacereda
Copy link
Contributor

… called too much

@paf31
Copy link
Owner

paf31 commented Oct 28, 2016

Much simpler, thanks! Could you please merge with master here as well?

Copy link
Owner

@paf31 paf31 left a 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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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.

@paf31
Copy link
Owner

paf31 commented Apr 25, 2017

Thanks!

@paf31 paf31 merged commit 49879e0 into paf31:master Apr 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants