#haskell - Mon 19 Feb 2007 between 23:21 and 23:32

NY Lost Funds



kc5tja> let ($+$)=(+) in let a (+) b = if a == 1 && b == 1 then 3 else a ($+$) b in 1+1
lambdabot2
kc5tjaHah...
See? There's no convincing it that 1+1=3. Next, it'll tell you that the world is round too.
LoganCapaldo_It's only because Haskell doesn't make you follow up your lets with recs
kc5tjaI'm not trying to be recursive though.
ddarius> let ($+$) = (+); a+b | a == 1 && b == 1 = 3 | otherwise = a $+$ b in 1+1
lambdabot3
sorear> let 1 + 1 = 3 in 1 + 1
lambdabot3
LoganCapaldo_exactly
sorear> let a + b | a == 1 && b == 1 = 3 | True = a Prelude.+ b in 1 + 1 -- ddarius, you're making it too hard
lambdabot3
beelsebob_> let a + b = error "Out of cheese error, redo from start" in 1+1
ddariussorear: I'm trying to match kc5tja's example more closely.
lambdabotException: Out of cheese error, redo from start
LoganCapaldo_So I guess i should have said (Prelude.+) a b and not Prelude.(+)
beelsebob_:)
kc5tjasorear: For a 1-liner, I find ddarius' solution easier to read. Yours would be easier on multiple lines though.
ddarius> 1 `Prelude.elem` []
lambdabotFalse
kc5tjaHeheh -- out of cheese error. Awesome.
beelsebob_`He [the Archchancellor] called me in and asked me what I did, exactly. Have you ever heard of such a thing? What sort of question is that? This is a university!'
ddarius@hoogle (a -> b) -> a -> (b,b)
lambdabotNo matches, try a more general search
kc5tjaHmmm....the out of cheese exception is defined in the Wallace.lhs module, right? ;)
beelsebob_really?
surely in the Pratchet.lhs module
along with divide by cucumber
kc5tjaPerhaps there too, I dunno -- I never read Pratchet. I only know that many of Wallace and Grommit's travails revolve around cheese or its lack thereof in some capacity.
beelsebob_ah, I see
see the out of cheese error comes from the computer build from an ants nest and some honey by the librarian
(who is an orangutan, hence the language Ook!)
the ants need feeding
(obviously with cheese)
"And therefore education at the University mostly worked by the age-old method of putting a lot of young people in the vicinity of a lot of books and hoping that something would pass from one to the other, while the actual young people put themselves in the vicinity of inns and taverns for exactly the same reason." [Pratchet]
kc5tjaIs this in the Discworld series by any chance? I vaguely remember a wizard recognizing a passing ant that he once knew, and the ant wanted nothing to do with him any more (or that walking chest). God, maybe I did read some -- but it was YEARS ago.
beelsebob_that sounds about right
SamBbeelsebob_: sounds oddly familiar...
beelsebob_I think it's from the science of the disk world

Page: 1 8 15 22 29 36 43 50 57 64 71 78 85 

IrcArchive

NY Lost Funds