@@ -13,7 +13,7 @@ module FunctionName = struct
1313end
1414
1515module FunctionArgs = struct
16- type arg = {label : string ; functionName : FunctionName .t }
16+ type arg = {label : string ; functionName : FunctionName .t }
1717 type t = arg list
1818
1919 let empty = []
@@ -45,7 +45,7 @@ module FunctionArgs = struct
4545end
4646
4747module FunctionCall = struct
48- type t = {functionName : FunctionName .t ; functionArgs : FunctionArgs .t }
48+ type t = {functionName : FunctionName .t ; functionArgs : FunctionArgs .t }
4949
5050 let substituteName ~sub name =
5151 match sub |> FunctionArgs. find ~label: name with
@@ -117,7 +117,9 @@ module Stats = struct
117117 termination = TerminationAnalysisInternal ;
118118 message =
119119 Format. asprintf " Cache %s for @{<info>%s@}"
120- (match hit with true -> " hit" | false -> " miss" )
120+ (match hit with
121+ | true -> " hit"
122+ | false -> " miss" )
121123 (FunctionCall. toString functionCall);
122124 })
123125
@@ -195,7 +197,9 @@ module Progress = struct
195197 type t = Progress | NoProgress
196198
197199 let toString progress =
198- match progress = Progress with true -> " Progress" | false -> " NoProgress"
200+ match progress = Progress with
201+ | true -> " Progress"
202+ | false -> " NoProgress"
199203end
200204
201205module Call = struct
@@ -240,7 +244,9 @@ module Trace = struct
240244 let none = Toption Rnone
241245
242246 let retOptionToString r =
243- match r = Rsome with true -> " Some" | false -> " None"
247+ match r = Rsome with
248+ | true -> " Some"
249+ | false -> " None"
244250
245251 let rec toString trace =
246252 match trace with
@@ -269,7 +275,7 @@ module Values : sig
269275 val some : progress :Progress .t -> t
270276 val toString : t -> string
271277end = struct
272- type t = {none : Progress .t option ; some : Progress .t option }
278+ type t = {none : Progress .t option ; some : Progress .t option }
273279
274280 let getNone {none} = none
275281 let getSome {some} = some
@@ -279,7 +285,9 @@ end = struct
279285 | None -> []
280286 | Some p -> [" some: " ^ Progress. toString p])
281287 @
282- match x.none with None -> [] | Some p -> [" none: " ^ Progress. toString p])
288+ match x.none with
289+ | None -> []
290+ | Some p -> [" none: " ^ Progress. toString p])
283291 |> String. concat " , "
284292
285293 let none ~progress = {none = Some progress; some = None }
@@ -301,7 +309,7 @@ end = struct
301309end
302310
303311module State = struct
304- type t = {progress : Progress .t ; trace : Trace .t ; valuesOpt : Values .t option }
312+ type t = {progress : Progress .t ; trace : Trace .t ; valuesOpt : Values .t option }
305313
306314 let toString {progress; trace; valuesOpt} =
307315 let progressStr =
@@ -340,9 +348,13 @@ module State = struct
340348 let valuesOpt =
341349 match (s1.valuesOpt, s2.valuesOpt) with
342350 | None , valuesOpt -> (
343- match s1.progress = Progress with true -> valuesOpt | false -> None )
351+ match s1.progress = Progress with
352+ | true -> valuesOpt
353+ | false -> None )
344354 | valuesOpt , None -> (
345- match s2.progress = Progress with true -> valuesOpt | false -> None )
355+ match s2.progress = Progress with
356+ | true -> valuesOpt
357+ | false -> None )
346358 | Some values1 , Some values2 -> Some (Values. nd values1 values2)
347359 in
348360 {progress; trace; valuesOpt}
@@ -376,10 +388,10 @@ module Command = struct
376388 | Nothing
377389 | Sequence of t list
378390 | SwitchOption of {
379- functionCall : FunctionCall .t ;
380- loc : Location .t ;
381- some : t ;
382- none : t ;
391+ functionCall : FunctionCall .t ;
392+ loc : Location .t ;
393+ some : t ;
394+ none : t ;
383395 }
384396 | UnorderedSequence of t list
385397
@@ -418,7 +430,9 @@ module Command = struct
418430 | Sequence cs1 :: cs2 -> loop acc (cs1 @ cs2)
419431 | c :: cs -> loop (c :: acc) cs
420432 in
421- match loop [] commands with [c] -> c | cs -> Sequence cs
433+ match loop [] commands with
434+ | [c] -> c
435+ | cs -> Sequence cs
422436
423437 let ( +++ ) c1 c2 = sequence [c1; c2]
424438
@@ -432,15 +446,17 @@ end
432446
433447module Kind = struct
434448 type t = entry list
435- and entry = {label : string ; k : t }
449+ and entry = {label : string ; k : t }
436450
437451 let empty = ([] : t )
438452
439453 let hasLabel ~label (k : t ) =
440454 k |> List. exists (fun entry -> entry.label = label)
441455
442456 let rec entryToString {label; k} =
443- match k = [] with true -> label | false -> label ^ " :" ^ (k |> toString)
457+ match k = [] with
458+ | true -> label
459+ | false -> label ^ " :" ^ (k |> toString)
444460
445461 and toString (kind : t ) =
446462 match kind = [] with
456472
457473module FunctionTable = struct
458474 type functionDefinition = {
459- mutable body : Command .t option ;
460- mutable kind : Kind .t ;
475+ mutable body : Command .t option ;
476+ mutable kind : Kind .t ;
461477 }
462478
463479 type t = (FunctionName .t , functionDefinition ) Hashtbl .t
@@ -528,7 +544,9 @@ module FindFunctionsCalled = struct
528544
529545 let findCallees (expression : Typedtree.expression ) =
530546 let isFunction =
531- match expression.exp_desc with Texp_function _ -> true | _ -> false
547+ match expression.exp_desc with
548+ | Texp_function _ -> true
549+ | _ -> false
532550 in
533551 let callees = ref StringSet. empty in
534552 let traverseExpr = traverseExpr ~callees in
@@ -703,10 +721,10 @@ end
703721
704722module Compile = struct
705723 type ctx = {
706- currentFunctionName : FunctionName .t ;
707- functionTable : FunctionTable .t ;
708- innerRecursiveFunctions : (FunctionName .t , FunctionName .t ) Hashtbl .t ;
709- isProgressFunction : Path .t -> bool ;
724+ currentFunctionName : FunctionName .t ;
725+ functionTable : FunctionTable .t ;
726+ innerRecursiveFunctions : (FunctionName .t , FunctionName .t ) Hashtbl .t ;
727+ isProgressFunction : Path .t -> bool ;
710728 }
711729
712730 let rec expression ~ctx (expr : Typedtree.expression ) =
@@ -765,7 +783,9 @@ module Compile = struct
765783 | _ -> false )
766784 in
767785 let argOpt =
768- match argOpt with Some (_ , Some e ) -> Some e | _ -> None
786+ match argOpt with
787+ | Some (_ , Some e ) -> Some e
788+ | _ -> None
769789 in
770790 let functionArg () =
771791 match
@@ -993,7 +1013,9 @@ module Compile = struct
9931013 assert false
9941014
9951015 and expressionOpt ~ctx eOpt =
996- match eOpt with None -> Command. nothing | Some e -> e |> expression ~ctx
1016+ match eOpt with
1017+ | None -> Command. nothing
1018+ | Some e -> e |> expression ~ctx
9971019
9981020 and evalArgs ~args ~ctx command =
9991021 (* Don't assume any evaluation order on the arguments *)
@@ -1013,8 +1035,8 @@ module Compile = struct
10131035end
10141036
10151037module CallStack = struct
1016- type frame = {frameNumber : int ; pos : Lexing .position }
1017- type t = {tbl : (FunctionCall .t , frame ) Hashtbl .t ; mutable size : int }
1038+ type frame = {frameNumber : int ; pos : Lexing .position }
1039+ type t = {tbl : (FunctionCall .t , frame ) Hashtbl .t ; mutable size : int }
10181040
10191041 let create () = {tbl = Hashtbl. create 1 ; size = 0 }
10201042
0 commit comments