2009/1/6 Luke Palmer lrpal...@gmail.com:
2009/1/6 Wang, Chunye (NSN - CN/Beijing) chunye.w...@nsn.com
Dear haskeller,
Can I destructive rebind a local variable like this
import System.Directory
test filename = do
is_dir - doesDirectoryExist filename
let filename = if not is_dir
Hi Evan,
You can also reuse the name exactly by using bind+return instead of
let:
test filename = do
is_dir - doesDirectoryExist filename
filename - return $ if not is_dir then filename else filename
I'm not a huge fan of the prime thing because it's tiny and easy to
miss and if you
2009/1/6 Wang, Chunye (NSN - CN/Beijing) chunye.w...@nsn.com
Dear haskeller,
Can I destructive rebind a local variable like this
import System.Directory
test filename = do
is_dir - doesDirectoryExist filename
let filename = if not is_dir then filename else filename
Nope. The
: [Haskell-cafe] Can I destructive rebind a local variable in
haskell?
2009/1/6 Wang, Chunye (NSN - CN/Beijing) chunye.w...@nsn.com
Dear haskeller,
Can I destructive rebind a local variable like this
import System.Directory
test filename = do