| sorear | monochrom: consider, if it didn't, 'fst (2,2)' monochrom: tuple it, move w/o fixing, fst, segfault |
| allbery_b | /bin/mkdir used mknod() to create a "raw" directory, then link() to create the "." and ".." entries |
| sorear | monochrom: also, Java still has a non-moving collector afaik |
| SamB | I was going to say... |
| allbery_b | it was setuid root to have permissions to call mknod() |
| SamB | how can you have .. and still have the fs being an acyclic graph? |
| monochrom | I see. Thanks. |
| allbery_b | IIRC it was around v5 that ".." came about that the filesystem was converted from a tree to a DAG *about and that |
| monochrom | (It helps that I'm now skimming through the G machine etc, so I have some confidence imagining a model of this.) |
| SamB | it is not quite a DAG, though, with "." and ".." |
| sorear | The real problem with reallyUnsafePtrEq# is that it almost always returns False. (ok, 0#, False doesn't exist this far down) because almost every operation returns a newly constructed thunk, and these have different addresses. |
| allbery_b | strictly speaking, no. but effectively it is, or at least it can be treated as one |
| SamB | well if you strip out the "." and ".." links, yes ;-) |
| sorear | Array and IORef == uses address equality, but doesn't have this problem because the compared addresses are those of Array# and MutVar# primitives, which are unlifted (never made into thunks) |
| monochrom | PtrEq is very useful. In DFSing a graph, PtrEq or even PtrOrd is a very efficient way to ask "have I visited this node yet?" |
| allbery_b | "." is a convenience; ".." allows backward traversal of the tree |
| monochrom | Err, I guess if part of the graph is still a thunk, there is a problem. |
| SamB | perhaps unsafePtrEq# ought to seq its args... |
| monochrom | Yeah but I wonder if it opens a can of worms. |
| Saizan | just tag your nodes! |
| sorear | storage == on functions is not allowed for semantic reasons, since it makes inlining visible: let id = (\x -> x) in id == id -- True (\x -> x) == (\x -> x) -- False |
| monochrom | Yeah, if I built the graph myself, I'd certainly add a field for that. But if the graph is given untagged, I'm stuck. |
| Saizan | tthis reminds me of: is there a simple way to map subsets of [1..n] to [1..2^n] ? by simple i mean an arithmetic expression that takes the elements(ordered) of the subset as variables |
| sorear | map (2^) |
| Saizan | that doesn't even typecheks |
| sorear | > map (2^) [3,5,7] |
| lambdabot | [8,32,128] |
| sorear | I misunderstand? |
| Saizan | i think so, i need [Int] -> Int |
| sorear | oh! |
| hyrax42 | sum . map (2^) no? |
| sorear | bit packing |
| monochrom | sum . map (2^) works, is arithmetic bit ops also works, if you allow that |
| Saizan | > (sum . map (2^) $ [8,9] ) <= 10^2 |