I have a function in Haskell:
import qualified Codec.Picture as Juicy
--juicyLoad :: FilePath -> IO (Vector Word8)
juicyLoad file = do
image <- Juicy.readPng file
case image of
Left err -> undefined
Right (Juicy.ImageRGB8 (Juicy.Image w h dat)) ->
return dat
GHC infers the type to be FilePath -> IO (Vector Word8)
, which is what I want. When I actually define that in the source file (juicyLoad :: FilePath -> IO (Vector Word8)
), there is an error: Couldn't match expected type 'Vector Word8' with actual type 'Vector(PixelBaseComponent PixelRGB8'.
This seems like a job for a {-# LANGUAGE x #-}
option, I just don't know which one