-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(base) extra clean to the base library of graphjs
- Loading branch information
1 parent
584552f
commit 2e5ba69
Showing
13 changed files
with
93 additions
and
106 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,13 @@ | |
fun | ||
option | ||
result | ||
json | ||
config | ||
generator | ||
console | ||
fmt | ||
writer | ||
font | ||
log | ||
json | ||
time) | ||
(libraries unix fpath yojson)) |
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
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 renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
include Stdlib.Option | ||
|
||
let ( let* ) (v : 'a t) (f : 'a -> 'b t) : 'b t = bind v f | ||
let ( let+ ) (f : 'a -> 'b) (v : 'a t) : 'b t = map f v | ||
let ( let* ) (o : 'a t) (f : 'a -> 'b t) : 'b t = bind o f | ||
let ( let+ ) (f : 'a -> 'b) (o : 'a t) : 'b t = map f o | ||
|
||
let value_lazy ~(default : 'a lazy_t) : 'a t -> 'a = function | ||
| None -> Lazy.force default | ||
| Some v -> v | ||
let value_lazy ~(default : 'a lazy_t) (o : 'a t) : 'a = | ||
match o with None -> Lazy.force default | Some v -> v | ||
|
||
let map_none ~(value : 'a t) : 'a t -> 'a t = function | ||
| None -> value | ||
| Some _ as v -> v | ||
let map_none ~(value : 'a t) (o : 'a t) : 'a t = | ||
match o with None -> value | Some _ as v -> v | ||
|
||
let fold_lazy ~(none : 'b lazy_t) ~(some : 'a -> 'b) : 'a t -> 'b = function | ||
| None -> Lazy.force none | ||
| Some v -> some v | ||
let fold_lazy ~(none : 'b lazy_t) ~(some : 'a -> 'b) (o : 'a t) : 'b = | ||
match o with None -> Lazy.force none | Some v -> some v |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
include Stdlib.Result | ||
|
||
let ( let* ) (v : ('a, 'e) t) (f : 'a -> ('b, 'e) t) : ('b, 'e) t = bind v f | ||
let ( let+ ) (f : 'a -> 'b) (v : ('a, 'e) t) : ('b, 'e) t = map f v | ||
let ( let* ) (r : ('a, 'e) t) (f : 'a -> ('b, 'e) t) : ('b, 'e) t = bind r f | ||
let ( let+ ) (f : 'a -> 'b) (r : ('a, 'e) t) : ('b, 'e) t = map f r | ||
|
||
let extract (vs : ('a, 'b) t list) : ('a list, 'b) t = | ||
Fun.flip2 List.fold_right vs (Ok []) (fun v acc -> | ||
match (acc, v) with | ||
let extract (rs : ('a, 'b) t list) : ('a list, 'b) t = | ||
Fun.flip2 List.fold_right rs (Ok []) (fun r acc -> | ||
match (acc, r) with | ||
| ((Error _ as err), _) -> err | ||
| (Ok _, (Error _ as err)) -> err | ||
| (Ok vs, Ok v) -> Ok (v :: vs) ) |
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
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
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
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