[Haskell-cafe] wondering about a MonadIO instance for a heap data type

Conrad Parker conrad at metadecks.org
Thu Jul 12 02:32:09 CEST 2012

On 12 July 2012 06:19, Qi Qi <qiqi789 at gmail.com> wrote:
> Hi,
> I was wondering about creating an instance of MonadIO for a heap data.
> Any hints?
> data Heap a = E | T Int a (Heap a) (Heap a)
>      deriving (Eq, Ord, Read, Show)
> The reason is that I want to use liftIO during a heapsort to print out
> intermediate results.

If you just want this for debugging, you're probably better off using
Debug.Trace to print the intermediate results.


More information about the Haskell-Cafe mailing list