Foundation.Tuple.Nth

foundation-0.0.30: 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 :: Nat) a where
  - type NthTy (n :: Nat) a
  - nth :: proxy n -> a -> NthTy n a

# Documentation

class KnownNat n => Nthable (n :: Nat) 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 :: Nat) a #

Methods

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

#### Instances

Instances details

Nthable 1 (Tuple2 a b) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (Tuple2 a b) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (Tuple2 a b) = a
Methods nth :: proxy 1 -> Tuple2 a b -> NthTy 1 (Tuple2 a b) #
Nthable 1 (a, b) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (a, b) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (a, b) = a
Methods nth :: proxy 1 -> (a, b) -> NthTy 1 (a, b) #
Nthable 2 (Tuple2 a b) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (Tuple2 a b) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (Tuple2 a b) = b
Methods nth :: proxy 2 -> Tuple2 a b -> NthTy 2 (Tuple2 a b) #
Nthable 2 (a, b) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (a, b) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (a, b) = b
Methods nth :: proxy 2 -> (a, b) -> NthTy 2 (a, b) #
Nthable 1 (Tuple3 a b c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (Tuple3 a b c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (Tuple3 a b c) = a
Methods nth :: proxy 1 -> Tuple3 a b c -> NthTy 1 (Tuple3 a b c) #
Nthable 1 (a, b, c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (a, b, c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (a, b, c) = a
Methods nth :: proxy 1 -> (a, b, c) -> NthTy 1 (a, b, c) #
Nthable 2 (Tuple3 a b c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (Tuple3 a b c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (Tuple3 a b c) = b
Methods nth :: proxy 2 -> Tuple3 a b c -> NthTy 2 (Tuple3 a b c) #
Nthable 2 (a, b, c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (a, b, c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (a, b, c) = b
Methods nth :: proxy 2 -> (a, b, c) -> NthTy 2 (a, b, c) #
Nthable 3 (Tuple3 a b c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 3 (Tuple3 a b c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 3 (Tuple3 a b c) = c
Methods nth :: proxy 3 -> Tuple3 a b c -> NthTy 3 (Tuple3 a b c) #
Nthable 3 (a, b, c) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 3 (a, b, c) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 3 (a, b, c) = c
Methods nth :: proxy 3 -> (a, b, c) -> NthTy 3 (a, b, c) #
Nthable 1 (Tuple4 a b c d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (Tuple4 a b c d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (Tuple4 a b c d) = a
Methods nth :: proxy 1 -> Tuple4 a b c d -> NthTy 1 (Tuple4 a b c d) #
Nthable 1 (a, b, c, d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 1 (a, b, c, d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 1 (a, b, c, d) = a
Methods nth :: proxy 1 -> (a, b, c, d) -> NthTy 1 (a, b, c, d) #
Nthable 2 (Tuple4 a b c d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (Tuple4 a b c d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (Tuple4 a b c d) = b
Methods nth :: proxy 2 -> Tuple4 a b c d -> NthTy 2 (Tuple4 a b c d) #
Nthable 2 (a, b, c, d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 2 (a, b, c, d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 2 (a, b, c, d) = b
Methods nth :: proxy 2 -> (a, b, c, d) -> NthTy 2 (a, b, c, d) #
Nthable 3 (Tuple4 a b c d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 3 (Tuple4 a b c d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 3 (Tuple4 a b c d) = c
Methods nth :: proxy 3 -> Tuple4 a b c d -> NthTy 3 (Tuple4 a b c d) #
Nthable 3 (a, b, c, d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 3 (a, b, c, d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 3 (a, b, c, d) = c
Methods nth :: proxy 3 -> (a, b, c, d) -> NthTy 3 (a, b, c, d) #
Nthable 4 (Tuple4 a b c d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 4 (Tuple4 a b c d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 4 (Tuple4 a b c d) = d
Methods nth :: proxy 4 -> Tuple4 a b c d -> NthTy 4 (Tuple4 a b c d) #
Nthable 4 (a, b, c, d) # |
Instance details Defined in Foundation.Tuple.Nth Associated Types
type NthTy 4 (a, b, c, d) |
Instance details Defined in Foundation.Tuple.Nth type NthTy 4 (a, b, c, d) = d
Methods nth :: proxy 4 -> (a, b, c, d) -> NthTy 4 (a, b, c, d) #