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 an If-Then-Else operation to the Apply. #2609

Merged
merged 8 commits into from
Jan 12, 2019
Merged

Add an If-Then-Else operation to the Apply. #2609

merged 8 commits into from
Jan 12, 2019

Commits on Nov 13, 2018

  1. Add an If-Then-Else operation to the Apply.

    The `FlatMap` type-class includes a function `ifM`, which allows
    evaluating a Boolean computation and, depending on the result,
    choosing between one effectful computation or other.
    
    We add to the `Apply` type-class a very similar function.
    
    Although the function is similar to `ifM`, there is an important
    difference between them, as to how they handle the effect:
    - The `ifM` will run the effects of the condition `F[Boolean]`,
      followed by the effects of _only one_ of the branches.
    - The `ifA` will always run the effect of the condition, that of the first
      branch, and that of the second branch, in that order.
    
    Thus, the if-then-else part in `ifA` only applies to the inner values,
    not to the effects.
    diesalbla committed Nov 13, 2018
    Configuration menu
    Copy the full SHA
    b52471e View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2018

  1. Avoid adding methods to the type class.

    To preserve binary compatibility, we can not add methods to
    an existing type-class, and can only use the syntax extension.
    diesalbla committed Nov 14, 2018
    Configuration menu
    Copy the full SHA
    75a7d4d View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2018

  1. Configuration menu
    Copy the full SHA
    8480c5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fde754d View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2018

  1. Configuration menu
    Copy the full SHA
    062d7fe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    926423b View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2019

  1. Configuration menu
    Copy the full SHA
    1d627c5 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2019

  1. Configuration menu
    Copy the full SHA
    2517183 View commit details
    Browse the repository at this point in the history