Skip to content

Instantly share code, notes, and snippets.

@patrl
Last active October 16, 2018 14:25
Show Gist options
  • Save patrl/db83330ade0cfab431dce6ff87de7756 to your computer and use it in GitHub Desktop.
Save patrl/db83330ade0cfab431dce6ff87de7756 to your computer and use it in GitHub Desktop.
{-# 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