Created
May 19, 2014 15:17
-
-
Save timruffles/b32433adc1aca1e10298 to your computer and use it in GitHub Desktop.
elixir factoring question
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
defprotocol Cache do | |
def cached?(cache,item) | |
end | |
defmodule RedisCache do | |
def cached?(cache,item) | |
end | |
defmodule MapCache do | |
def new do | |
%{} | |
end | |
def cached?(cache,item) do | |
Map.get cache, item | |
end | |
end | |
defmodule RedisCache do | |
def cached?(cache,item) do | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment