Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
607 B
2
Indexable
Never
let rec createBooleanMap  (edges:List<Compiler.Edge>) sofarBooleanMap:Map<string,List<Compiler.Edge>> =
  match edges with
  | [] -> sofarBooleanMap
  | ei :: tail ->  match ei.label with
                    | Compiler.BoolLabel(b)-> 
                        match (sofarBooleanMap |> Map.tryFind ei.source) with
                            | Some(lE) -> createBooleanMap tail (sofarBooleanMap |> Map.add ei.source (lE@[ei]))
                            | None(_) -> createBooleanMap tail (sofarBooleanMap |> Map.add ei.source ([ei]))
                    | _ -> createBooleanMap tail sofarBooleanMap
Leave a Comment