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
import System.Environment (getArgs) | |
main :: IO () | |
main = do | |
args <- getArgs | |
let n = read $ head args :: Int | |
putStrLn . show $ fib n | |
fib :: Int -> Integer | |
fib 0 = 0 |
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
defmodule Fetcher do | |
def db_value_for(key) do | |
IO.puts "processing..." | |
"db value for #{key}" | |
end | |
defmacro get(map, key, default \\ nil) do | |
quote do | |
case Map.get(unquote(map), unquote(key)) do | |
nil -> unquote(default) |
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
dummy |
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
defmodule XmlParser do | |
require Record | |
Record.defrecord :xmlElement, Record.extract(:xmlElement, from_lib: "xmerl/include/xmerl.hrl") | |
Record.defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl") | |
@xml """ | |
<result> | |
<event> | |
<title>My event</title> |
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
erlang 18.0 | |
elixir 1.1.1 |
OlderNewer