Skip to content

Commit

Permalink
Add ohm_ok_or query
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNicollet committed May 15, 2012
1 parent 8a5e8a3 commit b9a0c46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/universal.ml
Expand Up @@ -27,6 +27,11 @@ let true_or default t callback =
let ohm_req_or default query callback =
ohm query (fun x -> req_or default x callback)

let ohm_ok_or ifbad query callback =
ohm query (function
| Bad bad -> ifbad bad
| Ok ok -> callback ok)

let optional value func callback =
match value with
| None -> callback None
Expand Down

0 comments on commit b9a0c46

Please sign in to comment.