reazen / relude

FP-inspired prelude/standard library for ReasonML projects
https://reazen.github.io/relude
MIT License
267 stars 41 forks source link

Tuples - Add fst, snd functions to extract values #303

Closed gregberns closed 3 years ago

gregberns commented 3 years ago

Haskell has Tuple functions fst, snd to extract the first and second values from the tuple. I'm not seeing it in the docs.

Signatures:

fst :: (a,b) -> a

snd :: (a,b) -> b

Would probably want to add it to all the tuple types: Tuple3.third :: (a,b,c) -> c

jihchi commented 3 years ago

It is built-in in ReasonML, see the doc.

gregberns commented 3 years ago

Duh ... silly me. Any thoughts on adding third, fourth, etc for the tuple variations?

johnhaley81 commented 3 years ago

Looks like this was done in #305