Add Semigroup Validation Examples#17
Add Semigroup Validation Examples#17hdgarrood merged 8 commits intopurescript:masterfrom jkachmar:feat/add-examples
Conversation
|
Anything holding this from being merged? I don't see any problems with merging stuff into an "examples" directory - shouldn't break anything. |
|
Bump |
|
cc @garyb |
|
I'm going to try to look at this properly over the next week or so. |
|
Really great work on this! I'm sorry it took me a while to get around to looking at it. I have a few comments: I don't want these examples to be separate bower projects; I think they'll inevitably go out of date. Instead, I'd prefer that we just put the example purs files straight into an I'd rather not have the type aliases like Also, I think we should be showcasing the fact that Finally, using an array of data ValidationField
= Username
| Password
newtype FormValidationErrors =
FormValidationErrors (Map ValidationField (NonEmptyArray ValidationError))
instance semigroupFormValidationErrors :: Semigroup FormValidationErrors where
append = under2 FormValidationErrors (Map.unionWith (<>))
validateForm :: FormData -> V FormValidationErrors FormResultWhat do you think? On the semiring example, there are a few things which seem not quite right to me:
Because of this, I'd prefer to leave the semiring example out for now; we can revisit it later. |
|
Hey, sorry about the lag on this. I'll try to rebuild this project with a modern version of |
|
No rush at all - it took me over a year to get around to looking at this in the first place so I can't complain 😆 |
|
You can do it! |
|
Finally got around to this (thanks Compose Unconference!). I needed to use |
|
Looks great, thanks! Would you mind adding a |
|
Thanks very much! |
This is my first pass at adding a more detailed Semigroup Validation example, similar in spirit to the examples in the Halogen repository.
If this looks like something that would be valuable to have in the repo, I make a similar example for Semiring Validation and include it in this PR as well.