Skip to content

Instantly share code, notes, and snippets.

@jeetu7
Created April 11, 2020 10:27
Show Gist options
  • Save jeetu7/7c12cddce17325e3ca109cdf2630331e to your computer and use it in GitHub Desktop.
Save jeetu7/7c12cddce17325e3ca109cdf2630331e to your computer and use it in GitHub Desktop.
write file idris2
module Main
import System.File
main : IO ()
main = do myFile <- openFile "out_string.txt" WriteTruncate
case myFile of
Right c => fPutStr myFile "Alpha Beta"
Left err => printLn err
closeFile myFile
@MarcelineVQ
Copy link

module Main
import System.File

main : IO ()
main = do myFile <- openFile "out_string.txt" WriteTruncate
          case myFile of
              Right c => do fPutStr c "Alpha Beta"
                            closeFile c
              Left err => printLn err

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment