#haskell - Sat 21 Apr 2007 between 00:58 and 01:14



sorearmonochrom: 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
sorearmonochrom: also, Java still has a non-moving collector afaik
SamBI was going to say...
allbery_bit was setuid root to have permissions to call mknod()
SamBhow can you have .. and still have the fs being an acyclic graph?
monochromI see. Thanks.
allbery_bIIRC 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.)
SamBit is not quite a DAG, though, with "." and ".."
sorearThe 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_bstrictly speaking, no. but effectively it is, or at least it can be treated as one
SamBwell if you strip out the "." and ".." links, yes ;-)
sorearArray 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)
monochromPtrEq 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
monochromErr, I guess if part of the graph is still a thunk, there is a problem.
SamBperhaps unsafePtrEq# ought to seq its args...
monochromYeah but I wonder if it opens a can of worms.
Saizanjust tag your nodes!
sorearstorage == 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
monochromYeah, if I built the graph myself, I'd certainly add a field for that. But if the graph is given untagged, I'm stuck.
Saizantthis 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
sorearmap (2^)
Saizanthat doesn't even typecheks
sorear> map (2^) [3,5,7]
lambdabot[8,32,128]
sorearI misunderstand?
Saizani think so, i need [Int] -> Int
sorearoh!
hyrax42sum . map (2^) no?
sorearbit packing
monochromsum . map (2^) works, is arithmetic
bit ops also works, if you allow that
Saizan> (sum . map (2^) $ [8,9] ) <= 10^2

Page: 5 12 19 26 33 40 47 54 61 68 75 82 89 96 

IrcArchive