When I :load this into ghci
import Data.Heap
heap = empty :: MinHeap (Int,String)
insert (1,"kjh") heap
I get
GHC stage restriction: `heap'
is used in a top-level splice or annotation,
and must be imported, not defined locally
In the second argument of `insert', namely `heap'
In the expression: insert (1, "kjh") heap
But when I type in
import Data.Heap
let heap = empty :: MinHeap (Int,String)
insert (1,"kjh") heap
everything works and I get
fromList [(1,"kjh")]
Why is that so and what can I do to prevent the "stage restriction"?
--
Martin
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners