[Question][Hw2][Ocaml] Is there a way to assert list length? #678
Replies: 2 comments
-
match fancy_list with
| x1 :: x2 :: x3 :: x4 :: [] -> do_something_useful
| _ -> failwith "the length of list must be 4" |
Beta Was this translation helpful? Give feedback.
0 replies
-
Oh, I was doing that and returning |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Name: Murad Bashirov
Hello. Is there a way to assert the list length, so when I pattern match it, so it doesn't give me the warning "pattern-matching is not exhaustive". I have tried
But it doesn't get rid of the warning.
Beta Was this translation helpful? Give feedback.
All reactions