fixed test_bij

This commit is contained in:
Simon Cruanes 2013-10-05 12:24:55 +02:00
parent 3aae03b3dd
commit 9003d26a60

View file

@ -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