Skip to content

Instantly share code, notes, and snippets.

@ConnorRigby
Last active August 3, 2018 17:42
Show Gist options
  • Save ConnorRigby/8f1f0e8a7b1ac943c2896663a5443429 to your computer and use it in GitHub Desktop.
Save ConnorRigby/8f1f0e8a7b1ac943c2896663a5443429 to your computer and use it in GitHub Desktop.
defmodule A do
def err(_, <<length, data :: binary>>) do
case {length, data} do
{0, _} -> data
{4, <<rest :: binary>>} -> rest
end
end
end
<<0>> = A.err(0, <<0>>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment