Skip to content

Commit

Permalink
Rename Monoid.id to Monoid.identity
Browse files Browse the repository at this point in the history
  • Loading branch information
expede committed Oct 25, 2015
1 parent 94737ba commit 34faa91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/witchcraft/monoid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defprotocol Witchcraft.Monoid do
Because you cannot divide by zero, the property does not hold for all values in the set.
# Notes
You can of course use abuse this protocol to define a fake "monoid" that behaves differently.
You can of course use abuse this protocol to define a fake 'monoid' that behaves differently.
For the protocol to operate as intended, you need to respect the above properties.
"""

Expand All @@ -58,7 +58,7 @@ defprotocol Witchcraft.Monoid do

@doc "Get the idenity ('zero') element of the monoid by passing in any element of the set"
@spec id(any) :: any
def id(a)
def identity(a)

@doc "Combine two members of the monoid, and return another member"
@spec op(any, any) :: any
Expand Down
2 changes: 1 addition & 1 deletion lib/witchcraft/monoid/properties.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Witchcraft.Monoid.Properties do

# @spec test_id :: boolean
# def spotcheck_id(member) do
# op(id, member) == member
# op(identity, member) == member
# end

# def spotcheck_associativity(member1, member2, member3) do
Expand Down

0 comments on commit 34faa91

Please sign in to comment.