Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun findTypeInList (ts : T.t list) (l : string list) (f : string) =
- let val fieldTypes = ListPair.zipEq(l, ts)
- val fieldTypeOpt = List.find(fn (f',_) => f = f') fieldTypes
- in
- #2 (Option.valOf fieldTypeOpt)
- end
- fun traversePath (t : T.t) (path : string list)
- case path of
- [] => t
- | x::xs => let val T.$(TO.Struct l, [ts]) = T.out t
- in traversePath (findTypeInList ts l x) xs
- end
Add Comment
Please, Sign In to add comment