Commit Graph

63 Commits

Author SHA1 Message Date
Tom Harding
476d73a92e Revert "Use generic-deriving for Show instance"
Misunderstood how useful this would be, and broke production :(

This reverts commit 90d7fde513.
2019-08-15 16:43:40 +01:00
Tom Harding
90d7fde513 Use generic-deriving for Show instance
It's quite possible that more of the classes can be removed in favour of
generic-deriving, but this fixes #12 regardless.
2019-08-05 09:55:20 +01:00
Tom Harding
4aaa49e406 Add Data.Semigroup.Last to README
As per Jordan's suggestion in #4, I've added a note about GHC 8.8. I'm
probably not going to change the code until then, simply because it
makes things a bit uglier.
2019-08-05 09:17:27 +01:00
Tom Harding
4275824514 Tighten Construct constraint
Although we technically only "need" `Functor f` and `GConstruct` will in
turn imply `Applicative f`, it would be nice for the benefit of users if
it were clear in the signature that `Applicative` were required.
2019-08-05 09:13:41 +01:00
Tom Harding
609b212307 Remove redundant constraint
Just realised I copy-pasted myself into a mischief.
2019-08-05 09:13:25 +01:00
Tom Harding
c8155305f5
Merge pull request #14 from Philonous/nightly
Update for stackage nightly
2019-08-05 09:02:46 +01:00
Philipp Balzarek
3b9171e303 Relax doctests 2019-08-01 14:29:17 +02:00
Philipp Balzarek
4f2170e7b8 Relax version bounds 2019-08-01 14:29:04 +02:00
Tom Harding
90083c517d Version bump
Ready for release!
2019-06-27 11:53:11 +01:00
Tom Harding
bf240ae6ae Re-export Barbie classes
They're sufficiently well-used that it makes sense for them to be
available directly through this library.
2019-06-24 09:10:41 +01:00
Tom Harding
94171f3401 Add buniq to README
It's another perfectly legitimate way to construct an object!
2019-06-24 09:02:45 +01:00
Tom Harding
9c7b830bdc
Merge pull request #9 from jmackie/readme-test
Test the README
2019-06-24 08:50:14 +01:00
Tom Harding
7a3ed792eb Finish doc-checking
Nothing dramatic - just had to add a `Main` to keep everything happy,
and ignore the type error block.
2019-06-24 08:48:31 +01:00
Jordan Mackie
319c669c8c Test the README 2019-06-21 10:04:09 +01:00
Tom Harding
5a4dbe26f4 Documentation fix
Accidentally copied the wrong docs in.
2019-06-20 21:22:06 +01:00
Tom Harding
81a6ce7b67 Use generic-lens directly for position/field
Turns out, as @kcsongor suspected, we can use generic-lens directly by
exposing a generic rep for our HKD type. All the tests work fine, two
documentation updates. I'm very pleased!
2019-06-20 21:05:05 +01:00
Tom Harding
b34a9c707e Expose a generic rep for HKD
All we do is expose the internal rep "as" the generic rep. I need to do
a bit of experimentation, but this _might_ actually make the generic
lenses here redundant...
2019-06-15 18:19:51 +01:00
Tom Harding
7527a89678 Remove argument from label
It doesn't need one, and it just opens up more opportunities for type
ambiguities. Type-applying will go much better.
2019-06-15 18:18:07 +01:00
Tom Harding
ce88cc5f0b Expose Tuple class
For many of the instances, we use a transformation to and from a nested
tuple shape. For example, we can have an instance of `Eq` for any HKD by
converting it to nested tuples and using _that_ instance.

@pacak notes that, while this is fine in principal, not exposing it
means that we can't write functions on top of various internals that are
suitably polymorphic because we can't add this class as a constraint.

This commit exposes this class, and frees us all.
2019-06-10 10:02:02 +01:00
Tom Harding
286b7c16c4 Bump version
This is just a patch, no change to the interface (other than fixing a
bug), so it's a minor bump :)
2019-06-06 10:36:31 +01:00
Tom Harding
2f5c1a9bbf Fix baddDicts constraint-passing
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.
2019-06-06 10:29:02 +01:00
Tom Harding
ade772a64b
Merge pull request #6 from timsears/master
fix typos in README.md
2019-06-06 09:18:54 +01:00
Tim Sears
9291fe3521
fix typos in README.md 2019-06-04 12:02:25 -07:00
Tom Harding
84c0ea308d Relax Tuple instance constraints
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.
2019-05-20 10:10:07 +01:00
Tom Harding
cf65bf23f3 Documentation updates
Updating the README to support the new `Build` work.
2019-05-14 18:44:49 +01:00
Tom Harding
1950c65dff Add the Build function
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!
2019-05-14 18:16:59 +01:00
Tom Harding
3add3b33e2
Merge pull request #2 from gilligan/update-dep-versions
Loosen dependency constraints: use lts-13.17 versions
2019-04-17 11:37:30 +01:00
tobias pflug
6e333f8f95 Loosen dependency constraints: use lts-13.17 versions 2019-04-16 23:38:54 +02:00
Tom Harding
021ffb5d05 Hide some imports, fix some documentation
Nothing major - just a few bumps with Hackage.
2019-04-14 08:04:19 +01:00
Tom Harding
e1b89c1dd1 Finishing touches
Prepping for hackage :)
2019-04-13 00:59:33 +01:00
Tom Harding
b02220c9ea
Merge pull request #1 from kcsongor/patch-1
Fix typo in README
2019-04-12 16:07:04 +01:00
Tom Harding
17b8786547 Tighten package constraints
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.
2019-04-12 14:17:13 +01:00
Tom Harding
4a9113b127 README tweaks
Thanks to some keen eyes :)
2019-04-12 10:48:40 +01:00
Csongor Kiss
1fbc455b63
Fix typo in README 2019-04-11 21:02:34 +01:00
Tom Harding
57fb0b2913
Missed a comma
Forgive me, padre
2019-04-11 18:56:21 +01:00
Tom Harding
e401fb2f53 Update README
The README is now hopefully pretty comprehensive. I think we're ready to
go :)
2019-04-11 18:44:40 +01:00
Tom Harding
a52a9ef3ec Add Labels functions
We can do some cool stuff with the barbies library and a pinch of
generics. Here's an example.
2019-04-11 11:13:29 +01:00
Tom Harding
2e433c944b Start overhauling README
Nowhere near done, but it's at least more accurate now.
2019-04-11 09:05:50 +01:00
Tom Harding
68a0c1c6e0 Documentation and tests
Now that we support barbies, we need to re-jig a lot of the type
parameters. This commit does said jiggery.
2019-04-11 00:35:51 +01:00
Tom Harding
1d668675bb Add Barbies interface
The generic HKD now implements the full Barbies API.
2019-04-10 23:56:25 +01:00
Tom Harding
5e4a05c9e8 Fixed position lens
OMG it all works!
2019-04-10 21:27:47 +01:00
Tom Harding
25ee5c414c Fix "field" issues.
Invalid field names now report friendly generic-lens errors!
2019-04-10 20:42:11 +01:00
Tom Harding
1b41b1e354 [Broken] Generic lens / generic HKD
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.
2019-04-10 20:16:36 +01:00
Tom Harding
5fa70bb0e2 Use profunctor encoding
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.
2019-04-09 16:17:15 +01:00
Tom Harding
99a9585284 Use generic-lens for position and field lenses
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.
2019-04-09 15:38:05 +01:00
Tom Harding
b1313d91d2 --wip-- [skip ci] 2019-04-09 13:54:05 +01:00
Tom Harding
1dfd59dbab Add check for field population
Another little example using the lenses to see if a particular piece of
data is present.
2019-04-09 09:28:02 +01:00
Tom Harding
ccb3d9e46a Comprehensive README and renamed defaults
`withDefaults` is more sensible, I think. The README now contains a
bunch more examples along with their output!
2019-04-09 09:03:58 +01:00
Tom Harding
669ba4f712 [README] Dump an example
Again, unsatisfactory, but it will at least show the concept for now.
2019-04-08 23:06:35 +01:00
Tom Harding
fa2771be48 [WIP] README
Not done yet, but committing progress so far.
2019-04-08 22:51:58 +01:00