Haskell Type error

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-04-16T03:51:27Z Indexed on 2010/04/16 3:53 UTC
Read the original article Hit count: 292

Filed under:
|
|

I am getting a Couldn't match expected type error on this code and am not sure why. Would appreciate it if someone could point me in the right direction as to fixing it.

import qualified Data.ByteString.Lazy as S
import Data.Binary.Get
import Data.Word

getBinary :: Get Word16
getBinary = do
  a <- getWord16be "Test.class"
  return (a)

main :: IO ()
main = do
  contents <- S.getContents
  print getBinary contents

Specifically it cannot match expected type 'S.ByteString -> IO ()' to inferred type 'IO ()'

© Stack Overflow or respective owner

Related posts about haskell

Related posts about error-message