
Solution by TheHunter on #haskell: be = $(lift $ (1::CChar) /= (unsafePerformIO $ with (1::CInt) $ peekByteOff `flip` 0) ) :: Bool Thanks, Joel On Oct 6, 2005, at 9:13 PM, Joel Reymont wrote:
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