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

Merge std and core? #9

Open
armanbilge opened this issue Feb 17, 2022 · 8 comments
Open

Merge std and core? #9

armanbilge opened this issue Feb 17, 2022 · 8 comments

Comments

@armanbilge
Copy link
Owner

The idea was to separate cats-effect core dependency, but in practice everything from fs2 up brings it in anyway. So it may be over-modularization.

There's an argument to just merge in kernel as well, who does concurrency without CE.

@bplommer
Copy link
Collaborator

I think I'd be more inclined to merge kernel and std, and remove the dependency on core - that way core and std are completely independent. core could have its artifact renamed to oxidized-core with a new oxidized artifact that provides both.

@armanbilge
Copy link
Owner Author

👍 to merging kernel and std since they both only need the CE kernel dependency, we can provide the ConcurrentStateful for Ref in a more convenient place.

I'm not sure why core independent of kernel is a big win. Unless you don't like ConcurrentStateful and/or it's not ready for primetime in which case I'm happy to punt that off :)

@bplommer
Copy link
Collaborator

I'm not sure why core independent of kernel is a big win.

Dunno, maybe it isn't 🤷

Unless you don't like ConcurrentStateful and/or it's not ready for primetime in which case I'm happy to punt that off :)

Not that I don't like it but it's a lot more experimental than core. I like the idea of having a module that's just cats-mtl instances.

@armanbilge
Copy link
Owner Author

armanbilge commented Feb 17, 2022

it's a lot more experimental than core

Yes completely agree. Although anybody who cares about bincompatibility can should just copy-paste these instances wherever they want them :)

Separate modules doesn't really protect core from kernel breaking bincompat, because it manifests as a breaking version bump for the whole repo anyway. This is why the experimental CE CPS stuff is in its own repo with its own versioning.

Modules really only help with scoping dependencies I think.

@bpholt
Copy link

bpholt commented Jan 26, 2023

WDYT about moving the IO instances to a cats-mtl submodule (if they'll have it)? It'd be nice to have the IOLocal-based Local instance in a Typelevel repo if it's going to be more widespread due to something like Natchez or otel4s.

@armanbilge
Copy link
Owner Author

WDYT about moving the IO instances to a cats-mtl submodule (if they'll have it)?

@bpholt yeah, the reason this project exists is because that's not possible 😅 CE testkit has a dependency on cats-mtl, so cats-mtl can't depend on CE without creating a cycle. Cycles again!

However, I am in favor of moving this somewhere more visible. And also generally reviving it :)

@bpholt
Copy link

bpholt commented Jan 27, 2023

Ugh, of course 😂😭

@armanbilge
Copy link
Owner Author

Btw, something that could be worth pursuing is moving ConcurrentStateful into MTL. It's just an interface, and it should really be the parent of Stateful I believe.

import cats.Functor
import cats.mtl.Stateful
trait ConcurrentStateful[F[_], S] extends Serializable {
def functor: Functor[F]
def get: F[S]
def set(s: S): F[Unit]
def modify(f: S => S): F[Unit]
def inspect[A](f: S => A): F[A] = functor.map(get)(f)
// TODO To be useful will probably need more Ref-like methods
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants