Re: [Haskell-cafe] Who started 42, and when?

2008-02-01 Thread Christopher L Conway
On Feb 1, 2008 9:27 AM, Loup Vaillant [EMAIL PROTECTED] wrote: I suspected this. Just that I didn't noticed 42 but in Haskell papers. Maybe this is just a bias due to my recent interests. I should check some C/C++/Lisp/Ocaml papers. About the library search, Maybe it is possible to try a

Re: [Haskell-cafe] Who started 42, and when?

2008-02-01 Thread Christopher L Conway
Loup, This is not unique to the Haskell community. I suspect the arbitrary constant 42 has been appearing unexplained in research papers for as long as there have been computer scientists who were sci-fi geeks (absolutely no offense intended to geeks ;-). It would be very difficult indeed to

Re: [Haskell-cafe] Please help from a newby

2007-11-02 Thread Christopher L Conway
Karle, The expression (t,d,y) must have type Pkg, by your type annotation for update_table1, so [ (t,d,y) ] has type [Pkg]. Also by your type annotation, the result of update_table1 should by of type Table. Is the type [Pkg] compatible with type Table? In other words, is the type [

Re: [Haskell-cafe] Disjunctive Normal Form

2007-11-01 Thread Christopher L Conway
Jim, Lukes suggestion is a good one, and should help focus you on the syntactic constraints of DNF. A property that your dnf function should have is that the right-hand side of each case should yield a DNF formula. Take, for example, dnf (And s1 s2) = And (dnf s1) (dnf s2) Does And'ing

Re: [Haskell-cafe] Need help from a newby

2007-11-01 Thread Christopher L Conway
Substitute the definition of type Table into the error: Type error in explicitly typed binding *** Term : [(a,p)] *** Type : [(a,b)] *** Does not match : [Table] where [Table] = [[(Address,Port)]] Do you see why the expression [ (a,p) ] cannot have type [ [ (Address, Port)

Re: [Haskell-cafe] int to bin, bin to int

2007-09-27 Thread Christopher L Conway
On 9/27/07, PR Stanley [EMAIL PROTECTED] wrote: Hi intToBin :: Int - [Int] intToBin 1 = [1] intToBin n = (intToBin (n`div`2)) ++ [n `mod` 2] binToInt :: [Integer] - Integer binToInt [] = 0 binToInt (x:xs) = (x*2^(length xs)) + (binToInt xs) Any comments and/or criticisms on the above

Re: [Haskell-cafe] So far, so good! Until... (Haskell 98 Report questions)

2007-08-17 Thread Christopher L Conway
Ian, This is all programming language parsing jargon. If the Wikipedia doesn't help (try http://en.wikipedia.org/wiki/Formal_grammar), I recommend the first few chapters of Aho, Sethi, Ullman's Compilers: Principles, Techniques, and Tools aka the dragon book, or any good book on compilers, e.g.,

Re: [Haskell-cafe] Monad Description For Imperative Programmer

2007-08-01 Thread Christopher L Conway
On 8/1/07, david48 [EMAIL PROTECTED] wrote: As a beginner haskeller coming from an imperative experience, I think I understood what he meant. say you have this code : putStrLn 1 putStrLn 2 putStrLn 3 you can imagine each of the calls to putStrLn gets implicitly passed a variable

Re: [Haskell-cafe] Limits of deduction

2007-05-14 Thread Christopher L Conway
On 5/14/07, Roberto Zunino [EMAIL PROTECTED] wrote: Also, using only rank-1: polyf :: Int - a - Int polyf x y = if x==0 then 0 else if x==1 then polyf (x-1) (\z-z) else polyf (x-2) 3 Here passing both 3 and (\z-z) as y confuses the type inference. Actually, I tried

[Haskell-cafe] Code layout in Emacs' haskell-mode

2007-05-14 Thread Christopher L Conway
I am new to Haskell---and also to languages with the off-side rule--and working my way through Hal Daume's tutorial. I'm a little confused by the support for code layout in Emacs' haskell-mode. Is it buggy, or am I doing something wrong. For example, here's the Hello, world example from the

Re: [Haskell-cafe] Code layout in Emacs' haskell-mode

2007-05-14 Thread Christopher L Conway
On 5/14/07, David House [EMAIL PROTECTED] wrote: You should install 2.3 from the haskell-mode page [1]. Isaac Jones, maintainer of the Debian haskell-mode package has been contacted in order to get the latest version in the Debian repository, so it should happen soon, but in the mean time you