Created
September 9, 2018 17:43
-
-
Save jjant/a449db79ad6a82268160de4fe2b087be to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| isAdmin :: FreeMonoid (String, Bool) -> Bool | |
| isAdmin perms = interpret True (\(_, perm) rest -> perm && rest) perms | |
| isPowerUser :: FreeMonoid (String, Bool) -> Bool | |
| isPowerUser perms = interpret False (\(_, perm) rest -> perm || rest) perms | |
| isRegularUser :: FreeMonoid (String, Bool) -> Bool | |
| isRegularUser perms = not (isPowerUser perms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment