nikita-volkov / refined

Refinement types with static checking
http://hackage.haskell.org/package/refined
MIT License
183 stars 31 forks source link

ensure that arbitrary for Refined will terminate #44

Closed chessai closed 5 years ago

chessai commented 5 years ago

@symbiont-joseph-kachmar this is what i came up with to resolve #40. let me know what you think.

chessai commented 5 years ago

most recent checks fail because i cancelled the builds (just changelog entry)

symbiont-joseph-kachmar commented 5 years ago

Sorry for the delay, but I think this makes sense!

I wish there was a better alternative to calling error here but I can't think of one, and this is primarily intended for test code anyway so it's not so bad.

chessai commented 5 years ago

well, luckily QuickCheck catches the errors, and we try to provide a decent error message here. but i agree that i wish you could fail inside of Gen instead of delegating the failure to the top level. maybe i don't actually wish that, but here it would be nice.