Hi!
I did once try to learn Prolog. And failed. Miserably.
You should backtrack at this point and try again differently. :-)
Mitar
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Mitar wrote:
I did once try to learn Prolog. And failed. Miserably.
You should backtrack at this point and try again differently. :-)
There is likely a problem if he has inadvently walked past a cut. XD
___
Haskell-Cafe mailing list
ok wrote:
What is so bad about
f x = g x''
where x'' = x' + transform
x' = x * scale
(if you really hate inventing temporary names, that is).
There's nothing at all wrong with this, assuming it's what you meant to
type :-), and it might even correspond perfectly to the
[EMAIL PROTECTED] wrote:
Anyway, I believe strongly that ALL people who have problems with the
Haskell protocole, and they are numerous, I teach a good sample of them,
should be encouraged to learn Prolog. IN DEPTH, and I mean it, Andrew
Coppin and Peter Hercek !
In Prolog A=B is the
Paul Hudak wrote:
ok wrote:
What is so bad about
f x = g x''
where x'' = x' + transform
x' = x * scale
(if you really hate inventing temporary names, that is).
There's nothing at all wrong with this, assuming it's what you meant
to type :-), and it might even
On Aug 31, 2007, at 16:01 , Sterling Clover wrote:
In particular for a function -- n, m, etc or x, y, etc? What about
for f' defined in a let block of f? If I use x y at the top level I
need to use another set below -- is that where x' y' are more
appropriate, or x1, y1?
Usual style is
On 8/30/07, Peter Hercek [EMAIL PROTECTED] wrote:
f x =
let x = x * scale in
let x = x + transform in
g x
Why are you trying to call three different things by the same name 'x'
in one tiny block of code? That's very confusing and makes it hard to
reason equationally about the code.
On 8/30/07, Peter Hercek [EMAIL PROTECTED] wrote:
Hi,
I find the feature that the construct let x = f x in expr
assigns fixed point of f to x annoying. The reason is that
I can not simply chain mofifications a variable like e.g. this:
f x =
let x = x * scale in
let x = x +
On Thu, 2007-08-30 at 18:17 +0200, Peter Hercek wrote:
I find the feature that the construct let x = f x in expr
assigns fixed point of f to x annoying.
Any alternative? Non-recursive assignments?
f x =
let x = x * scale in
let x = x + transform in
g x
I think it is often it
On 8/30/07, Brent Yorgey [EMAIL PROTECTED] wrote:
The way to combine functions into a pipeline is by using function
concatenation:
Oops, of course I meant function composition instead of function
concatenation.
-Brent
___
Haskell-Cafe mailing
On Thu, 2007-08-30 at 18:17 +0200, Peter Hercek wrote:
Hi,
I find the feature that the construct let x = f x in expr
assigns fixed point of f to x annoying. The reason is that
I can not simply chain mofifications a variable like e.g. this:
f x =
let x = x * scale in
let x = x
OK, so it's only tangentally related, but... do you have *any idea* how
many times I've written something like
let x = (some complex function of x)
in (some other complex function of x)
when in fact what I *meant* to do was type x' instead of x?!
It's really maddening to write 50,000 lines
It's really maddening to write 50,000 lines of code, eventually get it
to compile, run it, and have the program lock up and start consuming so
much virtual memory that the entire PC becomes unstable within seconds.
(This isn't helped by the fact that Ctrl+C doesn't seem to make either
GHCi
On Thu, Aug 30, 2007 at 06:16:12PM +0100, Andrew Coppin wrote:
Obviously you might very well have *meant* to write x = f x. But would
it be possible to add some kind of optional compiler warning to find
such assignments? It can be a nightmare trying to track down where you
made the
On 8/30/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Obviously you might very well have *meant* to write x = f x. But would
it be possible to add some kind of optional compiler warning to find
such assignments?
The thing that convinced me to learn Haskell in the first place was
the fact that you
Andrew Coppin wrote:
OK, so it's only tangentally related, but... do you have *any idea*
how many times I've written something like
let x = (some complex function of x)
in (some other complex function of x)
when in fact what I *meant* to do was type x' instead of x?!
I try not to use
Another interesting example of the x = f x use :
coins = [1,2,5,10,20,50,100,200]
beautiful = foldl (\without p -
let (poor,rich) = splitAt p without
with = poor ++
zipWith (++) (map (map (p:)) with)
Peter Hercek wrote:
So the question is what am I missing? Any nice use cases where
fixed point search is so good that it is worth the trouble with
figuring out new and new variable names for essentially the same
stuff?
When I write functional code, I do find myself writing recursions much
F# and Concurrent Clean introduced special syntax for doing this. Basically
they just invent new names for you.
In Haskell (warning: I'm a newbie, so take this with a grain of salt), I
guess you just use monads if you want to pass a value from one function to
another under some context, or you
On Thu, 30 Aug 2007, Peter Verswyvelen wrote:
infixl 0 \ -- I just took the first weird symbol combination that came to
mind, this does not mean anything (I hope ;-)
x \ fx = fx x
f x = x * scale \ \x -
x + transform \ \x -
g x
like this you don't have to invent new names,
Brent Yorgey wrote:
It's really maddening to write 50,000 lines of code, eventually get it
to compile, run it, and have the program lock up and start
consuming so
much virtual memory that the entire PC becomes unstable within
seconds.
(This isn't helped by the fact
David Roundy wrote:
On Thu, Aug 30, 2007 at 06:16:12PM +0100, Andrew Coppin wrote:
Obviously you might very well have *meant* to write x = f x. But would
it be possible to add some kind of optional compiler warning to find
such assignments? It can be a nightmare trying to track down where
Dan Piponi wrote:
On 8/30/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Obviously you might very well have *meant* to write x = f x. But would
it be possible to add some kind of optional compiler warning to find
such assignments?
The thing that convinced me to learn Haskell in the first
On 8/30/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Yeah, but... programs aren't like mathematics. I know people claim that
they are, but they aren't.
But the raison d'etre of Haskell is to make programming more like
mathematics. That motivates everything from the fact that it's a
declarative
Dan Piponi writes:
In mathematics, if you write x = f y you mean that these two
expressions are equal. In Haskell, if you say x = f y you mean *make*
then equal!
Haskell is a declarative language, not an imperative language. When
you write x = f x in Haskell, you're declaring to the
On 8/30/07, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Dan Piponi writes:
In Haskell, there is no box.
Well, there are boxes...
But there also thunks and latent, yet-unevaluated graphs...
But the point of Haskell is to provide an abstraction that hides these
details from you. (Though
On Thu, 2007-08-30 at 23:58 +0200, [EMAIL PROTECTED]
wrote:
Dan Piponi writes:
In mathematics, if you write x = f y you mean that these two
expressions are equal. In Haskell, if you say x = f y you mean *make*
then equal!
Haskell is a declarative language, not an imperative
What is so bad about
f x = g x''
where x'' = x' + transform
x' = x * scale
(if you really hate inventing temporary names, that is).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
28 matches
Mail list logo