first commit.
This commit is contained in:
parent
469de83cdc
commit
1ed8d0b479
1 changed files with 30 additions and 0 deletions
30
Readme.md
Normal file
30
Readme.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# rprint - redirectable print
|
||||
|
||||
This emulates with-output-to-string from scheme in f# using AsyncLocal.
|
||||
|
||||
``` f-sharp
|
||||
open Rprint.rprint
|
||||
|
||||
let sayHi name =
|
||||
rprint "Hi, %s" name
|
||||
|
||||
rprintn "this prints like usual"
|
||||
rprint "%s %d" "this uses a format string" 5
|
||||
|
||||
withOutputToString
|
||||
(fun () -> rprint "this ends up in a string, and so does this"
|
||||
sayHi "banana")
|
||||
```
|
||||
|
||||
The source code is short enough that you should not need any documentation.
|
||||
|
||||
There might be async workflows where this does not do what you expect. You have been warned.
|
||||
|
||||
Licensed under the 0-clause BSD license.
|
||||
|
||||
```
|
||||
Copyright (C) 2026 by Linus Björnstam <linus.internet@fastmail.se>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue