
8 Jan
2013
8 Jan
'13
5:22 a.m.
On 08/01/13 07:03, Martin Drautzburg wrote:
import Data.Heap
heap = empty :: MinHeap (Int,String) insert (1,"kjh") heap
Your error is in the last line. `insert (1,"kjh") heap` is an expression, and in Haskell expressions can only occur inside (function) declarations. So you should instead write something like: heap = empty :: MinHeap (Int,String) heap2 = insert (1,"kjh") heap In Ghci, expressions are evaluated and the result is printed, which is why you are able to use it there. Twan