named: Named parameters (keyword arguments) for Haskell

[ bsd3, control, library ] [ Propose Tags ]

named is a lightweight library for named function parameters (keyword arguments) based on overloaded labels. Keyword arguments have several advantages over positional arguments:

Unlike newtype wrappers, keyword arguments don't pollute the global namespace, don't require top-level definitions, and don't need to be exported.

This implementation of named parameters is typesafe, provides good type inference, descriptive type errors, and has no runtime overhead.

Example usage:

import Named

createSymLink :: "from" :! FilePath -> "to" :! FilePath -> IO ()
createSymLink (Arg from) (Arg to) = ...

main = createSymLink ! #from "/path/to/source"
                     ! #to "/target/path"
Versions [faq] 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.0.1
Change log ChangeLog.md
Dependencies base (>=4.9 && <4.15) [details]
License BSD-3-Clause
Author Vladislav Zavialov
Maintainer Monadfix <hi@monadfix.com>
Revised Revision 1 made by int_index at 2020-04-08T18:42:15Z
Category Control
Home page https://github.com/monadfix/named
Bug tracker https://github.com/monadfix/named/issues
Source repo head: git clone git@github.com:monadfix/named.git
Uploaded by Artyom at 2019-10-19T06:36:11Z
Distributions LTSHaskell:0.2.0.0, NixOS:0.3.0.1, Stackage:0.3.0.0
Downloads 1960 total (48 in the last 30 days)
Rating 2.5 (votes: 5) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-10-19 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees