« first day (243 days earlier)      last day (218 days later) » 

17:12
How do you add two numbers properly?
I tried this code, but instead of generating a simple function with single "add" instruction, GHC generates a huge function which do many calls in Haskell runtime - pastebin.com/20p7BLAJ
@Abyx Maybe that's just the price you pay for beautiful, generic source code? ;)
@FredOverflow that price is quite high. I wonder which code would be generated in a real-life code, which say computes SHA
Probably due to lazyness. Have you tried strict evaluation?
Or is CInt (never heard of it) always strict, anyway?
CInt is probably just an Int32.
btw, do I really have to spell signature twice?
oh well... I simplified code to this:
my_func :: CInt
my_func = 42
foreign export ccall my_func :: CInt
and then I get this
000000006c481440 <my_func>:
    6c481440:   53                      push   rbx
    6c481441:   48 83 ec 30             sub    rsp,0x30
    6c481445:   e8 16 2a 08 00          call   6c503e60 <rts_lock>
    6c48144a:   4c 8d 05 df 0b 0c 00    lea    r8,[rip+0xc0bdf]        # 6c542030 <MyModule_zdfstableZZC0ZZCmainZZCMyModuleZZCmyzzufunc_closure>
    6c481451:   48 8d 15 60 0c 0c 00    lea    rdx,[rip+0xc0c60]        # 6c5420b8 <base_GHCziTopHandler_runNonIO_closure>
    6c481458:   48 89 c1                mov    rcx,rax
I understand that it needs to create a closure and then evaluate it
but what does it lock?

« first day (243 days earlier)      last day (218 days later) »