DEV Community

Discussion on: Type holes in TypeScript

Collapse
 
gcanti profile image
Giulio Canti

My guess reading the original article is that the naming convention is based on the contraction of the signatures, so

  • (a: A) => B becomes ab
  • (a: A) => number becomes an
  • (an: (a: A) => number) => number becomes ann
  • etc...

Actually it looks good to me as the examples are such a general functions but I'm open to alternatives, what naming convention are you proposing?

Collapse
 
nythrox profile image
Jason Santiago

I personally would use variable names that describe what the values mean and do

function zoop<A, B>(abb: (a: A) => (b: B) => B, b: B, as: Array<A>): B
Enter fullscreen mode Exit fullscreen mode

could be

function zoop<A, B>(reducer: (previousValue: A) => (currentValue: B) => B, initialValue: B, array: Array<A>): B
Enter fullscreen mode Exit fullscreen mode