Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (*---------------------------------------------------------------------------------///*)
- | ListP ps => case ex of
- List xs => case (xs, ps) of
- (h::nil, g::nil) => match(h, g)
- | (h::t, g::r) => case match(h,g) of
- SOME v => SOME (v @ (case match(List t, ListP r) of
- SOME a => a
- ))
- | NONE => NONE
- (*--------------------------------------PAIR-------------------------------------------///
- | PairP([a1, a2]) => case ex of
- Pair([b1,b2]) => if(match(b2, a2) = NONE orelse match(b1, a1) = NONE) then NONE else SOME (Option.valOf(match(b1, a1)) @ Option.valOf(match(b2, a2))) *)
- (*ERROR*)
- D:\FRI\FP\Seminar\seminar.sml:72.35-81.162 Error: types of rules don't agree [tycon mismatch]
- earlier rule(s): ''Z list option -> ''Z list option
- this rule: pattern -> ''Z list option
- in rule:
- PairP (a1 :: a2 :: nil) =>
- (case ex
- of Pair (b1 :: b2 :: nil) =>
- if (match (b2,a2) = NONE) orelse (match (b1,a1) = NONE)
- then NONE
- else SOME
- (Option.valOf (match (b1,a1)) @
- Option.valOf (match (b2,a2))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement