summaryrefslogtreecommitdiff
path: root/ocaml/lib/effects.mli
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/lib/effects.mli')
-rw-r--r--ocaml/lib/effects.mli35
1 files changed, 35 insertions, 0 deletions
diff --git a/ocaml/lib/effects.mli b/ocaml/lib/effects.mli
new file mode 100644
index 0000000..67e9215
--- /dev/null
+++ b/ocaml/lib/effects.mli
@@ -0,0 +1,35 @@
+open Noun
+
+(** Effect types and parsing *)
+
+type blit =
+ | Lin of string (* Simple line of text *)
+ | Klr of noun (* Styled/colored text *)
+ | Mor of blit list (* Multiple blits *)
+ | Hop of int (* Cursor hop *)
+ | Clr (* Clear screen *)
+ | Unknown of noun (* Unparsed blit *)
+
+type card =
+ | Blit of blit (* Terminal output *)
+ | Logo (* Show logo *)
+ | HttpResponse of noun (* HTTP response *)
+ | Send of noun (* Network send *)
+ | Unknown of noun (* Unknown card type *)
+
+type effect = {
+ wire: noun;
+ card: card;
+}
+
+val parse_blit : noun -> blit
+val parse_card : noun -> card
+val parse_effect : noun -> effect option
+val parse_effects : noun -> effect list
+
+val show_wire : noun -> string
+val show_card : card -> string
+
+val is_dill_wire : noun -> bool
+val is_http_wire : noun -> bool
+val is_ames_wire : noun -> bool