Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array: add S.prepend #205

Merged
merged 1 commit into from
May 7, 2016
Merged

array: add S.prepend #205

merged 1 commit into from
May 7, 2016

Conversation

davidchambers
Copy link
Member

Closes #197

@davidchambers davidchambers force-pushed the dc-prepend branch 2 times, most recently from eda1ff5 to 72466d6 Compare May 3, 2016 17:04
@davidchambers
Copy link
Member Author

How does this look, @gilligan?

@gilligan
Copy link
Contributor

gilligan commented May 3, 2016

👍 looks good to me :)

});

it('type checks its arguments', function() {
throws(function() { S.prepend('a', 'bc'); },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we test the type checking of the final argument by adding a test that uses the placeholder as the first arg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you have in mind, Stefano? We test these failures:

prepend :: a -> Array a -> Array a
                ^^^^^^^
prepend :: a -> Array a -> Array a
           ^          ^

We don't test these failures:

prepend :: a -> Array a -> Array a
                           ^^^^^^^
prepend :: a -> Array a -> Array a
           ^                     ^

Assuming our function is implemented correctly, there's no way to test invalid return values. ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mind me, I'm losing my mind, I completely misread the first test there.

@davidchambers davidchambers merged commit b06a946 into master May 7, 2016
@davidchambers davidchambers deleted the dc-prepend branch May 7, 2016 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants