
3 Oct
2013
3 Oct
'13
3:46 p.m.
Thanks to all for your replies!
I asked the question because I often make this kind of transformations
(please don't mind the non-sensical example):
test :: Bool -> IO ()
test foo = do
bar <- case foo of
True -> return "Foo"
False -> return "Bar"
return ()
into
test :: Bool -> IO ()
test foo = do
let bar = case foo of
True -> "Foo"
False -> "Bar"
return ()
And was wondering why can't I maintain the initial (and nicer) indentation.
But since let allows for several bindings, it make sense...
Best,
Corentin
On Thu, Oct 3, 2013 at 8:31 PM, Corentin Dupont
test :: Bool -> IO () test foo = do let bar = case foo of True -> "Foo"; False -> "Bar" return ()