sanctuary-js / sanctuary

:see_no_evil: Refuge from unsafe JavaScript
https://sanctuary.js.org
MIT License
3.04k stars 94 forks source link

fantasy-land: document use of S.lift2 and S.lift3 as combinators #700

Closed davidchambers closed 3 years ago

davidchambers commented 4 years ago

sanctuary-js/sanctuary-site#92

In addition to documenting the use of lift2 and lift3 as combinators, this pull request standardizes the steps for deriving signatures of combinators from more general signatures:

  1. Provide general signature:

    Functor f => (a -> b) -> f a -> f b
  2. Replace type variable with Function x:

    (a -> b) -> Function x a -> Function x b
  3. Convert to -> form:

    (a -> b) -> (x -> a) -> (x -> b)
  4. Remove unnecessary parentheses:

    (a -> b) -> (x -> a) -> x -> b
  5. Rename type variables:

    (b -> c) -> (a -> b) -> a -> c
Avaq commented 3 years ago

Any reason to hold off merging this @davidchambers ?

davidchambers commented 3 years ago

Any reason to hold off merging this @davidchambers ?

No reason whatsoever. :)