[jhc] JHC: problem with transformers

Dmitry Kulagin dmitry.kulagin at gmail.com
Mon Jul 21 07:30:40 UTC 2014


Hi John,

I experiment with JHC, trying to get working some code. Could you help with
following code:

> module Main where
> import Data.Map as M

> g :: M.Map String Int
> g = M.delete "b" M.empty

> main = print g

If it is compiled with: -f no-global-optimize, then incorrect C-code
generated.

(([N],"Prelude.error: Map.deleteFindMax: can not return the maximal element
of an empty map"),Berr_18131)
(([N],"Prelude.error: Map.deleteFindMin: can not return the minimal element
of an empty map"),Berr_18132)
...
tmp1/main_code.c:5956:21: error: variable ‘_c7’ has initializer but
incomplete type
tmp1/main_code.c:5959:21: error: variable ‘_c6’ has initializer but
incomplete type

Compiler version: jhc 0.8.2 (0.8.2-55) (the most recent from darcs)
Full compiler output is in attach.

PS.: This code _does_ compile if I don't use -f no-global-optimize.
However, I experiment with larger code, which is only compiled if I turn
this optimization off. That is why I try to stick with this option.

Thanks!
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/jhc/attachments/20140721/6c46913e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.log
Type: text/x-log
Size: 35127 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/jhc/attachments/20140721/6c46913e/attachment-0001.bin>


More information about the jhc mailing list