mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
fixed test_bij
This commit is contained in:
parent
3aae03b3dd
commit
9003d26a60
1 changed files with 9 additions and 9 deletions
|
|
@ -20,18 +20,18 @@ type term =
|
||||||
| App of term list
|
| App of term list
|
||||||
|
|
||||||
let bij_term =
|
let bij_term =
|
||||||
let bij = Bij.(fix
|
let bij = Bij.fix
|
||||||
(fun bij ->
|
(fun bij ->
|
||||||
switch
|
Bij.switch
|
||||||
~inject:(function
|
~inject:(function
|
||||||
| Const s -> "const", BranchTo (string_, s)
|
| Const s -> "const", Bij.(BranchTo (string_, s))
|
||||||
| Int i -> "int", BranchTo (int_, i)
|
| Int i -> "int", Bij.(BranchTo (int_, i))
|
||||||
| App l -> "app", BranchTo (list_ (Lazy.force bij), l))
|
| App l -> "app", Bij.(BranchTo (list_ (Lazy.force bij), l)))
|
||||||
~extract:(function
|
~extract:(function
|
||||||
| "const" -> BranchFrom (string_, fun x -> Const x)
|
| "const" -> Bij.(BranchFrom (string_, fun x -> Const x))
|
||||||
| "int" -> BranchFrom (int_, fun x -> Int x)
|
| "int" -> Bij.(BranchFrom (int_, fun x -> Int x))
|
||||||
| "app" -> BranchFrom (list_ (Lazy.force bij), fun l -> App l)
|
| "app" -> Bij.(BranchFrom (list_ (Lazy.force bij), fun l -> App l))
|
||||||
| _ -> raise (DecodingError "unexpected case switch")))
|
| _ -> raise Bij.(DecodingError "unexpected case switch"))
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
bij
|
bij
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue