[Haskell-cafe] Endian conversion

Joel Reymont joelr1 at gmail.com
Thu Oct 6 15:13:18 EDT 2005


Why doesn't this compile?

be = $( (1::CChar) /= (unsafePerformIO
                       $ with (1::CInt)
                       $ peekByteOff `flip` 0) ) :: Bool

Endian.hs:10:8:
     Couldn't match `Language.Haskell.TH.Lib.ExpQ' against `Bool'
       Expected type: Language.Haskell.TH.Lib.ExpQ
       Inferred type: Bool
     In the expression:
         (1 :: CChar)
         /= (unsafePerformIO $ ((with (1 :: CInt)) $ (peekByteOff  
`flip` 0)))
     In the expression:
           $[splice]((1 :: CChar)
                     /= (unsafePerformIO $ ((with (1 :: CInt)) $  
(peekByteOff `flip` 0)))) ::
             Bool

     Thanks, Joel



More information about the Haskell-Cafe mailing list