Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread zaxis
thanks! case timeout of Just str -> case reads str of [(t,_)] -> addtimeout (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) _ -> return () _ -> return () is VERY clear! Daniel Fischer-4 wrote: > > Am Sonntag 28 Februar 2010 02:08:18 schrieb zaxis: >> Then can i change it to

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Felipe Lessa
On Sat, Feb 27, 2010 at 05:08:18PM -0800, zaxis wrote: > Then can i change it to : > case timeout of > Just str -> do > [(t, _)] <- reads str > addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) > return () > _ -> return () No, that's diffe

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 02:08:18 schrieb zaxis: > Then can i change it to : > case timeout of > Just str -> do > [(t, _)] <- reads str > addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) > return () > _ -> return () > > Sincerely! No. T

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread zaxis
Then can i change it to : case timeout of Just str -> do [(t, _)] <- reads str addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) return () _ -> return () Sincerely! Brandon S. Allbery KF8NH wrote: > > On Feb 27, 2010, at 04:07 , zaxis

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Ben Millwood
On Sat, Feb 27, 2010 at 9:29 AM, Brandon S. Allbery KF8NH wrote: > On Feb 27, 2010, at 04:07 , zaxis wrote: >> >> xxxMain = do >>   timeout <- getEnv "xxx_TIMEOUT" >>   case timeout of >>       Just str | [(t, _)] <- reads str -> do >>           addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exi

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Brandon S. Allbery KF8NH
On Feb 27, 2010, at 04:07 , zaxis wrote: xxxMain = do timeout <- getEnv "xxx_TIMEOUT" case timeout of Just str | [(t, _)] <- reads str -> do addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) return () _ -> return () ... What does the `|` mean

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Lee Duhem
On Sat, Feb 27, 2010 at 5:07 PM, zaxis wrote: > > xxxMain = do >    timeout <- getEnv "xxx_TIMEOUT" >    case timeout of >        Just str | [(t, _)] <- reads str -> do >            addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) >            return () >        _ -> return () > ... >

[Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread zaxis
xxxMain = do timeout <- getEnv "xxx_TIMEOUT" case timeout of Just str | [(t, _)] <- reads str -> do addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) return () _ -> return () ... What does the `|` mean in "Just str | [(t, _)] <- reads str