forked from portnov/hs-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIO.hs
More file actions
30 lines (21 loc) · 909 Bytes
/
IO.hs
File metadata and controls
30 lines (21 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-# LANGUAGE OverloadedStrings #-}
-- | This module exports definitions for some most used classes and methods from standard Java java.io package.
module Java.IO where
import Data.String
import JVM.Common () -- import instances only
import JVM.ClassFile
import qualified Java.Lang
-- | java.io.PrintStream class name
printStream :: IsString s => s
printStream = "java/io/PrintStream"
-- | java.io.PrintStream class as field type
printStreamClass :: FieldType
printStreamClass = ObjectType printStream
println :: NameType (Method Direct)
println = NameType "println" $ MethodSignature [Java.Lang.stringClass] ReturnsVoid
out :: NameType (Field Direct)
out = NameType "out" printStreamClass
printf :: NameType (Method Direct)
printf =
NameType "printf" $ MethodSignature [Java.Lang.stringClass,
Array Nothing Java.Lang.objectClass] (Returns printStreamClass)