Toggle navigation
New
Learn
Snippets
Meta
News
About
API Docs
Source Code
Account
Register
Login
Elixir pattern matching map in function
main.ex
dio.ex
✖
tria.ex
✖
tessera.ex
✖
pente.ex
✖
eksi.ex
✖
Run Settings
Language
Elixir
Language Version
latest
Run Command
Snippet Metadata
Owner
Petter Rasmussen
Created
Modified
Visibility
Public
defmodule Main do def main() do http_map = %{"type" => "http", "http" => "http config"} tcp_map = %{"type" => "tcp", "tcp" => "tcp config"} handle(http_map) handle(tcp_map) end def handle(map=%{"type" => "http"}) do IO.puts "http handler: " <> map["http"] end def handle(map=%{"type" => "tcp"}) do IO.puts "tcp handler: " <> map["tcp"] end end Main.main
Editor Settings
Theme
Chrome
Clouds
Crimson Editor
Dawn
Dreamweaver
Eclipse
GitHub
Solarized Light
TextMate
Tomorrow
XCode
Kuroir
KatzenMilch
Ambiance
Chaos
Clouds Midnight
Cobalt
idle Fingers
krTheme
Merbivore
Merbivore Soft
Mono Industrial
Monokai
Pastel on dark
Solarized Dark
Terminal
Tomorrow Night
Tomorrow Night Blue
Tomorrow Night Bright
Tomorrow Night 80s
Twilight
Vibrant Ink
Key bindings
Default
Vim
Emacs
Full width
True
False
Lines
-
Auto
+
Direct link
Raw
Embed