on master help sign in
Add primitive for stdout, stderr
commit0bb12940a9d3e10e1723b3e2f3af5718f80c0525 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 11 May 2014, 18:34 (12 years ago) parentd9a96d1
2 files changed+12
libs/prelude/Prelude.idr+8 src/Idris/Primitives.hs+4
libs/prelude/Prelude.idr+8
@@ -478,6 +478,14 @@ data File = FHandle Ptr
478478partial stdin : File
479479stdin = FHandle prim__stdin
480480
481+||| Standard output
482+partial stdout : File
483+stdout = FHandle prim__stdout
484+
485+||| Standard output
486+partial stderr : File
487+stderr = FHandle prim__stderr
488+
481489||| Call the RTS's file opening function
482490do_fopen : String -> String -> IO Ptr
483491do_fopen f m
src/Idris/Primitives.hs+4
@@ -170,6 +170,10 @@ primitives =
170170 -- Streams
171171 Prim (sUN "prim__stdin") (ty [] PtrType) 0 (p_cantreduce)
172172 (0, LStdIn) partial,
173+ Prim (sUN "prim__stdout") (ty [] PtrType) 0 (p_cantreduce)
174+ (0, LStdOut) partial,
175+ Prim (sUN "prim__stderr") (ty [] PtrType) 0 (p_cantreduce)
176+ (0, LStdErr) partial,
173177 Prim (sUN "prim__null") (ty [] PtrType) 0 (p_cantreduce)
174178 (0, LNullPtr) total,
175179 -- Managed pointer registration