Rotaerk 2017-03-08 17:57:17
\o/
deepfire 2017-03-08 17:57:48
that's a good implementation for a HasLub instance : -)
johnw 2017-03-08 17:58:04
nshepperd: so, there's cons header, cons pointer to Word8, cons pointer to next cell; Word8 header, pointer to Word8 contents; Word8 data. Unless the constructor syntax "W8# Word#" implies some kind of unpacking...
nshepperd 2017-03-08 17:59:12
or maybe it's more...oh wait, maybe 24 bytes is just list spine
johnw 2017-03-08 17:59:24
yeah, definitely 24 in spine
nshepperd 2017-03-08 18:04:12
johnw: `recursiveSize $! force ([1]::[Word8]` gives me 48 in ghci
johnw 2017-03-08 18:04:45
isn't that what recursiveSizeNF does?
johnw 2017-03-08 18:04:54
ah, $! makes the difference
nshepperd 2017-03-08 18:05:18
recursiveSizeNF looks like a mistake :/
johnw 2017-03-08 18:05:24
it does, weird numbers
nshepperd 2017-03-08 18:05:36
it applys `force` but doesn't actually evaluate the value
johnw 2017-03-08 18:05:40
so, 40 bytes per element, plus 8 for nil
kadoban 2017-03-08 18:07:39
376 sounds pretty high, wonder how that adds up. Every possible piece like ... 3? could be a thunk, and then the actual required sizes of stuff? Hmm.
johnw 2017-03-08 18:07:57
nshepperd had it right with 24 + 16
nshepperd 2017-03-08 18:10:21
kadoban: in ghci it's probably a pointer to some extremely unoptimized code for building the list
kadoban 2017-03-08 18:12:30
Ahh
nshepperd 2017-03-08 18:13:14
especially with numbers, you've got a whole thunk just to call fromInteger in there
nshepperd 2017-03-08 18:13:32
(and then another one to build the integer i guess)