named: Named parameters (keyword arguments) for Haskell
named is a lightweight library for named function parameters (keyword
arguments) based on overloaded labels. Keyword arguments have several
advantages over positional arguments:
they can be supplied in arbitrary order
their names serve as documentation at call site
it is impossible to accidentally mix them up
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"
Downloads
- named-0.2.0.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
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
Candidates
| Versions [RSS] | 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.0.2 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | base (>=4.9 && <4.13) [details] |
| Tested with | ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.2 |
| License | BSD-3-Clause |
| Author | Vladislav Zavialov |
| Maintainer | Monadfix <[email protected]> |
| Revised | Revision 2 made by int_index at 2018-11-26T16:26:26Z |
| Category | Control |
| Source repo | head: git clone [email protected]:int-index/named.git |
| Uploaded | by int_index at 2018-07-13T11:38:51Z |
| Distributions | LTSHaskell:0.3.0.2, NixOS:0.3.0.2, Stackage:0.3.0.2 |
| Reverse Dependencies | 14 direct, 4 indirect [details] |
| Downloads | 4062 total (13 in the last 30 days) |
| Rating | 2.5 (votes: 6) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2018-07-13 [all 1 reports] |