|
[ ghc-Bugs-740326 ] hFlush doesn't seem to work under GHCi/Solaris: msg#00024lang.haskell.glasgow.bugs
Bugs item #740326, was opened at 2003-05-20 08:57 Message generated for change (Comment added) made by simonmar You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=740326&group_id=8032 Category: None >Group: 5.04.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Simon Marlow (simonmar) Summary: hFlush doesn't seem to work under GHCi/Solaris Initial Comment: Hi folks, executing "hFlush stdout" doesn't seem to have any effect when working under GHCi on Solaris (at least for me ...). Consider the following toy program: ---------------------------- module Main where import IO main :: IO () main = do n <- askQuestion "How many numbers would you like to sum up? " is <- mapM askNumber [1..n] let s = sum is putStrLn $ "The total sum is " ++ (show s) ++ "." askQuestion :: String -> IO Int askQuestion s = do putStr s hFlush stdout fmap read getLine askNumber :: Int -> IO Int askNumber i = askQuestion $ "Please input number " ++ (show i) ++ ": " ------------------------------- While everything looks fine under Linux (or when executing the program after compiling it with GHC) the output under Solaris looks rather messed up: --------------------- > ghci-5.04.2 ex2-1.hs ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 5.04.2, for Haskell 98. / /_\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Compiling Main ( ex2-1.hs, interpreted ) Ok, modules loaded: Main. *Main> main How many numbers would you like to sum up? 4 1 Please input number 1: Please input number 2: 2 3 Please input number 3: Please input number 4: 4 The total sum is 10. *Main> ----------------------- This is a GHCi-5.04.2 built from the source distribution under Sparc/Solaris by the way. Cheers, Matthias Neubauer neubauer@xxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------------------------------------- >Comment By: Simon Marlow (simonmar) Date: 2003-05-20 10:53 Message: Logged In: YES user_id=48280 This bug was fixed in 5.04.3. Unfortunately due the recent death of our only Sparc/Solaris machine we don't have a Sparc/Solaris binary distribution for 5.04.3. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108032&aid=740326&group_id=8032
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-740326 ] hFlush doesn't seem to work under GHCi/Solaris, SourceForge.net |
|---|---|
| Next by Date: | Re: Changes to make fptools insfrastructure usable for standalone libraries, Alastair Reid |
| Previous by Thread: | [ ghc-Bugs-740326 ] hFlush doesn't seem to work under GHCi/Solaris, SourceForge.net |
| Next by Thread: | Building GHC 5.04.3 with gcc 3.2.2 on Solaris 8, Arthur van Leeuwen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |