summaryrefslogtreecommitdiff
path: root/src/gen_lib/sail_values.lem
diff options
context:
space:
mode:
authorBrian Campbell2018-02-22 17:03:42 +0000
committerBrian Campbell2018-02-22 17:04:58 +0000
commitd2825f37136128f5ac92127020a4b4a58bce3636 (patch)
tree770a93b89772af8ab6fb59eb575ef4354cddafb0 /src/gen_lib/sail_values.lem
parent74a4ed8b421ed131db4eb038f59780f09a79629e (diff)
Some Lem/OCaml compatibility fixes
Diffstat (limited to 'src/gen_lib/sail_values.lem')
-rw-r--r--src/gen_lib/sail_values.lem12
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