This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Tested with OCaml 3.12.1/4.00.1 *) | |
(* A standard state monad with an integer state *) | |
module IntStateMonad = | |
struct | |
type 'a t = int -> 'a * int | |
(* val return : 'a -> 'a t *) | |
let return (x : 'a) : 'a t = | |
(fun s -> (x, s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TARGET_FILE="/tmp/gdfuse.mem.log" | |
PROCESS_NAME=${1:-"google-drive-ocamlfuse"} | |
PID=$(ps -C "$PROCESS_NAME" -o pid=) | |
PID=${PID## } | |
if [[ -e "$TARGET_FILE" ]] | |
then | |
rm "$TARGET_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let with_session | |
config | |
curl_state | |
interact = | |
let curl_session = GapiCurl.init curl_state in | |
let writer data = String.length data in | |
GapiCurl.set_writefunction writer curl_session; | |
let cleanup () = ignore (GapiCurl.cleanup curl_session) in | |
let session = | |
{ GapiConversation.Session.curl = curl_session; |