Commits

Oliver Gu committed d8ede94

|! -> |>

Comments (0)

Files changed (10)

examples/gnuplot.ml

   let data, opts = List.unzip data_opts in
   let cmd =
     List.map opts ~f:(sprintf "'-' %s")
-    |! String.concat ~sep:","
-    |! sprintf "plot %s"
+    |> String.concat ~sep:","
+    |> sprintf "plot %s"
   in
   send t cmd;
   List.iter data ~f:(fun cols -> send_cols t cols)

examples/print_market_depth.ml

     >>= fun (book_updates, id) ->
     upon (after duration) (fun () -> Tws.cancel_market_depth tws id);
     Pipe.iter_without_pushback book_updates ~f:(fun book_update ->
-      printf "%s\n%!" (Book_update.sexp_of_t book_update |! Sexp.to_string_hum))
+      printf "%s\n%!" (Book_update.sexp_of_t book_update |> Sexp.to_string_hum))
   )
 
 let command =

examples/quote_table.ml

 
 let print_quote_table quotes =
   let module Q = Quote_snapshot in
-  let get_symbol    quote = sprintf "%s"    (Q.symbol quote |! Symbol.to_string) in
+  let get_symbol    quote = sprintf "%s"    (Q.symbol quote |> Symbol.to_string) in
   let get_bid_size  quote = sprintf "%d"    (Q.bid_size  quote) in
-  let get_bid_price quote = sprintf "%4.2f" (Q.bid_price quote |! Price.to_float) in
+  let get_bid_price quote = sprintf "%4.2f" (Q.bid_price quote |> Price.to_float) in
   let get_ask_size  quote = sprintf "%d"    (Q.ask_size  quote) in
-  let get_ask_price quote = sprintf "%4.2f" (Q.ask_price quote |! Price.to_float) in
+  let get_ask_price quote = sprintf "%4.2f" (Q.ask_price quote |> Price.to_float) in
   let create_col ?(align=Ascii_table.Align.right) =
     Ascii_table.Column.create ~align
   in

examples/show_contract_specs.ml

       Tws.contract_specs tws ~contract
       >>| function
       | Ok con_specs ->
-        message (Contract_specs.sexp_of_t con_specs |! Sexp.to_string_hum)
+        message (Contract_specs.sexp_of_t con_specs |> Sexp.to_string_hum)
       | Error e ->
         message (Error.to_string_hum e))
   )

examples/submit_orders.ml

   printf "Submit %s buy order for %d shares of %s\n%!"
     order_type
     (Order.quantity order)
-    (Contract.symbol contract |! Symbol.to_string);
+    (Contract.symbol contract |> Symbol.to_string);
   Tws.submit_order_exn tws ~contract ~order
   >>= fun (order_status, oid) ->
   let wait_for_fill = Pipe.iter order_status ~f:(fun status ->
     Pipe.iter_without_pushback exec_reports ~f:(fun exec_report ->
       printf "Execution: \
           exec_id=%s time=%s exchange=%s side=%s shares=%d price=%4.2f\n%!"
-        (Execution_report.exec_id exec_report |! Execution_id.to_string)
-        (Execution_report.time exec_report |! Time.to_string_trimmed)
-        (Execution_report.exchange exec_report |! Exchange.to_string)
-        (Execution_report.side exec_report |! Execution_report.Side.to_string)
+        (Execution_report.exec_id exec_report |> Execution_id.to_string)
+        (Execution_report.time exec_report |> Time.to_string_trimmed)
+        (Execution_report.exchange exec_report |> Exchange.to_string)
+        (Execution_report.side exec_report |> Execution_report.Side.to_string)
         (Execution_report.quantity exec_report)
-        (Execution_report.price exec_report |! Price.to_float))
+        (Execution_report.price exec_report |> Price.to_float))
     )
 
 let timeout_arg () =
 
   let try_with_unpickle f = make_try_with
     Result.try_with
-    (|!)
+    (|>)
     (fun e -> Ibx_error.Parse_error e)
     f
 
               | Ok `Cancel -> assert false
               | Ok (`Response data) ->
                 Queue.to_list data
-                |! String.concat ~sep:"\000"
-                |! Fn.flip (^) "\000"
+                |> String.concat ~sep:"\000"
+                |> Fn.flip (^) "\000"
             in
             `Args $ tag $ version $ query_id $ tws_data)))
 end
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value (required int)))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Market_data"
       Pickler.Spec.(
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
   end
 end
 
           ~security_id_type:(fields_value (optional Raw_contract.Security_id.Type.val_type))
           ~security_id:(fields_value (optional Raw_contract.Security_id.val_type))
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Contract_specs" contract_spec
 
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Market_depth"
       Pickler.Spec.(
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Historical_data"
       Pickler.Spec.(
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Realtime_bars"
       Pickler.Spec.(
 
   let pp ppf t =
     Format.fprintf ppf "type=%s price=%4.2f size=%d %s"
-      (Type.sexp_of_t t.tick_type |! Sexp.to_string_hum)
+      (Type.sexp_of_t t.tick_type |> Sexp.to_string_hum)
       (Price.to_float t.price)
       t.size
       (Option.value_map t.can_auto_execute ~default:"n/a" ~f:(function
 
   let pp ppf t =
     Format.fprintf ppf "type=%s size=%i"
-      (Type.sexp_of_t t.tick_type |! Sexp.to_string_hum)
+      (Type.sexp_of_t t.tick_type |> Sexp.to_string_hum)
       t.size
 end
 
     Format.fprintf ppf
       "type=%s vol=%s delta=%sf gamma=%s vega=%s theta=%s \
        opt_price=%s pv_dividend=%s und_price=%s"
-      (Type.sexp_of_t t.tick_type |! Sexp.to_string_hum)
+      (Type.sexp_of_t t.tick_type |> Sexp.to_string_hum)
       (Option.value_map t.implied_volatility ~default:"n/a" ~f:float_to_string)
       (Option.value_map t.delta ~default:"n/a" ~f:float_to_string)
       (Option.value_map t.gamma ~default:"n/a" ~f:float_to_string)
 
   let pp ppf t =
     Format.fprintf ppf "type=%s value=%s"
-      (Type.sexp_of_t t.tick_type |! Sexp.to_string_hum)
+      (Type.sexp_of_t t.tick_type |> Sexp.to_string_hum)
       begin match t.tick_type with
       | Type.Last_timestamp ->
         Time.to_string_trimmed (Time.of_float (Float.of_string t.value))
               if String.is_empty valid_exchanges then []
               else begin
                 String.split valid_exchanges ~on:','
-                |! List.map ~f:Exchange.t_of_tws
+                |> List.map ~f:Exchange.t_of_tws
               end;
             price_magnifier;
             underlying_id;
               $ t.multiplier
               $ (String.concat t.order_types ~sep:",")
               $ (List.map t.valid_exchanges ~f:Exchange.tws_of_t
-                 |! String.concat ~sep:",")
+                 |> String.concat ~sep:",")
               $ t.price_magnifier
               $ t.underlying_id
               $ t.long_name
           ~security_id_type:(fields_value skipped)
           ~security_id:(fields_value skipped)
           ~combo_legs:(fields_value skipped))
-      |! wrap_contract_spec
+      |> wrap_contract_spec
     in
     Pickler.create ~name:"Execution"
       Pickler.Spec.(
         let bars = List.map (List.range 0 num_bars) ~f:(fun i ->
           let bar_msg =
             Array.sub bars_msg ~pos:(num_fields * i) ~len:num_fields
-            |! Queue.of_array
+            |> Queue.of_array
           in
           Unpickler.run_exn Bar.unpickler bar_msg)
         in
             let pickler = Only_in_test.force Bar.pickler in
             let bars_msg =
               List.map t.bars ~f:(fun bar -> Pickler.run pickler bar)
-              |! String.concat
+              |> String.concat
             in
             `Args
               $ t.start_time
 
   let tmg () =
     Time.now ()
-    |! Time.to_float
-    |! Float.modf
-    |! Float.Parts.integral
-    |! Time.of_float
+    |> Time.to_float
+    |> Float.modf
+    |> Float.Parts.integral
+    |> Time.of_float
 
   let og g () =
     if bg () then Some (g ()) else None

lib_test/simulation_server.ml

         ~f:(Server.send_ignore_errors server clt_id)
     in
     Pipe.iter_without_pushback (Server.listen_ignore_errors server) ~f:send_response
-    |! Deferred.don't_wait_for);
+    |> Deferred.don't_wait_for);
   Ivar.read server_is_ready
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.