Hi
I'm just wondering, why haven't process properties (such as the command
line arguments, or the parent process id), which are inherently global,
been made global values in the Haskell standard? You could avoid
needlessly carrying around these values, you wouldn't need to lift some
functions into
I want to build a binary tree where each leaf is a string of "L" and "R"
defining their position from the top
This should be done without context isn't it?
data Tree a = Fork (Tree a) (Tree a) | Leaf a deriving Show
t =Leaf ""
treeGrower :: Tree a -> Tree a
treeGrower (Leaf a )= treeGrower (Fork
Hi
My question is how do I select or work with product Alhebraic types ? Let
you give you some context:
I need to be able to work with a list of items whos structure is onyl
partially know. That is at the level of this module I dont care about what
rest of it is. So I have this:
type Fitness =
Hi
Not looking to get flamed, just offering my opinion.
I got the SOE first, and while I like the higher level of it, the way he
thinks etc... I found it hard to learn haskell from it. I just recieved
"Haskell: The Craft of cuntional Programming" this weekend, and have made
huge leaps forward (f
paolo veronelli wrote:
I want to build a binary tree where each leaf is a string of "L" and "R"
defining their position from the top
This should be done without context isn't it?
I'm not sure what you mean with "context" here, but anyway...
data Tree a = Fork (Tree a) (Tree a) | Leaf a deriving S
I strongly recommend "Yet Another Haskell Tutorial by Hal Daume III et
al." in conjuction or prior to CFP book. It's really helped clear
some things ups for me. It seems more pragmatic and less academic
than the other learning haskell resources.
Here's the link -> http://www.isi.edu/~hdaume/htu
Crypt Master,
CM> I need to be able to work with a list of items whos
CM> structure is onyl partially know. That is at the level
CM> of this module I dont care about what rest of it is.
CM> So I have this:
< type Fitness = Integer
< data Population a = Population [Fitness a]
Well, first
> I'm just wondering, why haven't process properties (such as the command
> line arguments, or the parent process id), which are inherently global,
> been made global values in the Haskell standard? You could avoid
> needlessly carrying around these values, you wouldn't need to lift some
> functio
Now I have my infinite tree inf
t =Leaf "1"
treeGrower :: Tree String-> Tree String
treeGrower (Leaf a )= treeGrower (Fork (Leaf (a++"1")) (Leaf (a++"2")))
treeGrower (Fork l r) = Fork (treeGrower l) (treeGrower r)
data Tree a = Fork (Tree a) (Tree a) | Leaf a deriving Show
inf=treeGrower t
I'd li
On Sun, 4 Jul 2004 19:17:53 +0100, Alastair Reid <[EMAIL PROTECTED]> wrote:
I'm just wondering, why haven't process properties (such as the command
line arguments, or the parent process id), which are inherently global,
been made global values in the Haskell standard? You could avoid
needlessly ca
Hi
Man, your a genius :-) Thanks for the help , still dijesting it.
Interestingly enough I was playing with how to use sacnl1 just before I got
this message from you, but as you mentioned I was battling with "kind"
errors so I never got to test my idea besides on paper.
Am I correct in assuming
Alastair Reid writes:
>
> > I'm just wondering, why haven't process properties (such as the
> > command line arguments, or the parent process id), which are
> > inherently global, been made global values in the Haskell standard?
> > You could avoid needlessly carrying around these values, you
> >
Crypt Master,
> data Population a = Population [(Fitness, a)]
CM> Am I correct in assuming that your definition of
CM> Popoulation is now using tuple and not product types ?
Yes, you are. If you really want to use a new product, you can of course:
> data FitnessProd a = FProd Fitness a
>
Crypt Master writes:
> Am I correct in assuming that your definition of Popoulation is now
> using tuple and not product types ?
Actually, tuples *are* product types. They just have some syntactic
sugar defined for them in the language.
For example,
Main> ('x',5) :: (Char,Int)
('x',5)
I have to second that... even having previous
experience with other functional languages and some
other books on the subject, "Yet Another Haskell
Tutorial" was a very good read. I am waiting to see
the parts that remain to be finished.
---
[]s, Andrei de A. Formiga
--- wilkes joiner <[EMAIL
David Menendez wrote:
[...] If that turned out to be a performance bottleneck, you could factor out
pair and write f directly: [...]
... or directly complain to your compiler supplier if the compiler in question
does not do this simple transformation for you. :-)
I always get a bad feeling when
> Sorry, but why does [making process properties global values] not
> break the purity? If i call a function, that depends on global
> parameters twice within different environments it behaves
> different.
The argument goes that purity is concerned with what happens in a single run
of the prog
Sven Panne writes:
> David Menendez wrote:
> > [...] If that turned out to be a performance bottleneck, you could
> > factor out pair and write f directly: [...]
>
> or directly complain to your compiler supplier if the compiler
> in question does not do this simple transformation for you. :
> t =Leaf "1"
>
> treeGrower :: Tree String-> Tree String
> treeGrower (Leaf a )= treeGrower (Fork (Leaf (a++"1")) (Leaf (a++"2")))
> treeGrower (Fork l r) = Fork (treeGrower l) (treeGrower r)
>
> data Tree a = Fork (Tree a) (Tree a) | Leaf a deriving Show
>
> inf=treeGrower t
Welcome to Haskell
I downloaded and compiled buddha, but it apparently does not support
Control.Monad.State. I downloaded Hat, but it requires hmake. Hmake
fails to build (GHC 6.2.1).
Any suggestions?
Jim
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell
20 matches
Mail list logo