Created
June 21, 2023 14:25
-
-
Save frerich/6ab04d6c2337f46122c1f3ec7ec8b863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IO.stream(:line) | |
|> Stream.map(&String.trim_trailing/1) | |
|> Enum.reduce(%{}, fn | |
"list", todo -> IO.inspect(todo) | |
"add " <> item, todo -> Map.put(todo, item, false) | |
"complete " <> item, todo -> Map.put(todo, item, true) | |
"delete " <> item, todo -> Map.delete(todo, item) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment