fp-constructor is implemented wrong. Probably my fault.
.constructor should be an instance method (on the instance's delegate prototype), not a static property. It should refer to the specific stamp which created the instance. (See type representatives)
.of() should be a static prop (on the stamp). It should also refer to the stamp. (See .of() method)
In other words, it should create the stamp equivalent to the following factory:
fp-constructor is implemented wrong. Probably my fault.
.constructor
should be an instance method (on the instance's delegate prototype), not a static property. It should refer to the specific stamp which created the instance. (See type representatives).of()
should be a static prop (on the stamp). It should also refer to the stamp. (See .of() method)In other words, it should create the stamp equivalent to the following factory:
.constructor
and.of()
can be used as a tool to create Functors and Monads, to derive operations for algebraic datatypes, etc...Incidentally,
.constructor
and.of()
go hand-in-hand. If you want one, you almost certainly want both.