Commits

bergsoe committed eb6f43b

Cosmetic cleanup of optional arguments.

Comments (0)

Files changed (2)

src/PaplRandom.ml

       random_enum clone next
 end
 
-let enum_by ?rng:(rng = None) default_fun state_fun =
+let enum_by ?(rng = None) default_fun state_fun =
   match rng with
       None -> default_fun
     | Some state -> fun arg -> state_fun state arg
 let enum_char ?rng =
   enum_by ?rng Helper.enum_char BatRandom.State.enum_char
 
-let get_by ?rng:(rng = None) default_fun state_fun =
+let get_by ?(rng = None) default_fun state_fun =
   match rng with
       None -> default_fun
     | Some state -> fun arg -> state_fun state arg
 let int64 ?rng = get_by ?rng BatRandom.int64 BatRandom.State.int64
 let float ?rng = get_by ?rng BatRandom.float BatRandom.State.float
 
-let bits ?rng:(rng = None) =
+let bits ?(rng = None) =
   match rng with
       None -> BatRandom.bits
     | Some state -> fun () -> BatRandom.State.bits state
 
-let bool ?rng:(rng = None) =
+let bool ?(rng = None) =
   match rng with
       None -> BatRandom.bool
     | Some state -> fun () -> BatRandom.State.bool state

src/PaplTrajectory.ml

   if t1 < t0 then invalid_arg "PaplTrajectory.of_interpolate: t1 < t0";
   shift_to (scale { t0 = 0.; t1 = 1.; get = ip } (t1 -. t0)) t0
 
-let of_metric ?t0:(t0 = 0.) interpolate metric a b =
+let of_metric ?(t0 = 0.) interpolate metric a b =
   let t1 = t0 +. metric a b in
     if t1 < t0 then invalid_arg "PaplTrajectory.of_metric: t1 < t0";
     of_interpolate (t0, t1) (interpolate a b)
 
 let map f { t0; t1; get } = make (t0, t1) (fun t -> f (get t))
 
-let of_list ?t0:(t0 = 0.) trajectories =
+let of_list ?(t0 = 0.) trajectories =
   let () =
     match trajectories with
         [] -> invalid_arg "PaplTrajectory.of_list: empty list"