
8 Jan
2013
8 Jan
'13
1:03 a.m.
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