| Start |
|---|
| Extract tuple components Use the Or use pattern matching. Pattern matching also works for tuples with more than two components. Haskell does not provide standard functions like |
| Strictness of matching a tuple The pattern since the match on |
| Construct tuple values Use parentheses and commas to create tuples. Use one comma to create a pair. Use more commas to create tuples with more components. Note that it is also possible to declare tuples using in their unsugared form. Tuples can contain values of different types. Tuples can contain complex values such as lists or more tuples. |
| Write tuple types Use parentheses and commas to write tuple types. Use one comma to write a pair type. Use more commas to write tuple types with more components. Tuples can contain values of different types. Tuples can contain complex values such as lists or more tuples. |
| Pattern Match on Tuples Pattern matching on tuples uses the tuple constructors. To match a pair for example, we'd use the We use more commas to match tuples with more components: Tuple patterns can contain complex patterns such as list patterns or more tuple patterns. |
| Apply a binary function to a tuple (uncurrying) Use the |
| Apply a tuple function to two arguments (currying) Use the |
| Swap pair components Use Or use pattern matching. Remarks |
Read Article
https://develop.horje.com/learn/1434/reference