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.,
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
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
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)
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
[
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
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
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
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
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
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
11 matches
Mail list logo