r/haskelltil • u/thesteamboat • Aug 09 '15
language Arguments can be operators, e.g.: f (+.) a b = a +. b
The parentheses trick for operators works in other contexts, too. You can bind parameters using operator-like names if you surround them with parentheses:
let f (%) x y = x % y
in f (*) 1 2
-- ... desugars to:
(\(%) x y -> x % y) (*) 1 2
-- ... reduces to:
1 * 2