juan_gandhi: (Default)
[personal profile] juan_gandhi
We had a discussion recently regarding this kind of code and how it should behave


import System.IO
import Data.Char(toUpper)

main::IO()
main = do
  h ←  openFile "/vladp/haskell/testfile.txt" ReadMode
  input ←  hGetContents h
  hClose h
  let result = map toUpper input
  putStr result



Well, basically, no surprise; the moment the string started being scanned, there's already nothing there, so it does not print anything... somehow we were not sure about it, now I wonder why should we.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25 262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 28th, 2025 03:02 am
Powered by Dreamwidth Studios