Created
February 2, 2019 08:51
-
-
Save CGenie/ac54f76b0c90e0b70206fd5162dc9413 to your computer and use it in GitHub Desktop.
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
File "src/x.ml", line 43, characters 36-39: | |
Error: This expression has type int32 list -> key | |
but an expression was expected of type int32 |
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
Lwt_main.run begin | |
Imap.connect ~host:host ~port:port ~username:username ~password:password >>= fun imap -> | |
Imap.examine imap mbox >>= fun () -> | |
Imap.uid_search imap Imap.all >>= fun (uids, _) -> | |
Lwt_list.iter_s (fun (uid: Imap.uid) -> | |
(* APPARENTLY THE COMPILER DOESN'T LIKE THE FOLLOWING LINE, THE [uid] part *) | |
let msg = Imap.(uid_fetch imap [uid] [Request.body_section ~peek:true ()]) in | |
Lwt_stream.to_list msg >>= function | |
| [_, {Imap.Response.body_section = [([], none), some s]; _}] -> | |
Lwt_io.printlf "uid: %ld" uid | |
Lwt_io.printlf "body section incorrect for uid: %ld" uid | |
| _ -> | |
Lwt_io.printlf "error fetching message %ld\n" uid | |
) uids | |
>>= fun () -> Imap.disconnect imap | |
end |
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
Lwt_main.run begin | |
Imap.connect ~host:host ~port:port ~username:username ~password:password >>= fun imap -> | |
Imap.examine imap mbox >>= fun () -> | |
Imap.uid_search imap Imap.all >>= fun (uids, _) -> | |
Lwt_list.iter_s (fun (uid : Imap.uid) -> Lwt_io.printf "uid: %ld\n" uid) uids | |
>>= fun () -> Imap.disconnect imap | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment