Search
9 results
-
Larry Garfield ·
… singleton/multiton patterns using enums, like in Java. I'm not sure what you're describing here. Do you mean tagged unions/ADTs, which are punted to a later RFC? https://wiki.php.net/rfc/tagged_unions Enums evolve in …
-
RFC Enumerations
Paul Crovella ·
… it up here. That's disappointing as he didn't even attempt to address the majority of my concerns. Stateful enums are called tagged unions, and that's a separate phase to keep the implementation and discussion focused for now …
-
IDEA allow extending enum
Ilija Tovilo ·
… is) makes this quite confusing, and difficult to implement technically (usually classes are "locked" after linking). I would much prefer the previously suggested approaches (using algebraic data types, a.k.a. tagged unions, or union types of two enums). Ilija
-
Larry Garfield ·
… Regards, Jordi Please be aware that there are already plans for this feature (RFC is a bit dated for now so don't take literally): https://wiki.php.net/rfc/tagged_unions Which is currently blocked pending pattern matching, curren
-
Larry Garfield ·
… enum with one case; and we can't have this in PHP. That is what we mean by ADTs or Tagged Unions (various names for the same thing), and it's something Ilija and I have on the roadmap. It …
-
Larry Garfield ·
… any other. Making them usable as 95% strings partially defeats their purpose. We still intend to add associated values to enums at some point (aka ADTs, aka tagged unions), and... we're not really sure yet if that will impact …
-
olleharstedt@gmail.com ·
… forth. As for Result, what you'd want here is a dynamic, arbitrary value for both Ok and Error, which is exactly what ADTs / tagged unions would allow you to do: https://wiki.php.net/rfc/tagged_unions enum Res
-
tim@bastelstu.be ·
… options field. I believe that introducing enums right now is not doing enough to meaningfully improve the developer experience. As an example, if we already had Tagged Unions (https://wiki.php.net/rfc/tagged_unions), the per-filter options cou
-
Marc Bennewitz ·
… actually support properties and semantics might need to be different than those a naive “rushed” implementation of property hooks for enums would propose. See https://wiki.php.net/rfc/tagged_unions for an very early draft (which is not in …