doxdox icon indicating copy to clipboard operation
doxdox copied to clipboard

How to document curried functions?

Open joelnet opened this issue 6 years ago • 1 comments

How do I document curried functions like this?

const map = func => iterable => {}

joelnet avatar Oct 02 '18 03:10 joelnet

Or this:

// @flow

import { Either, Left, Maybe, Nothing, Right, gt, isNothing } from 'sanctuary'

export default (testValue: Maybe<number> = Nothing): Function =>
  (value: Maybe<number>): Either<string, Maybe<number>> =>
    isNothing(value) || gt(testValue)(value)
      ? Right(value)
      : Left('NOT_GREATER_THAN')

chasm avatar Feb 08 '19 01:02 chasm