Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Web applications as profunctors
module Application where
import Data.Profunctor
newtype Application request response = Application {unApplication :: request -> IO response}
instance Profunctor Application where
dimap actOnRequest actOnResponse application = Application $ (fmap actOnResponse) . (unApplication application) . actOnRequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment