3 ms·
Constant Functor Object whose map doesn't transform the contents. See Functor Constant(1).map(n => n + 1) Ummm… how is this constant?
by aaaaaaaaaaab 4y ago
Constant Functor
Object whose map doesn't transform the contents. See Functor
Constant(1).map(n => n + 1)
Ummm… how is this constant?
- debugnik 4y agoIt ignores the mapping completely: constant.map(...) == constant Constant functors are only ever useful if you need to thread a simple value through code that asks for an arbitrary functor. I'd say that's rare even for abstract, type-level heavy code.