As a complement to the previous answers, if you want to be able to sequence with a pattern, you can define an active pattern:
let (|Cons|Nil|) s = if Seq.isEmpty s then Nil else Cons(Seq.head s, Seq.skip 1 s) let rec addentry map keys = match keys with | Cons((i,j), tail) -> Map.add (i,j) ((inputd.[i]).[j]) (addentry map tail) | Nil -> map
source share