Different levels of abstraction

Posted on 2016-07-11 by Oleg Grenrus

Inspired by a Next Level MTL - George Wilson - BFPG 2016-06 talk and by Keynote from Lennart Augustsson - Giving Haskell Types to a Relational Algebra Library in C++

From

dashboardData :: Manager -> GitHubAuth -> YSState
    -> IO $ Either (Either GitHubError YSError) $ Vector (GitHubUser, YSUser)
dashboardData = {- eight lines of boilerplate #-}

to

dashboardData''' :: (MonadGitHub m, MonadYS m) => m (Vector (GitHubUser, YSUser))
dashboardData''' = mergeUsers <$> getGitHubUsers <*> getYsUsers

or something with even more general implementation.

Gist source


Site proudly generated by Hakyll