Skip to content

Instantly share code, notes, and snippets.

@liangzan
Last active December 28, 2015 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liangzan/e674a3806a39ee51cb0b to your computer and use it in GitHub Desktop.
Save liangzan/e674a3806a39ee51cb0b to your computer and use it in GitHub Desktop.
toResponse :: IO (Response BL.ByteString) -> BL.ByteString
toResponse i = view responseBody i
-- compiler error
Couldn't match type ‘IO (Response BL.ByteString)’
with ‘Response BL.ByteString’
arising from a functional dependency between:
constraint ‘mtl-2.2.1:Control.Monad.Reader.Class.MonadReader
(Response BL.ByteString) ((->) (IO (Response BL.ByteString)))’
arising from a use of ‘view’
instance ‘mtl-2.2.1:Control.Monad.Reader.Class.MonadReader
r ((->) r)’
at <no location info>
In the expression: view responseBody i
In an equation for ‘imageToResponse’:
imageToResponse i = view responseBody i
In the expression: view responseBody i
In an equation for ‘imageToResponse’:
imageToResponse i = view responseBody i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment