Created
March 19, 2011 11:34
-
-
Save andreypopp/877419 to your computer and use it in GitHub Desktop.
Refactored code snippet from http://blog.etl.luc.edu/post/3766880636/successive-pattern-matching-and-the-happy-path
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
case req @ DELETE(Path(Seg("users" :: name :: "bookmarks" :: uri))) => for { | |
BasicAuth(u, p) <- req | |
UserFound(user) if verify(u, p, user) <- userRepository.findByName(name) | |
Success <- user.bookmarks.remove(uriString) | |
} yield NoContent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment