Для теста — пять строчек
module A (a, b, c) where
import A (a, b, c)
data A = A { _a :: Int }
newtype A = A (B ())
foreign import ccall "a" a :: A (B ())
помещаются в [ code = haskell ]:
module A (a, b, c) where
import A (a, b, c)
data A = A { _a :: Int }
newtype A = A (B ())
foreign import ccall "a" a :: A (B ())
при включённых highlight.pack.js и combined.css у меня они разбиваются на куски (http://i.imgur.com/RNg2WCf.png), хромиум 28, происходит во всех темах, если посмотреть по форуму — уже существующий код тоже плохо отображается (пример — Haskell импорт сишных структур), при копировании обратно в редактор всё отображается нормально, то есть проблема в css который добавляет highlight.pack.js:
<code class="haskell"><span class="module"><span class="keyword">module</span> A <span class="container">(<span class="title">a</span>, <span class="title">b</span>, <span class="title">c</span>)</span> <span class="keyword">where</span></span>
<span class="import"><span class="keyword">import</span> A <span class="container">(<span class="title">a</span>, <span class="title">b</span>, <span class="title">c</span>)</span></span>
<span class="typedef"><span class="keyword">data</span> <span class="type">A</span> = <span class="type">A</span> <span class="container">{ <span class="title">_a</span> :: <span class="type">Int</span> }</span></span>
<span class="typedef"><span class="keyword">newtype</span> <span class="type">A</span> = <span class="type">A</span> <span class="container">(<span class="type">B</span> ()</span>)</span>
<span class="title">foreign</span> <span class="import"><span class="keyword">import</span> ccall "a" a :: A <span class="container">(<span class="type">B</span> ()</span>)</span>
</code>
исправляется устранением
.container:before, .container:after {
content: "";
display: table;
}
К слову:
k: "let in if then else case of where do module import hiding qualified type data newtype deriving class instance not as foreign ccall safe unsafe"
not тут лишний (это функция) — http://www.haskell.org/haskellwiki/Keywords.
----
import qualified A.B.C as A.B hiding (a, {- ... -} B(..), c) --
data family A = A { {- ... -} _a :: {-# UNPACK #-} !Int -- ...
#if __Q__
, _a :: C -- ...
#endif
} deriving (Foo) -- ...
newtype A = A (B ()) {- ... -}
deriving (Foo) {-
type A a b = B (C a b) -}
class family (B a) => {- ... -} A a where -- ...
class instance Bar {- ... -} where -- ...
a :: forall a. a -- ...
{-# INLINE a #-}
a = not >> mdo print 1 >> rec 1 '2' '\'' '\n' ':':' ':msg >> proc 1 2 3 >> " -- ..."
+ importA 1
+ moduleA 1
+ classA 1
+ instanceA 1
+ dataA 1
+ newtypeA 1
+ typeA 1
+ defaultA 1
+ infixA 1
+ foreignA 1
+ whereA 1
+ doA 1
default Num {- ... -} ( Int ) -- ...
infix {- ... -} + 1 -- ...
foreign import ccall {- ... -} "a" a :: A (B ()) -- ...
#!/usr/bin/env runhaskell
#if __GLASGOW_HASKELL__
{-# LANGUAGE ... #-}
#endif
-- | ...
module A.B.C (a, {- ... -} B(..), c, -- ...
d, -- ...
e) {- ... -} where -- ...
{- ... -}
import qualified A.B.C as A.B hiding (a, {- ... -} B(..), c) --
data family A = A { {- ... -} _a :: {-# UNPACK #-} !Int -- ...
#if __Q__
, _a :: C -- ...
#endif
} deriving (Foo) -- ...
newtype A = A (B ()) {- ... -}
deriving (Foo) {-
type A a b = B (C a b) -}
class family (B a) => {- ... -} A a where -- ...
class instance Bar {- ... -} where -- ...
a :: forall a. a -- ...
{-# INLINE a #-}
a = not >> mdo print 1 >> rec 1 '2' '\'' '\n' ':':' ':msg >> proc 1 2 3 >> " -- ..."
+ importA 1
+ moduleA 1
+ classA 1
+ instanceA 1
+ dataA 1
+ newtypeA 1
+ typeA 1
+ defaultA 1
+ infixA 1
+ foreignA 1
+ whereA 1
+ doA 1
default Num {- ... -} ( Int ) -- ...
infix {- ... -} + 1 -- ...
foreign import ccall {- ... -} "a" a :: A (B ()) -- ...