Closed rpominov closed 8 years ago
Maybe it's a good idea to require that type objects must have a property .algebras
which is an array of supported algebra names.
We already have to pass around type objects, so it seems like a good idea to stash all useful meta information in them, so we at least have to pass only them.
Closing because deriveAll
is removed in https://github.com/rpominov/static-land/commit/0b6555c961311c187b228f1581b2eabe280ac167 . May revisit later.
deriveAll does algebra detection based on what methods the type has. But, for example, if a type has
of
andchain
it doesn't mean it has Monad algebra. To support an algebra a type must have certain methods, but this rule doesn't work in the reverse direction.We probably should add an
algebras
argument toderiveAll
. Automatic detection based on methods is a good default though.