Merge commit '12468c2'
[simantics/platform.git] / bundles / org.simantics.scl.data / scl / Data / Writer.scl
1 import "JavaBuiltin" as Java\r
2 \r
3 importJava "java.io.Writer" where\r
4     data Writer\r
5 \r
6 importJava "java.io.StringWriter" where\r
7     data StringWriter\r
8     \r
9     @JavaName "<init>"\r
10     createStringWriter :: <Proc> StringWriter\r
11 \r
12     @JavaName toString\r
13     resultOfStringWriter :: StringWriter -> <Proc> String\r
14 \r
15 class WriterLike a where\r
16     toWriter :: a -> Writer\r
17 instance WriterLike StringWriter where\r
18     toWriter = Java.unsafeCoerce