## #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 lambdabot 2 kc5tja Hah...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 kc5tja I'm not trying to be recursive though. ddarius > let (\$+\$) = (+); a+b | a == 1 && b == 1 = 3 | otherwise = a \$+\$ b in 1+1 lambdabot 3 sorear > let 1 + 1 = 3 in 1 + 1 lambdabot 3 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 lambdabot 3 beelsebob_ > let a + b = error "Out of cheese error, redo from start" in 1+1 ddarius sorear: I'm trying to match kc5tja's example more closely. lambdabot Exception: Out of cheese error, redo from start LoganCapaldo_ So I guess i should have said (Prelude.+) a b and not Prelude.(+) beelsebob_ :) kc5tja sorear: For a 1-liner, I find ddarius' solution easier to read. Yours would be easier on multiple lines though. ddarius > 1 `Prelude.elem` [] lambdabot False kc5tja Heheh -- 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) lambdabot No matches, try a more general search kc5tja Hmmm....the out of cheese exception is defined in the Wallace.lhs module, right? ;) beelsebob_ really?surely in the Pratchet.lhs modulealong with divide by cucumber kc5tja Perhaps 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 seesee 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] kc5tja Is 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 SamB beelsebob_: sounds oddly familiar... beelsebob_ I think it's from the science of the disk world