Implement Literal::Data.define (#335)
Proposal:
It would be nice to have a `define` like the [native Data
structure](https://docs.ruby-lang.org/en/master/Data.html). It is useful
for code like this:
```ruby
# Before
class CreateUser
Success = Class.new(Literal::Data) do
prop :user, User
end
Failure = Class.new(Literal::Data) do
prop :reason, Symbol
prop :user, User
end
end
# After
class CreateUser
Success = Literal::Data.define(user: User)
Failure = Literal::Data.define(reason: Symbol, user: User)
end
```
With this define, we lose the ability to specify kind, reader,
predicate, and default values, but I believe the goal is to provide a
straightforward way to define simple data structures.
Co-authored-by: Joel Drapper <joel@drapper.me>
authored by