Skip to content

Instantly share code, notes, and snippets.

@Cedev
Created April 16, 2017 05:07
Show Gist options
  • Save Cedev/b55e8bba2d6a33f5023385addbf51c3e to your computer and use it in GitHub Desktop.
Save Cedev/b55e8bba2d6a33f5023385addbf51c3e to your computer and use it in GitHub Desktop.
nested dos
main = do
chars <- getLine
let otherchars = do
a <- chars
b <- chars
[a] ++ [b]
putStrLn otherchars
@VictorTaelin
Copy link

VictorTaelin commented Apr 16, 2017

Notice it would be much nicer if the let x = y in z syntax was just x = y; z. Also do could be used to avoid {}, I guess. So,

main =
  chars = #getLine
  otherChargs = do
    a = #chars
    b = #chars
    a ++ b
  putStrLn otherChars

In an ideal world?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment