Uploaded image for project: 'Commons Functor (Dormant)'
  1. Commons Functor (Dormant)
  2. FUNCTOR-24

Change default arity of Function, Procedure and Predicate

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      From http://markmail.org/message/ion6fk6hroh5zmzn

      Java 8 (project lambda) [1] and Google Guava [2] have a default arity of 1 for these interfaces (i.e. Function is a unary function). But in [functor] the default arity is 0 (i.e. nullary).

      It would be a good idea for [functor] to have a similar behaviour to the other API's, so users and developers can use the interfaces with less hassle.

      Other functional programming languages let the user specify the arity when declaring the function (like in Haskell), but in [functor] we have special interfaces per arity.

      [1] http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Function.html#apply(F)
      [2] http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Function.html#apply(F)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            kinow Bruno P. Kinoshita
            kinow Bruno P. Kinoshita
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment