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

Remove the state parameter from fixture functions that do not return state #8

Closed
lexi-lambda opened this issue Jun 27, 2016 · 1 comment

Comments

@lexi-lambda
Copy link
Contributor

Given that state is so infrequently used as it is, and given that it’s very easy to ignore unused return values, I think the state argument should be removed from unTestFixture and logTestFixture, so their type signatures should be as follows:

unTestFixture :: TestFixture r () () a -> r (WS () ()) -> a
logTestFixture :: TestFixture r w () a -> r (WS w ()) -> w

With some nice type aliases (maybe making TestFixture an opaque newtype instead of a type alias) I think this would make the API a lot less confusing than it currently is.

@jxv
Copy link
Contributor

jxv commented Jun 27, 2016

+1 for newtypes

+1 for removing unit ()

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

No branches or pull requests

2 participants