foundation-0.0.3: Alternative prelude with batteries and no dependencies

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Foundation.Tuple.Nth

Description

a Generalized version of Fstable, Sndable, ..

Using this module is limited to GHC 7.10 and above.

Synopsis

- class KnownNat n => Nthable n a where
  - type NthTy n a

# 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.

Minimal complete definition

nth

Associated Types

type NthTy n a #

Methods

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

Instances

Nthable 1 (a, b) # |
Associated Types type NthTy (1 :: Nat) (a, b) :: * # Methods nth :: proxy 1 -> (a, b) -> NthTy 1 (a, b) #
Nthable 1 (Tuple2 a b) # |
Associated Types type NthTy (1 :: Nat) (Tuple2 a b) :: * # Methods nth :: proxy 1 -> Tuple2 a b -> NthTy 1 (Tuple2 a b) #
Nthable 2 (a, b) # |
Associated Types type NthTy (2 :: Nat) (a, b) :: * # Methods nth :: proxy 2 -> (a, b) -> NthTy 2 (a, b) #
Nthable 2 (Tuple2 a b) # |
Associated Types type NthTy (2 :: Nat) (Tuple2 a b) :: * # Methods nth :: proxy 2 -> Tuple2 a b -> NthTy 2 (Tuple2 a b) #
Nthable 1 (a, b, c) # |
Associated Types type NthTy (1 :: Nat) (a, b, c) :: * # Methods nth :: proxy 1 -> (a, b, c) -> NthTy 1 (a, b, c) #
Nthable 1 (Tuple3 a b c) # |
Associated Types type NthTy (1 :: Nat) (Tuple3 a b c) :: * # Methods nth :: proxy 1 -> Tuple3 a b c -> NthTy 1 (Tuple3 a b c) #
Nthable 2 (a, b, c) # |
Associated Types type NthTy (2 :: Nat) (a, b, c) :: * # Methods nth :: proxy 2 -> (a, b, c) -> NthTy 2 (a, b, c) #
Nthable 2 (Tuple3 a b c) # |
Associated Types type NthTy (2 :: Nat) (Tuple3 a b c) :: * # Methods nth :: proxy 2 -> Tuple3 a b c -> NthTy 2 (Tuple3 a b c) #
Nthable 3 (a, b, c) # |
Associated Types type NthTy (3 :: Nat) (a, b, c) :: * # Methods nth :: proxy 3 -> (a, b, c) -> NthTy 3 (a, b, c) #
Nthable 3 (Tuple3 a b c) # |
Associated Types type NthTy (3 :: Nat) (Tuple3 a b c) :: * # Methods nth :: proxy 3 -> Tuple3 a b c -> NthTy 3 (Tuple3 a b c) #
Nthable 1 (a, b, c, d) # |
Associated Types type NthTy (1 :: Nat) (a, b, c, d) :: * # Methods nth :: proxy 1 -> (a, b, c, d) -> NthTy 1 (a, b, c, d) #
Nthable 1 (Tuple4 a b c d) # |
Associated Types type NthTy (1 :: Nat) (Tuple4 a b c d) :: * # Methods nth :: proxy 1 -> Tuple4 a b c d -> NthTy 1 (Tuple4 a b c d) #
Nthable 2 (a, b, c, d) # |
Associated Types type NthTy (2 :: Nat) (a, b, c, d) :: * # Methods nth :: proxy 2 -> (a, b, c, d) -> NthTy 2 (a, b, c, d) #
Nthable 2 (Tuple4 a b c d) # |
Associated Types type NthTy (2 :: Nat) (Tuple4 a b c d) :: * # Methods nth :: proxy 2 -> Tuple4 a b c d -> NthTy 2 (Tuple4 a b c d) #
Nthable 3 (a, b, c, d) # |
Associated Types type NthTy (3 :: Nat) (a, b, c, d) :: * # Methods nth :: proxy 3 -> (a, b, c, d) -> NthTy 3 (a, b, c, d) #
Nthable 3 (Tuple4 a b c d) # |
Associated Types type NthTy (3 :: Nat) (Tuple4 a b c d) :: * # Methods nth :: proxy 3 -> Tuple4 a b c d -> NthTy 3 (Tuple4 a b c d) #
Nthable 4 (a, b, c, d) # |
Associated Types type NthTy (4 :: Nat) (a, b, c, d) :: * # Methods nth :: proxy 4 -> (a, b, c, d) -> NthTy 4 (a, b, c, d) #
Nthable 4 (Tuple4 a b c d) # |
Associated Types type NthTy (4 :: Nat) (Tuple4 a b c d) :: * # Methods nth :: proxy 4 -> Tuple4 a b c d -> NthTy 4 (Tuple4 a b c d) #