diff options
| author | Robert Norton | 2018-02-23 17:09:45 +0000 |
|---|---|---|
| committer | Robert Norton | 2018-02-23 17:09:45 +0000 |
| commit | 038feaf840206572c155ab0555e7025799cc8776 (patch) | |
| tree | 7c95669b21b886c40d0eed18b0304c33de933a62 /src/gen_lib/sail_values.lem | |
| parent | 5b068e01517bb461b8864581ce97799986cb0739 (diff) | |
| parent | cd37e0dd062f6af04c56e01103f2046fd390bbe6 (diff) | |
Merge branch 'sail2' of github.com:rems-project/sail into sail2
Diffstat (limited to 'src/gen_lib/sail_values.lem')
| -rw-r--r-- | src/gen_lib/sail_values.lem | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gen_lib/sail_values.lem b/src/gen_lib/sail_values.lem index 33caac37..b981bb91 100644 --- a/src/gen_lib/sail_values.lem +++ b/src/gen_lib/sail_values.lem @@ -379,11 +379,13 @@ end (* just_list takes a list of maybes and returns Just xs if all elements have a value, and Nothing if one of the elements is Nothing. *) val just_list : forall 'a. list (maybe 'a) -> maybe (list 'a) -let rec just_list [] = Just [] -and just_list (x :: xs) = - match (x, just_list xs) with - | (Just x, Just xs) -> Just (x :: xs) - | (_, _) -> Nothing +let rec just_list l = match l with + | [] -> Just [] + | (x :: xs) -> + match (x, just_list xs) with + | (Just x, Just xs) -> Just (x :: xs) + | (_, _) -> Nothing + end end declare {isabelle} termination_argument just_list = automatic |
