higher-kinded-lifecycle
ceylon-lang.org
higher-kinded-lifecycle | ceylon-lang.org | |
---|---|---|
2 | 1 | |
0 | 52 | |
- | - | |
0.0 | 10.0 | |
almost 10 years ago | over 3 years ago | |
Scala | HTML | |
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
higher-kinded-lifecycle
-
Using enums to represent state in Rust
Time to re-pimp my idea of doing this using a single type parameterised to reflect different states:
https://github.com/tim-group/higher-kinded-lifecycle/blob/ma...
-
Const generics MVP hits beta
I proposed using it to model lifecycles of entities:
https://github.com/tim-group/higher-kinded-lifecycle/blob/ma...
(in this code, "idea" is a domain concept from the firm i worked for at the time - basically a recommendation to buy a stock, which is 'opened' on a certain date, and 'closed' when it no longer seems like a good recommendation)
My collegues didn't like it, and stuck to using separate types for objects in different stages of the lifecycle!
ceylon-lang.org
-
Using enums to represent state in Rust
> One thing Rust could really use are anonymous unions (A | B |C instead of E::A(A), E::B(B), E::C(C)). They are to enums what tuple types are to structs.
Ceylon had union types, which is the only place i've seen these: https://github.com/eclipse-archived/ceylon-lang.org/blob/mas...
Another thing Rust enums are missing is having each variant be a type. If you have an enum Shape with variants Circle, Rectangle, and Polygon, there is no way to write a function which only takes a Circle. So you end up defining a struct for each case, then making your enum a trivial wrapper round the three structs. You end up with Shape::Circle and Circle, which are different things, and writing code like c.0.radius to get at the fields. It's rather inelegant. So either variants should be types in their own right, or an enum should be defined as a composition of existing types.
What are some alternatives?
runwasi - Facilitates running Wasm / WASI workloads managed by containerd
cheats.rs - Rust Language Cheat Sheet - https://cheats.rs