It seems that (BigEndian x) <- peek ptr_x is the culprit.

On Oct 7, 2005, at 4:48 PM, Joel Reymont wrote:

This code hangs for me for whatever reason when I run it at the ghci prompt. It does not matter whether I load it from a file or type it in.

On Oct 7, 2005, at 2:50 PM, Benjamin Franksen wrote:


You would probably want to wrap/unwrap values (using
BigEndian/LittleEndian) just before/after calling poke/peek, like this:

\begin{code}
main = do
    ptr_x <- new (BigEndian(1::Int))
    (BigEndian x) <- peek ptr_x
    poke ptr_x (BigEndian 2)
    -- poke ptr_x (LittleEndian 3)
\end{code}


--
http://wagerlabs.com/idealab





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to