Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | ListP ps => let
- fun ifExists(x) = case ex of
- List xs => if(List.length xs <> List.length ps) then NONE else case (xs, ps) of
- (h::nil, g::nil) => if(Option.isSome(match(h, g))) then match(h, g) else NONE
- |(h::t, g::r) => if(Option.isSome(match(h, g))) then Option.join(SOME(SOME(Option.valOf(match(h,g)) @ Option.valOf(match(List t, ListP r))))) else NONE
- in
- ifExists(ps)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement