Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Tuple

Description

Functions associated with the tuple data types.

Synopsis
  • fst :: (a, b) -> a
  • snd :: (a, b) -> b
  • curry :: ((a, b) -> c) -> a -> b -> c
  • uncurry :: (a -> b -> c) -> (a, b) -> c
  • swap :: (a, b) -> (b, a)

Documentation

fst :: (a, b) -> aSource#

Extract the first component of a pair.

snd :: (a, b) -> bSource#

Extract the second component of a pair.

curry :: ((a, b) -> c) -> a -> b -> cSource#

curry converts an uncurried function to a curried function.

Examples

Expand
>>>curry fst 1 21

uncurry :: (a -> b -> c) -> (a, b) -> cSource#

uncurry converts a curried function to a function on pairs.

Examples

Expand
>>>uncurry (+) (1,2)3
>>>uncurry ($) (show, 1)"1"
>>>map (uncurry max) [(1,2), (3,4), (6,8)][2,4,8]

swap :: (a, b) -> (b, a)Source#

Swap the components of a pair.

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp