Permalink
Browse files

Add translate-from-context `get` function

  • Loading branch information...
VictorNicollet committed May 13, 2012
1 parent a5b076e commit e9b8e5e71b44afd1060df989cb4f7491d98cb8d8
Showing with 5 additions and 0 deletions.
  1. +2 −0 src/adLib.ml
  2. +3 −0 src/adLib.mli
View
@@ -7,6 +7,8 @@ class ['key] ctx (source : 'key source) = object
method adlib = adlib
end
+let get key =
+ Run.map (fun ctx -> ctx # adlib key) Run.context
let (!!) fmt = Printf.sprintf fmt
let const x _ = x
View
@@ -22,6 +22,9 @@ class ['key] ctx : 'key source -> object
method adlib : 'key source
end
+(** Extract a source from the context and grab a key out of it. *)
+val get : 'key -> ('key # ctx, string) Run.t
+
(** {2 Utilities} *)
(** Alias for [Printf.sprintf]. *)

0 comments on commit e9b8e5e

Please sign in to comment.