Skip to content

mbauman/Tuples.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuples

Build Status Coverage Status

This package explores an interface to work with Tuple{}s. See JuliaLang/julia#11547

It provides the following methods to work with Tuples as though they are containers of their parameters. It does not export these methods as they would clash with the Base methods of the same name. As such, they must be called fully-qualified with the module name.

  • Tuples.length(T): The number of component types in a Tuple T.
  • Tuples.collect(T): Returns the component types inside the Tuple T as an iterable container
  • Tuples.getindex(T, i::Integer): Returns the i-th component of the Tuple T
  • Tuples.getindex(T, Is): Returns an iterable container with each element set to the i-th component, for each i in Is.

Additionally, it provides a convenience method for constructing Tuple types by calling NTuple, akin to the base method ntuple:

  • NTuple(f, n::Integer): Construct a Tuple{} such that the i-th component is the result of f(i).

About

A testbed for an API to access Tuple parameters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages