Last active
October 16, 2018 14:25
-
-
Save patrl/db83330ade0cfab431dce6ff87de7756 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
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} | |
Module ForwardsBackwards where | |
import Data.Function ((&)) | |
class A a b where | |
apply :: a -> b | |
instance A (a -> b) (a -> b) where | |
apply = ($) | |
instance A a ((a -> b) -> b) where | |
apply = (&) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment