| 1 | open Elpi.API |
| 2 | let c = AlgebraicData.(declare { |
| 3 | ty = Conversion.TyName "stuff"; |
| 4 | doc = "doc"; |
| 5 | pp = (fun fmt (x : int) -> ()); |
| 6 | constructors = [ |
| 7 | K("stuff","",A(BuiltInData.int,N),B (fun x -> x),M (fun ~ok ~ko:_ x -> ok x)); |
| 8 | ]; |
| 9 | } |
| 10 | ) |> ContextualConversion.(!<) |
| 11 | |
| 12 | let builtins = |
| 13 | let open BuiltIn in |
| 14 | let open BuiltInPredicate in |
| 15 | let cx = MLData c in |
| 16 | let q = MLCode(Pred("q",In(c,"xxx",Easy "bla"),(fun i ~depth -> Printf.eprintf "ok %d\n%!" i)),DocAbove) in |
| 17 | declare ~file_name:"elpi_example_plugin.elpi" [ cx; q ] |