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

Add heterogeneous helper functions and restructure internals #33

Merged
merged 25 commits into from
Oct 22, 2018

Conversation

thomashoneyman
Copy link
Owner

@thomashoneyman thomashoneyman commented Oct 19, 2018

What does this pull request do?

Provides a solution for #18 and #19 by adding helper functions based on heterogeneous. Also restructures some internals and classes to minimize the number of constraints that exist on the Formless component to save some compile times.

Unfortunately, pending some resolution in the Heterogeneous library (see: natefaubion/purescript-heterogeneous#2), no heterogeneous constraints can be placed on the Formless component without breaking the library, so all changes directly on the component have had to be reverted.

Still, a number of new helper functions are available and the exercise cleaned up the internals of the library.

How should this be manually tested?

Verify that the example components still work as expected.

Other Notes:

This PR changes the namespaces of several functions, and if users are not importing from the main Formless module, they will see breaking changes. However, existing functionality has been maintained. If users are importing from the main Formless module, then this change will have no effect on their code.

@thomashoneyman thomashoneyman self-assigned this Oct 19, 2018
This was referenced Oct 19, 2018
@thomashoneyman thomashoneyman added this to the 0.3.0 milestone Oct 19, 2018

-- | A type representing retrieving all of a particular field with the field's
-- | constructor name. For internal use.
type GetAll f =
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dariooddenino Your version of this is prettier and the type signatures are more immediately obvious in explaining what the function does (getInputs :: FormFieldGetFields "input"). However, I'm trying to minimize the number of constraints (especially RowToList ones) wherever possible for compile-time performance reasons. This version is less nice, but has fewer constraints.

…ucture modules to more accurately reflect names and uses of functions and for clarity.
* Added helper queries for all public queries. Added SetAll and ModifyAll functions. Broke something...

* Fix instances

* Update examples. Rename replaceInputs to initialize to better reflect its purpose and function.

* Fix formatting

* Add wrapInputFunctions helper function. Add documentation to wrap* and unwrap* helpers.
Add ability to set or modify input values, instead of only set.
@thomashoneyman
Copy link
Owner Author

Updates to support setAll / modifyAll and modify functions for form inputs have been merged into this branch. In addition, before merging to master, this will require the readme to be updated.

@thomashoneyman
Copy link
Owner Author

Will merge and release 0.3.0 on Monday, with a migration guide, unless there are any objections. (cc: @whoadave @crcornwell @dariooddenino)

@thomashoneyman thomashoneyman merged commit 1a8504d into master Oct 22, 2018
@thomashoneyman thomashoneyman deleted the heterogeneous branch October 22, 2018 16:18
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

Successfully merging this pull request may close these issues.

1 participant