-
Notifications
You must be signed in to change notification settings - Fork 705
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
Scalaz 8 Roadmap #1526
Comments
TODO: Port over these notes from @aloiscochard |
Deriving will need iotaz if it is to be part of core, so perhaps best left as an addon module? |
Can you expand on this?
|
@fommil Sure, it can live anywhere, although there are other reasons to consider including iotaz (composable error sets, for example). I view some of the other major areas as potentially existing elsewhere, in different repos. @TomasMikula The current definition of |
Btw, to all Scalaz contributors: Please feel free to add to, edit, amend, and fill in! |
Have we enumerated what's going to be included in |
There's definitely a lot missing from that list. I know for sure it is missing |
There was a proposal to have 2 versions of some data types: a direct, fast, but stack-unsafe encoding, and a slower but stack-safe encoding. Applies to e.g. |
@TomasMikula We have discussed something even more radical, which is to not have the |
Should we maybe convert the |
👍 for |
I have only ever done this for an internal project (on GitHub Enterprise) and we have our build server build the documentation, then commit it into a separate repo, whose contents we expose via GitHub Pages. The separate repo was mostly to keep the tut commits out of our code history. I am unaware of a better way but surely there must be one :D |
@NeQuissimus Sounds like a great idea. 👍 |
Could you elaborate a bit more on the |
@caente I think this is a catch all for abstractions from abstract algebra, including things like |
@jdegoes I was hopping you would say that. I'm definitely interested in contributing. From what you say it seems like there isn't even a desired roadmap? I don't think my abstract algebra kung fu is enough for planing an strategy/hierarchy. |
@caente would be awesome to have someone tackle this in depth! One thing to keep in mind though is that it may make sense to decide how we want to do laws first. Algebraic structures such as Group, Semigroup, Monoid, SemiLattice, etc. all look pretty similar with different laws... hence why when I added SemiLattice to 7.3.x, I didn't add to Scalaz8. Food for thought. :) |
@caente copy PureScript |
Would improving scaladoc be considered part of "Examples"? |
@caente I can definitely help out with that (as can others). As @puffnfresh says, starting with the PureScript hierarchy would be a good first step. It's not quite fine-grained enough but it has the right general shape. There is overlap with Spire but Spire contains "non-things" like @dchenbecker I rewrote that section to be Also: hi! 😄 |
@jdegoes @puffnfresh I've been looking into purescript docs, and their algebra typeclasses seem to be distributed among several modules:
I find strange that what would be the advantage of such non-hierarchical hierarchy? |
@caente Ring and Semigroup are there because that's where (+) and (-) come from. Prelude without (+) and (-) would be a bit weird! You'll also see Semiring and EuclideanRing for (*) and (/) |
@caente yeah, I think you're right, don't copy this part! |
thanks @puffnfresh, on the other hand this seems like a nice guide http://a-guide-to-the-purescript-numeric-hierarchy.readthedocs.io/en/latest/ I see, there are Any thoughts on how to enforce laws? I see that in the current version of scalaz they are "built-in" on the typeclass itself, e.g. https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/Monoid.scala#L69-L82 btw I'd love to hear of any use cases for these typeclasses... |
@caente For now, I wouldn't worry about enforcing laws. The laws can be described in comments. Ultimately we want to add them as methods on the type classes, like Scalaz 7, but possibly closer to what Cats is currently doing, which is representing laws as data ( You are also right that PureScript makes some tradeoffs when it comes to the |
@jdegoes last night I began implementing Group in terms of monoid, then I saw Kmett's code and I was intimidated and confused: The code seems bottomless. Hence I repeat the question I asked before: are there use cases we want to prioritize? I imagine we don't exactly want to use scalaz to proof theorems, but rather to automate certain operations? |
@caente Well, let's start with something simple then:
This is a decent foundation and we can tweak or add other things ( |
@jdegoes I'm most interested in SemiLattice, does that not belong on the list? They're very useful for distributed systems. (Idempotency + commutativity) |
I'm also more interested in lattice-like structures than ring-like structures. |
@vmarquez @TomasMikula I think we need them all, but we need to start somewhere. 😄 |
@jdegoes I'll make a first stab at this tomorrow, it will probably be lacking, but I don't think I'll need anything else for now, between Kmett's code and Pinter's book I could be fine. |
What about a decent test library? It's still an open gap in FP... imagine a suite of matchers like scalatest that uses Equal and Order, and maybe even a "choose your Monad" runner so you could write Id tests, Either tests, or IO tests. With structural diffs of things that don't match the expectations. Maybe even macros to easily create "mock" versions of a finally tagless algebra backed by an mvar. |
If you are going to do a decent test library, look at hedgehog. https://hackage.haskell.org/package/hedgehog Don't copy quickcheck/scalacheck. You'll be way ahead of anything else that exists for Scala. IMO. |
@jdegoes @vmarquez @garyb @TomasMikula @puffnfresh I oppened this PR #1551 to move the conversation there, if possible I rather add small changes at a time. |
@tonymorris @fommil I would be very interested in this actually. I just figured it would be beyond the Scalaz 8 scope. There is scala-dedgehog but I have never used it. In #1540 @jdegoes mentioned that ScalaProps is meant to become part of Scalaz 8, we should definitely keep that in mind. |
@NeQuissimus @tonymorris Indeed, Hedgehog is my favorite too. ScalaProps is closer than ScalaCheck and can be made closer still, so it's a good base. |
@fommil It's needed. All the test libraries are non-functional and do not understand functional concepts (e.g. Monad), which makes them difficult to use. Something small but fully integrated into Scalaz can be used for internal tests, but also as a dependency |
https://github.com/scalaz/testz is now up. It needs Hedgehog-style property-based testing, but for now it should at least let us write laws. |
In fact, |
Checklist
OneAnd
andNonEmptyList
(type Nel[A] = NonEmpty[List, A]
)Overview
Core
Data
Needed: Someone to spearhead this work.
Functor Hierarchy
The Scalaz 8 functor hierarchy needs to be generalized to minimize the number of new abstractions needed to capture distinctions between different types of functors.
A more generic encoding of functor, more faithfully following category theory, will allow custom arrows and refined objects.
While the scope and nature of these changes is TBD, one useful suggestion by @ekmett is to factor out
Productive
andCoproductive
classes:These abstractions permit more sharing between, for example, an invariant applicative and a covariant applicative, reducing the number of type class variations that would otherwise have to exist.
Similarly, modeling
Bind
asF[F[A]] => F[A]
(rather than(F[A], A => F[B]) => F[B])
) allows many more types of monads to exist.Lead: @alexknvl
MTL
Type classes to describe all classes of effects. Unlike MTL, constraints should be minimized (e.g.
Functor
orApply
/Applicative
when possible,Monad
only when necessary), and as a result, names will differ substantially from Haskell.While the type classes are essential, the dirty secret in Scala is that actual monad transformers do not perform well and are not a realistic solution for most code. An alternative to stacks of monad transformers that is better suited to Scala must be developed.
Needed: Someone to spearhead this work.
Algebra
Needed: Someone to spearhead this work.
Other CT
Syntax
Effect
Lead: @jdegoes
Mutable
High-performance
ST
-based mutable data structures and constructors allowing importing impure Scala code to directly manipulate mutable data structures. Instances for MTL type classes.Needed: Someone to spearhead this work. @jdegoes ?
Documentation
Comprehensive documentation, readmes, and examples for all data types and abstractions in Scalaz 8.
Test
Benchmark
The benchmark package should help ensure Scalaz 8 encoding techniques, data structures, and effect systems are competitive with other techniques, up to the limits of the design goals.
Design Guide
Scalaz 8 needs a design guide that can ensure uniform standards are followed.
An initial version of the Design Guide can be found here.
PartialFunction
Needed: Someone to spearhead this work.
Third-Party
Scalaz-Deriving
Machinery to derive type classes automatically given instances supplied by the type class author.
Lead: @fommil
Scalaz-Nio
Type safe, minimal interface to Java NIO, including cost-free newtype wrappers for mutable data types.
The text was updated successfully, but these errors were encountered: