Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
5 people like it. Like the snippet!
A pattern for creating n-ary Seq.map functions.
1: 2: 3: 4: 5: 6:
let (<*>) fs xs = Seq.map2 (fun f x -> f x) fs xs let map3 f xs bs cs = Seq.map2 f xs bs <*> cs let map4 f xs bs cs ds = map3 f xs bs cs <*> ds map4 (fun x b c d -> x + b + c + d) [1;2] [1;2] [1;2] [1;2] // [4; 8]