Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type ('a,'b)ab = A of 'a | B of 'b;;
- let rec naPrzemian list =
- match list with
- | [] -> true
- | h::t -> if t!=[] then
- match (h, List.hd t) with
- |(A intt, B floatt) -> naPrzemian t
- |(B floatt, A intt) -> naPrzemian t
- | _ -> false
- else true
- naPrzemian [A 3;B 2.4;A 4;B 4.4;A 5;B 6.6];;
- naPrzemian [B 3.3;B 2.4;A 4;B 4.4;A 5;B 6.6];;
Advertisement
Add Comment
Please, Sign In to add comment