mlhaufe / brevity

Brevity is a library that enables Feature-Oriented Programming (FOP) and solves the expression problem in a manner that makes data and operation declarations trivial to define and compose.
GNU Affero General Public License v3.0
1 stars 0 forks source link

Partial construction of variants #42

Open mlhaufe opened 1 year ago

mlhaufe commented 1 year ago

Partial construction of variants:

const Disk = Data(['position', 'velocity', 'radius', 'item'])

const PartialDisk = Disk([12, 15], [87, 14], 7, _)

const diskItem = PartialDisk('foo')

TODO: Need a real use case to justify this enhancement

Open question: How can this work with pattern matching in traits?