DEV Community

Discussion on: Function domain

Collapse
 
iquardt profile image
Iven Marquardt • Edited

Only a small supplement: If we generalize such an ordinary constraint, i.e. make the value constructor (the NonEmpty portion of NonEmpty<A>) itself polymorphic, we obtain a type class constraint. Since TS doesn't support type constructors like T<A> we can use dictionary passing style (pass the type class constraint as a normal argument to the polymorphic function) or resort to HKT hacks as pursued by FP-TS.