sanctuary-js / sanctuary

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

❤️ ❤️ ❤️ #487

Open davidchambers opened 6 years ago

davidchambers commented 6 years ago

As a community we've achieved a lot in a few years, but there are still projects to create, incomplete projects to release, improvements to make to existing projects, blog posts to write, screencasts to record and edit, and many other ways to make the community even more welcoming to newcomers.

I find this very exciting, but with so many good ideas it's unclear how to best serve the community.

This thread is for gauging interest in various Sanctuary-related endeavours which may or may not have begun and have not yet concluded. I will add ideas as they occur to me; I invite you to do the same.

Submitting a proposal

  1. Post a short description of something you would like to happen. Include an issue link if applicable.
  2. Add a :heart: “reaction” to your comment. Presumably you're excited about the idea. :)

Supporting a proposal

  1. Add a :heart: “reaction” to a comment if it excites you. Keep in mind that adding a heart to every comment would indicate that all proposals are equally important to you, so be selective. ;)

Please do not discuss proposals in this thread. Let's keep this thread on point. If you would like to comment on a proposal, please do so in a dedicated GitHub issue (create one if necessary).

davidchambers commented 6 years ago

Release sanctuary-html

@soroushjp and I created sanctuary-html almost two years ago but never quite got it ready to release (sanctuary-js/sanctuary-html#3). It is similar to Cheerio in that it facilitates traversal and manipulation of HTML documents in Node. Whereas Cheerio is based on jQuery, sanctuary-html uses easily understood types such as Array Node and easily understood functions such as S.chain. It's a joy to use!

davidchambers commented 6 years ago

✔︎ Release sanctuary-maybe

Completed 27 May 2018

--- Sanctuary's Maybe type is currently defined in Sanctuary itself, but there are contexts in which one might want to use this type without adding a relatively large dependency. Sanctuary's API would not change: it would depend on sanctuary-maybe and would continue to export [`S.Nothing`][1] and [`S.Just`][2]. sanctuary-js/sanctuary-maybe#3 is almost ready to merge.
davidchambers commented 6 years ago

✔︎ Release sanctuary-either

Completed 26 May 2018

--- Sanctuary's Either type is currently defined in Sanctuary itself, but there are contexts in which one might want to use this type without adding a relatively large dependency. Sanctuary's API would not change: it would depend on sanctuary-either and would continue to export [`S.Left`][1] and [`S.Right`][2]. sanctuary-js/sanctuary-either#3 is almost ready to merge.
davidchambers commented 6 years ago

✔︎ Release sanctuary-pair

Completed 28 May 2018

--- Sanctuary currently considers `['foo', true]` to be a member of `Pair String Boolean`, but this is misleading. A true Pair type such as that defined in sanctuary-js/sanctuary-pair#3 supports [`S.map`][1], [`S.bimap`][2], and various related functions.
davidchambers commented 6 years ago

Release sanctuary-set

@scott-christopher put a great deal of work into sanctuary-js/sanctuary-set#1 back in 2016. It provides a Fantasy Land -compliant Set type with value-based equality semantics. Not only will the project be useful in its own right, but it will improve the types of certain Sanctuary functions (S.keys, S.values, and S.pairs) by removing the arbitrary ordering caveat, and will allow us to export Set-specific functions such as intersection and union.

davidchambers commented 6 years ago

Release sanctuary-map

sanctuary-map will provide a Fantasy Land -compliant Map type with value-based equality semantics. Whereas plain JavaScript objects can be considered “string maps”, the Map type is parameterized by key type as well as by value type (Map (Pair Integer Integer) (Array String), for example).

davidchambers commented 6 years ago

✔︎ Release sanctuary-identity

Completed 26 May 2018

--- sanctuary-js/sanctuary-identity#3 introduces a Fantasy Land -compliant Identity type. The Identity type is not terribly exciting, of course, but it is very useful for testing certain properties of *other* types, and is useful in the implementation of van Laarhoven lenses (do not give this comment a heart based solely on what the Identity type *enables*).
davidchambers commented 6 years ago

Export functions for creating and using lenses

Ramda provides R.view, R.over, and R.set. Sanctuary should provide equivalent functions. Ramda also provides functions for creating lenses. Sanctuary should provide similar functions, ensuring that the lens laws are obeyed as mentioned in #177.

davidchambers commented 6 years ago

✔︎ Create and release sanctuary-show

Completed 29 April 2018

--- [`S.toString`][1] is an invaluable function, but it has several deficiencies: - it relies on `toString` methods, which must sometimes serve other roles; - the presence of a `toString` method is not a reliable indicator of intent to support [`S.toString`][1]; - there is no specification for [`S.toString`][1]-friendly `toString` methods; and - the implementations live in [sanctuary-type-classes][2] but have nothing to do with Fantasy Land. The plan, as discussed in fantasyland/fantasy-land#254, is to create a project named sanctuary-show which specifies the desired semantics of a new `@@show` method, provides `@@show` implementations for built-in types, and exports `Showable :: TypeClass` and `show :: Showable a => a -> String`. We would then remove [`Z.toString`][3] and replace [`S.toString`][1] with `S.show`.
davidchambers commented 6 years ago

Create and release a functional testing library

We define lovely pure functions which we then test by throwing and catching assertion errors in a module with global suite and test functions and dollops of mutable state. This is no way to live! Let's make our test suites pure too by using the Validation type to accumulate errors, potentially in conjunction with the Future type in order to test asynchronous code.

davidchambers commented 6 years ago

Create an ESLint rule for Sanctuary-style indentation

I'm very excited about embracing the style proposed in #438, but this currently requires disabling the ESLint "indent" rule. Despite being highly configurable, the rule cannot be configured to accept this:

foo (bar)
    (baz)
    (function(x) {
       return x * x;
     })
    (quux);
davidchambers commented 6 years ago

Derive propTypes from sanctuary-def types

When using React, I'd like to derive propTypes from sanctuary-def Type values. We could add to the sanctuary-def readme a definition of a function which takes a Type value and returns a “custom validator”. We could even create a package which provides more faithful translations ($.EnumType could map to PropTypes.oneOf, for example). This may produce more descriptive error messages.

davidchambers commented 6 years ago

Create and release a command-line argument parser

I have used Commander.js in several projects. It's okay, but we can do better. We can build a library without null, undefined, or type coercion. We can build a library which defines parsers with types such as String -> Maybe Integer to allow option values to be precisely defined and validated.

davidchambers commented 6 years ago

Publish documentation of all Sanctuary projects on the website

Currently only the documentation of Sanctuary itself is on the website. For any other Sanctuary project one must consult the readme on GitHub. It would be convenient to have all the projects documented in one place.

davidchambers commented 5 years ago

Create and release sanctuary-list

sanctuary-list will provide an immutable, Fantasy Land -compliant List type. Due to structural sharing it will perform better than arrays in some situations, and with a smaller memory footprint.

davidchambers commented 5 years ago

Add Hoogle-like search to the website

With Hoogle one can often find the function one seeks by entering a type signature. Sanctuary's website should provide similar functionality.