#math - Tue 1 May 2007 between 04:42 and 04:50

NY Lost Funds



Calehere, if an exception occurs in a transaction, it bubbles upward through containing transactions, nullifying their effects so far until it is caught, or else reaches an 'atomically' (where the transaction is running in IO), at which point it re-throws an IO exception.
thermoplyaeSince there seem to be a handful of Haskell advocates in the room, I'm curious:
I'm a long-time Lisp and C programmer, and I really dug into those two because they were sold to me, Lisp for its macros and C for its ability to work with low-level operators
operations
What is Haskell's selling point?
CaleTransactions are allowed to 'retry', which, naively implemented would mean that they just cancel everything that's happened so far and start running again from the top. This is really implemented not as a busy-wait, but by looking at the set of transactional variables which have affected the computation up to that point, and waiting on a change on any of those to try again.
JafetThe biggest thing about C is probably the fact that it gives you access to its innards.
thermoplyaeI have a roommate who's trying to learn and I've asked him a few times, he mumbles something about macros and then ignores me :P
Calethermoplyae: Well, for one, you don't usually need macros :)
JafetEvery object has a reasonably well-defined byte representation.
thermoplyaeerr, Monads
CaleBecause it's lazily evaluated, so it's like every function behaves sort of like a macro.
thermoplyaeI have macros on the brain, sorry
CaleFor instance, if Haskell didn't provide syntax for if-then-else, and I wanted to implement it, I could write:
JafetNot outside of libraries at least.
Caleif' b t e = case b of True -> t; False -> e;
(the ' is just a prime to keep this separately named from the existing syntax)
JafetOkay, that was nothing like C.
thermoplyaecase isn't an elaborate if, analogous to cond?
CaleIt's pattern matching/deconstruction.
thermoplyaewell
I see your point with the lazy evaluation
CaleOkay, let's have a good look at pattern matching :)
skinull lis = case lis of [] -> True; h:t -> False
Caleyeah
or:
null [] = True
null (x:xs) = False
(x:xs) is Haskell's way of saying (cons x xs)
length [] = 0
length (x:xs) = 1 + length xs
JafetA chanop going horribly offtopic, yay.
Cale:)
#math is a #haskell feeder channel
hehe
thermoplyaeLisp has destructuring-bind that does basically the same thing
Calethermoplyae: right
So that's built-in and used extensively.
You can destructure things arbitrarily deeply
Other nice things, as I mentioned before, it's referentially transparent

Page: 2 9 16 23 30 37 44 51 58 65 

IrcArchive

NY Lost Funds