Accessing a Specific Element in a Tuple

后端 未结 7 2157
南笙
南笙 2020-12-11 00:17

Haskell-newbie reporting in. Question is as follows: In Haskell, we have fst and snd that return the first and the second elements of a 2-tuple. Wh

7条回答
  •  遥遥无期
    2020-12-11 00:58

    cabal update
    cabal install tuple
    ghci
    
    λ> import Data.Tuple.Select
    λ> sel3 (0, "1", 2) --select the third element
    

提交回复
热议问题