[Haskell-beginners] Vaccum Cairo Errors

Daniel Fischer daniel.is.fischer at web.de
Mon Sep 21 10:37:04 EDT 2009


Am Montag 21 September 2009 16:21:10 schrieb aditya siram:
> Hi all,
> I am trying out the awesome Vacuum Cairo package on GHC 6.10.3 but I am
>
> getting some interesting errors. The following works in GHCI:
> > view [1 .. 3]
>
> But the following does not work in GHCI:
> > let x = [1 .. 3]
> > view x
>
> or,
>
> > x <- return [1 .. 3]
> > view x
>
> For the last two I get:
> context:     "(:)|0" -> >>>  {"1|1", <<< "(:)|2"}
> ghc: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int) ((xcb_req)
> - (dpy->request)) >= 0)' failed.
> Aborted
>
> and GHCI quits.
>
> Any ideas?
> thanks ...
> deech

Probably it's that in the last two, x is given the type [Integer] by ghci (see 
http://www.haskell.org/haskellwiki/Monomorphism_Restriction ) while view expects an [Int].
Do

let x = [1 .. 3] :: [Int]
view x

and

x <- return ([1 ..  3] :: [Int])
view x

work?


More information about the Beginners mailing list