Context
isCoercible was promoted to the public API in #3429. Many isFoo functions in ramda-adjunct have an isNotFoo complement (e.g. isSymbol/isNotSymbol, isPrimitive/isNotPrimitive).
Question: is isNotCoercible actually useful?
isNotCoercible would be complement(isCoercible), returning true only for:
Symbol values
- Objects with no
toString or valueOf in their prototype chain (e.g. Object.create(null))
That is a very narrow set. In practice, if you need to guard against a TypeError on numeric coercion you already have isCoercible for the positive path. A dedicated isNotCoercible might only add noise.
Contrast with functions that have natural complements:
isBlank / (no isNotBlank) — similar situation
isSentinelValue / (no isNotSentinelValue) — similar situation
Proposal
Add isNotCoercible only if there is a demonstrated use case. If the consensus is that it adds no practical value, close this issue as wontfix.
Implementation (if accepted)
// src/isNotCoercible.js
import { complement } from 'ramda';
import isCoercible from './isCoercible.js';
const isNotCoercible = complement(isCoercible);
export default isNotCoercible;
Context
isCoerciblewas promoted to the public API in #3429. ManyisFoofunctions in ramda-adjunct have anisNotFoocomplement (e.g.isSymbol/isNotSymbol,isPrimitive/isNotPrimitive).Question: is isNotCoercible actually useful?
isNotCoerciblewould becomplement(isCoercible), returningtrueonly for:SymbolvaluestoStringorvalueOfin their prototype chain (e.g.Object.create(null))That is a very narrow set. In practice, if you need to guard against a TypeError on numeric coercion you already have
isCoerciblefor the positive path. A dedicatedisNotCoerciblemight only add noise.Contrast with functions that have natural complements:
isBlank/ (noisNotBlank) — similar situationisSentinelValue/ (noisNotSentinelValue) — similar situationProposal
Add
isNotCoercibleonly if there is a demonstrated use case. If the consensus is that it adds no practical value, close this issue aswontfix.Implementation (if accepted)