-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dexts: use a protocol for Select and Match
- Loading branch information
Showing
3 changed files
with
55 additions
and
54 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
# Version 2, December 2004 | ||
# | ||
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
# | ||
# 0. You just DO WHAT THE FUCK YOU WANT TO. | ||
|
||
defprotocol Dexts.Selection do | ||
def next(self) | ||
def values(self) | ||
end | ||
|
||
defimpl Dexts.Selection, for: Atom do | ||
def next(nil) do | ||
nil | ||
end | ||
|
||
def values(nil) do | ||
[] | ||
end | ||
end |