foundation-0.0.13: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Foundation.Tuple.Nth

Description

a Generalized version of Fstable, Sndable, ..

Using this module is limited to GHC 7.10 and above.

Synopsis

Documentation

class KnownNat n => Nthable n a where

A generalized version of indexed accessor allowing access to tuples n'th element.

Indexing starts at 1, as fst is used to get first element.

Associated Types

type NthTy n a

Methods

nth :: proxy n -> a -> NthTy n a

Instances

Nthable 1 (a, b) 
Nthable 1 (Tuple2 a b) 
Nthable 2 (a, b) 
Nthable 2 (Tuple2 a b) 
Nthable 1 (a, b, c) 
Nthable 1 (Tuple3 a b c) 
Nthable 2 (a, b, c) 
Nthable 2 (Tuple3 a b c) 
Nthable 3 (a, b, c) 
Nthable 3 (Tuple3 a b c) 
Nthable 1 (a, b, c, d) 
Nthable 1 (Tuple4 a b c d) 
Nthable 2 (a, b, c, d) 
Nthable 2 (Tuple4 a b c d) 
Nthable 3 (a, b, c, d) 
Nthable 3 (Tuple4 a b c d) 
Nthable 4 (a, b, c, d) 
Nthable 4 (Tuple4 a b c d)