Skip to content

Instantly share code, notes, and snippets.

@timruffles
Created May 19, 2014 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timruffles/b32433adc1aca1e10298 to your computer and use it in GitHub Desktop.
Save timruffles/b32433adc1aca1e10298 to your computer and use it in GitHub Desktop.
elixir factoring question
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