File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,16 @@ Definition print {T : Type} {ST : Show T} (val : T) : PrinterMonad unit :=
1111 @MonadWriter.tell _ (@show_mon _ ShowScheme_string_compose) _ _
1212 (@show _ ST val _ show_inj (@show_mon _ ShowScheme_string_compose)).
1313
14+ Definition printString (str : string) : PrinterMonad unit :=
15+ @MonadWriter.tell _ (@show_mon _ ShowScheme_string_compose) _ _
16+ (@show_exact str _ show_inj (@show_mon _ ShowScheme_string_compose)).
17+
1418Definition runPrinter {T : Type } (c : PrinterMonad T) : T * string :=
1519 let '(val,str) := unIdent (runWriterT c) in
1620 (val, str ""%string).
1721
1822
19- Eval compute in runPrinter (Monad.bind (print 1) (fun _ => print 2)).
23+ Eval compute in runPrinter (Monad.bind (print 1) (fun _ => print 2)).
24+
25+ Eval compute in runPrinter (Monad.bind (print "hello "%string) (fun _ => print 2)).
26+ Eval compute in runPrinter (Monad.bind (printString "hello "%string) (fun _ => print 2)).
You can’t perform that action at this time.
0 commit comments