Haskell: GADT with UNPACK Pragma

UNPACK supports normal data types, as shown in the following:

data T = T {-# UNPACK #-} ! Int

But is there a way to use the UNPACK Pragma with GADT?

Answers


Tried it and found that it actually works with Constructor function arguments.

data BinHeap a where
  Empty :: (Ord a) => BinHeap a
  HeapNode :: (Ord a) => a -> {-# UNPACK #-} !Int -> BinHeap a -> BinHeap a -> BinHeap a

Nice.


Need Your Help

bootstrap tooltip css is not the same as the official example

twitter-bootstrap twitter-bootstrap-3 twitter-bootstrap-tooltip

I'm using bootstrap tooltip, but the style is not the same as the official example.