Previously, the constraint for `baddDicts` got lost in the machinery,
and would be ambiguous in the `K1` instance. This commit copies the
Barbies default implementation almost verbatim, and seems to fix the
issue.
I think I must have left in some dodgy code... weird. Anyway, this
commit means that you don't have to satisfy some arbitrary `Arbitrary`
constraints to use an HKD as a monoid.
With this function, we can construct HKD structures for non-monoidal
types, without jumping through many weird hoops as we go. I'll push a
release soon!
Before Hackage, we should probably pick some actual library versions to
depend on. This commit does that, and removes the lens dependency, which
should make installation much faster.
Quite a giant refactor:
- The partial type has been generalised to `HKD f` for some
parameter-wrapping functor `f`.
- The internals of `field` and `position` are now handled by
`generic-lens`. It doesn't work yet, though.
A la generic lens, we dimap either side of the glens and ravel the whole
thing at the end. This might even optimise better, though I should
check. Still some weird issues with the predicate, but we'll get to that
shortly.
Why get a dog and bark yourself? This commit uses the generic-lens
internal functions to create the lenses, which means the error messages
will be substantially better.
Refactoring `position` with a proper error message. Tidied up a /lot/ of
the instances using the tuple isomorphism and a change from 'Maybe' to
'Last'.
Out of the doctests, into the suite. The lens tests have been added, and
everything /seems/ to be working. There are certainly 4800 tests that
seem to think so.
Before, they were all doctests. This commit adds actual tests, and
comments out the now-broken doctests. I mean, they all still work
/morally/ - their demonstrated behaviour is still fine if you have the
types set up and in scope.