27 people like it.

elements of 3 value tuple

Analog to the fst and snd functions of the f# lib some functions for tuples with 3 values which i use quite regularly during prototyping phases.

1: 
2: 
3: 
let fst3(a, _, _) = a
let snd3(_, a, _) = a
let thrd(_, _, a) = a
val fst3 : a:'a * 'b * 'c -> 'a

Full name: Script.fst3
val a : 'a
val snd3 : 'a * a:'b * 'c -> 'b

Full name: Script.snd3
val a : 'b
val thrd : 'a * 'b * a:'c -> 'c

Full name: Script.thrd
val a : 'c
Raw view Test code New version

More information

Link:http://fssnip.net/17
Posted:10 years ago
Author:daniel szymanski
Tags: tuple