Created
April 23, 2019 04:23
-
-
Save third774/c61b91b1115ec528017513919b9d4d5a to your computer and use it in GitHub Desktop.
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
chk :: Eq b => (a -> b) -> a -> b -> Bool | |
-- All arguments are present on the left | |
-- chk fn a b = b == fn a | |
-- get rid of 'b' param on the left by partially applying (==) operator | |
-- chk fn a = (== fn a) | |
-- get rid of 'a' param on the left by composing (==) after fn | |
-- chk fn = (==) . fn | |
-- get rid of fn on the left by partially applying the (.) operator | |
chk = ((==) .) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment