Skip to content

Commit 01b52c6

Browse files
committed
Convert Process_406 to unmonad
1 parent 30dceca commit 01b52c6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
open SharedTypes;
22

3-
let fileForCmt = (~moduleName, ~uri, cmt, processDoc) => {
4-
let%try infos = Shared.tryReadCmt(cmt);
5-
Ok(ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos));
6-
};
3+
let fileForCmt = (~moduleName, ~uri, cmt, processDoc) =>
4+
switch (Shared.tryReadCmt(cmt)) {
5+
| Error(e) => Error(e)
6+
| Ok(infos) => Ok(ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos))
7+
};
78

8-
let fullForCmt = (~moduleName, ~uri, cmt, processDoc) => {
9-
let%try infos = Shared.tryReadCmt(cmt);
10-
let file = ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos);
11-
let extra = ProcessExtra.forCmt(~file, infos);
12-
Ok({file, extra});
13-
};
9+
let fullForCmt = (~moduleName, ~uri, cmt, processDoc) =>
10+
switch (Shared.tryReadCmt(cmt)) {
11+
| Error(e) => Error(e)
12+
| Ok(infos) =>
13+
let file = ProcessCmt.forCmt(~moduleName, ~uri, processDoc, infos);
14+
let extra = ProcessExtra.forCmt(~file, infos);
15+
Ok({file, extra});
16+
};
1417

1518
module PrintType = PrintType;

0 commit comments

Comments
 (0)