Accessing a Specific Element in a Tuple

后端 未结 7 2081
南笙
南笙 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:57

    Nikita Volkov's new "record" library has a feature that appears to do what you want. Search for the heading "Tuples are records too!" on the linked page.

    It looks like the library is still under development, so it may not be as easy to install and use right now as it will be in the future.

提交回复
热议问题