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

Validated beginners doc #1903

Merged
merged 6 commits into from
Sep 26, 2017

Commits on Aug 27, 2017

  1. [WIP] Beginner-Friendly Validated docs

    This commit is the first approach to address typelevel#1678, developing the
    form-validation example.
    alejandromarin committed Aug 27, 2017
    Configuration menu
    Copy the full SHA
    ef08641 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2017

  1. Beginner-friendly example of validated.

    This commit contains a simple form-validation example and a couple
    of approaches making use of `Validated`.
    It aims to solve typelevel#1678
    alejandromarin committed Sep 9, 2017
    Configuration menu
    Copy the full SHA
    650c537 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2017

  1. Use of tut for code checking

    - The code examples for form validation are now using `tut` with
    its respective output in the generated .html.
    - Fixes some structural issues (`Either` return type in the `Validated`
    example, use of `mapN` instead of `|@|`).
    - Adds a deprecation notice about cartesian builder and changes this
    for using `.mapN`.
    alejandromarin committed Sep 10, 2017
    Configuration menu
    Copy the full SHA
    12f911d View commit details
    Browse the repository at this point in the history
  2. Fixes failing tut snippet.

    - The `Validated` approach with the for-comprehension has been
    splitted in two: the instructions that compile and the for-comprehension
    that doesn't compile. For the first ones, I've used `tut:silent` and
    for the second one I've used `tut:book:fail`. With this, all the code
    of this proposal is checked by tut correctly.
    - Adds an import for Either to bring .flatMap in Scala versions prior
    to 2.12.x.
    alejandromarin committed Sep 10, 2017
    Configuration menu
    Copy the full SHA
    32588fe View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2017

  1. Fixes

    - Fixes indentation in all the snippets (two spaces).
    - Added a new section ("short detour") in where I explain the
    `Semigroup` role in the accumulation, with a little portion of
    `Validated` code.
    - Adds "Back and forth" section explaining how to convert between
    `Validated` and `Either`. I can't figure it out how to convert from
    `Either` to `Validated` 'failing slowly'.
    alejandromarin committed Sep 12, 2017
    Configuration menu
    Copy the full SHA
    78b9504 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2017

  1. Revamped some parts of this docs

    - Added `final` modifier to `RegistrationData` case class.
    - Changed if-else in `Either` example to `Either.cond`.
    - Reused `Either` example validations in `Validated` (non-compiling)
    approach with `.toValidated`.
    - Deleted redundant imports for tut.
    - Changed `Validated` of a `NonEmptyList` for `ValidatedNel` type alias.
    - Deleted 'disclaimer' about converting from `Validated` to `Either`,
    losing the fail-slow functionality.
    - Added `Semigroup` example based on the Peter's one but in the
    context of the example provided here.
    - Fixed some typos and grammar errors.
    - Pointed out to the cats `Semigroup` documentation instead of Wikipedia.
    AlejandroME committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    8172251 View commit details
    Browse the repository at this point in the history