musou wrote
yeesh that sounds like no fun at all. i tried using the erlang version of that quickcheck library for property based testing in elixir and also found it hard to use effectively. the docs weren't great and i couldn't always figure out how to make the generators specific enough. i just stick with type annotations and unit tests and that's usually good enough for the kind of thing i do.
for what little its worth ive had an easier time using stack with haskell instead of cabal, but only because the book i was learning from used it. but googling for solutions to haskell problems has gotten more difficult now that there's two competing toolchains
Moonside OP wrote
I can't avoid making up a conspiracy theory that QuickCheck library presently exists as an advert for QuviQ AB and this perhaps goes even further for the Erlang version. Good enough to become somewhat well-known and whet your appetite and then when you get serious, you need to bring consults in.
I was only testing simple mathematical properties (semigroup/monoid/group/Abelian group laws and involutivity) where generator specificity doesn't matter that much. The properties are so general that if a fault was discovered, it would taint a function for all inputs, even accidentally correct.
The one upshot of the whole shebang was that I got to reimplement some stuff as groups and I could just feel the power rushing through my veins ad hoc 'negation' functions into invert
ones. Actually now I looked more into the docs and noticed that Haskell also has Abelian groups as a type class and I added them too to my types.
(It would be really nice if there was something that could automatize writing tests for common typeclasses. I have two types that have instances of semigroups, monoids, groups and Abelian groups and doing tests like I did means that testing their properties and a direct consequence of one took 14 tests which is kind of gross when you could write generic code.)
for what little its worth ive had an easier time using stack with haskell instead of cabal, but only because the book i was learning from used it. but googling for solutions to haskell problems has gotten more difficult now that there's two competing toolchains
I tried out Stack because there's some Emacs tooling around that, but the tooling was quite brittle which soured me a bit on that. There seems to be some amount of Stack related drama in the Haskell community and some people I've learned from have a strong distaste for Stack in favor of Cabal. I'm not in a place to know enough to switch and the problem wasn't really Cabal related. Rather it was, in the small, that the solution involved Template Haskell and sequencing IO actions both of which I haven't done before and, in the large, that no-one has bothered to write documentation or a tutorial on the bird's eye view of things. Or what a best practices could be, I'm not Haskell literate to just see what popular packages are doing.
Viewing a single comment thread. View all comments