@@ -297,7 +297,10 @@ decode1 table state codep byte =
297297-- Resumable UTF-8 decoding
298298-------------------------------------------------------------------------------
299299
300+-- Strangely, GHCJS hangs linking template-haskell with this
301+#ifndef __GHCJS__
300302{-# ANN type UTF8DecodeState Fuse #-}
303+#endif
301304data UTF8DecodeState s a
302305 = UTF8DecodeInit s
303306 | UTF8DecodeInit1 s Word8
@@ -567,7 +570,9 @@ decodeUtf8Lax = decodeUtf8
567570-- Decoding Array Streams
568571-------------------------------------------------------------------------------
569572
573+#ifndef __GHCJS__
570574{-# ANN type FlattenState Fuse #-}
575+#endif
571576data FlattenState s a
572577 = OuterLoop s !(Maybe (DecodeState, CodePoint))
573578 | InnerLoopDecodeInit s (ForeignPtr a) !(Ptr a) !(Ptr a)
@@ -777,10 +782,14 @@ ord4 c = assert (n >= 0x10000) (WCons x1 (WCons x2 (WCons x3 (WCons x4 WNil))))
777782 x3 = fromIntegral $ ((n `shiftR` 6) .&. 0x3F) + 0x80
778783 x4 = fromIntegral $ (n .&. 0x3F) + 0x80
779784
785+#ifndef __GHCJS__
780786{-# ANN type EncodeState Fuse #-}
787+#endif
781788data EncodeState s = EncodeState s !WList
782789
790+#ifndef __GHCJS__
783791{-# ANN type InvalidAction Fuse #-}
792+#endif
784793data InvalidAction =
785794 DropInvalid | ErrorInvalid | IgnoreInvalid | ReplaceInvalid
786795