]))
else do f (Roll (z ++ [throw]))
--- On *Wed, 12/22/10, Ozgur Akgun ozgurak...@gmail.com* wrote:
From: Ozgur Akgun ozgurak...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: Ryan Ingram ryani.s...@gmail.com
Cc: haskell-cafe@haskell.org, Daniel
leim...@gmail.comhttp://mc/compose?to=leim...@gmail.com
* wrote:
From: David Leimbach
leim...@gmail.comhttp://mc/compose?to=leim...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: michael rice nowg...@yahoo.comhttp://mc/compose?to=nowg...@yahoo.com
Cc
On Wednesday 22 December 2010 12:03:01, Ryan Ingram wrote:
Huh, that's weird, I just copy and pasted this into a new file and it
worked for me.
As a guess, you have mtl-1.*?
In mtl-2.*, State s is made a type synonym for StateT s Identity, so
there's no longer a data constructor State.
Interesting. In that case,
state f = StateT $ \s - Identity (f s)
allows state to replace State in that code.
On Wed, Dec 22, 2010 at 4:56 AM, Daniel Fischer
daniel.is.fisc...@googlemail.com wrote:
On Wednesday 22 December 2010 12:03:01, Ryan Ingram wrote:
Huh, that's weird, I just copy and
see also:
http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-State-Lazy.html#v:state
On 22 December 2010 20:02, Ryan Ingram ryani.s...@gmail.com wrote:
Interesting. In that case,
state f = StateT $ \s - Identity (f s)
allows state to replace State in that code.
]))
else do f (Roll (z ++ [throw]))
--- On Wed, 12/22/10, Ozgur Akgun ozgurak...@gmail.com wrote:
From: Ozgur Akgun ozgurak...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: Ryan Ingram ryani.s...@gmail.com
Cc: haskell-cafe@haskell.org, Daniel Fischer
daniel.is.fisc
/10, David Leimbach leim...@gmail.com* wrote:
From: David Leimbach leim...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org, Daniel Fischer
daniel.is.fisc...@googlemail.com
Date: Friday, December 17, 2010, 7
/21/10, Ryan Ingram ryani.s...@gmail.com wrote:
From: Ryan Ingram ryani.s...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: michael rice nowg...@yahoo.com
Cc: David Leimbach leim...@gmail.com, Daniel Fischer
daniel.is.fisc...@googlemail.com, haskell-cafe@haskell.org
Date
Ingram ryani.s...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: michael rice nowg...@yahoo.com
Cc: David Leimbach leim...@gmail.com, Daniel Fischer
daniel.is.fisc...@googlemail.com, haskell-cafe@haskell.org
Date: Tuesday, December 21, 2010, 7:00 PM
First, let's make some
On Fri, Dec 17, 2010 at 11:04 AM, michael rice nowg...@yahoo.com wrote:
I don't understand this error message. Haskell appears not to understand
that 1 is a Num.
Prelude :t 1
1 :: (Num t) = t
Prelude :t [1,2,3,4,5]
[1,2,3,4,5] :: (Num t) = [t]
Prelude
Michael
===
f
I think it is giving you the error because you the fmap in your code is
operating on the IO monad and not the List monad. In order to get it to
work, you can remove the IO layer with = as below:
f :: [Int] - IO [Int]
f lst = do return lst
main = do let lst = f [1,2,3,4,5]
lst = return
This is a bit tricky.
The type of 'f' is '[Int] - IO [Int]', which means that the type of 'lst'
is 'IO [Int]'.
So fmap (+1) tries to add one to the [Int] underneath the 'IO' type
constructor.
You can either use two 'fmap's, the first to lift up to IO and the second to
lift into the list, or you
Hi Michael
The type of lst is IO [Int] and therefore fmap (+1) applies (+1) to
the hole lists of integers, and not to each member of the list. That is:
fmap (+1) lst =
fmap (+1) (return [1,2,3,4,5]) =
return ([1,2,3,4,5] + 1)
and you cannot say [1,2,3,4,5] + 1.
Does that make sense?
Maybe
To make that a little clearer, here is code that uses two calls to fmap to
drill through two monadic layers:
f :: [Int] - IO [Int]
f lst = do return lst
main = do let lst = f [1,2,3,4,5]
fmap (fmap (+1)) lst
So the order of operations is :
1. The first fmap converts an IO [Int] to
On Fri, Dec 17, 2010 at 9:04 AM, michael rice nowg...@yahoo.com wrote:
I don't understand this error message. Haskell appears not to understand
that 1 is a Num.
Prelude :t 1
1 :: (Num t) = t
Prelude :t [1,2,3,4,5]
[1,2,3,4,5] :: (Num t) = [t]
Prelude
Michael
===
f ::
Write out more types and it'll get more clear.
f is [Int] - IO [Int]
lst is f applied to Num a = [a], so it is of type IO [Int]
fmap is applied to lst, which means it's stepping inside the IO. That
means it's applying +1 to [1,2,3,4,5], which doesn't make much sense unless
you have a Num
On 17 December 2010 18:04, michael rice nowg...@yahoo.com wrote:
===
f :: [Int] - IO [Int]
f lst = do return lst
main = do let lst = f [1,2,3,4,5]
fmap (+1) lst
The problem is that you are applying fmap to a type IO a.
fmap (+1) (return [1,2,3])
But to achieve
On 17 Dec 2010, at 21:44, Christopher Done wrote:
On 17 December 2010 18:04, michael rice nowg...@yahoo.com wrote:
===
f :: [Int] - IO [Int]
f lst = do return lst
main = do let lst = f [1,2,3,4,5]
fmap (+1) lst
The problem is that you are applying fmap to
stumped by something simple like this, but that's
how one learns.
Thanks again,
Michael
--- On Fri, 12/17/10, Daniel Fischer daniel.is.fisc...@googlemail.com
wrote:
From: Daniel Fischer daniel.is.fisc...@googlemail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging
I don't understand this error message. Haskell appears not to understand that 1
is a Num.
Prelude :t 1
1 :: (Num t) = t
Prelude :t [1,2,3,4,5]
[1,2,3,4,5] :: (Num t) = [t]
Prelude
Michael
===
f :: [Int] - IO [Int]
f lst = do return lst
main = do let lst = f [1,2,3,4,5]
On Fri, Dec 17, 2010 at 09:04:20AM -0800, michael rice wrote:
I don't understand this error message. Haskell appears not to understand that
1 is a Num.
Prelude :t 1
1 :: (Num t) = t
Prelude :t [1,2,3,4,5]
[1,2,3,4,5] :: (Num t) = [t]
Prelude
Michael
===
f ::
On 17 Dec 2010, at 20:04, michael rice wrote:
I don't understand this error message. Haskell appears not to understand that
1 is a Num.
As it clearly states in the error message, it doesn't understand that [Int] is
a Num - and it's not.
No instance for Num something usually indicates that
like this, but that's how
one learns.
Thanks again,
Michael
--- On Fri, 12/17/10, Daniel Fischer daniel.is.fisc...@googlemail.com wrote:
From: Daniel Fischer daniel.is.fisc...@googlemail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: haskell-cafe@haskell.org
...@gmail.com wrote:
From: David Leimbach leim...@gmail.com
Subject: Re: [Haskell-cafe] Why is Haskell flagging this?
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org, Daniel Fischer
daniel.is.fisc...@googlemail.com
Date: Friday, December 17, 2010, 7:45 PM
No problem. Haskell is a different
On Friday 17 December 2010 18:04:20, michael rice wrote:
I don't understand this error message. Haskell appears not to understand
that 1 is a Num.
Prelude :t 1
1 :: (Num t) = t
Prelude :t [1,2,3,4,5]
[1,2,3,4,5] :: (Num t) = [t]
Prelude
Michael
===
f :: [Int] - IO
Is haskell supposed to always infer the most general type (barring
extensions)?
I found a simple case where this is not true:
f _ = undefined
where
_ = y :: Int - Int
y x = undefined
where
_ = f x
Haskell infers the types of 'y' and 'f' as:
f :: Int - a
y :: Int - Int
This
On Apr 6, 2010, at 15:56 , Job Vranish wrote:
Is haskell supposed to always infer the most general type (barring
extensions)?
Look up the monomorphism restriction.
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many
I don't believe that the monomorphism restriction has anything to do with
this. Removing it does not generalize the type.
On Tue, Apr 6, 2010 at 4:46 PM, Brandon S. Allbery KF8NH
allb...@ece.cmu.edu wrote:
On Apr 6, 2010, at 15:56 , Job Vranish wrote:
Is haskell supposed to always infer the
Excerpts from Brandon S. Allbery KF8NH's message of Tue Apr 06 16:46:28 -0400
2010:
On Apr 6, 2010, at 15:56 , Job Vranish wrote:
Is haskell supposed to always infer the most general type (barring
extensions)?
Look up the monomorphism restriction.
Hey Brandon,
I tested the code with
On Tue, Apr 06, 2010 at 03:56:32PM -0400, Job Vranish wrote:
f _ = undefined
where
_ = y :: Int - Int
y x = undefined
where
_ = f x
Because f and y are mutually recursive, their types are inferred together,
so y gets the type Int - Int (as given), which forces f :: Int - a.
So in Haskell 98, would the added constraints result in a type error?
- Job
On Tue, Apr 6, 2010 at 5:12 PM, Ross Paterson r...@soi.city.ac.uk wrote:
On Tue, Apr 06, 2010 at 03:56:32PM -0400, Job Vranish wrote:
f _ = undefined
where
_ = y :: Int - Int
y x = undefined
where
Yes, it has to do with mutually recursive bindings. If you add a type
signature, you break the mutual recursion. Mutually recursive
functions are type-checked together and then generalised. Similarly,
polymorphic recursion cannot be inferred either, but is possible by
adding a type signature.
On Tue, Apr 06, 2010 at 03:56:32PM -0400, Job Vranish wrote:
Why does haskell not infer the most general type for these functions? Is it
a limitation of the algorithm? a limitation of the recursive let binding?
Any insight would be appreciated :)
This is due to when Haskell does
On Tue, Apr 06, 2010 at 05:18:34PM -0400, Job Vranish wrote:
So in Haskell 98, would the added constraints result in a type error?
Yes, because the types of the mutually recursive identifiers would be
inferred together without using the type signatures, and then would
fail to match the declared
Thank you all for your replies. This is all much more clear now :)
- Job
On Tue, Apr 6, 2010 at 7:00 PM, Ross Paterson r...@soi.city.ac.uk wrote:
On Tue, Apr 06, 2010 at 05:18:34PM -0400, Job Vranish wrote:
So in Haskell 98, would the added constraints result in a type error?
Yes, because
I posted a question about it in StackOverflow
(http://stackoverflow.com/questions/2284875/why-is-haskell-used-so-little-in-the-industry)
Haskell gets some beating there. Please Hasellers, join the
discussion and give your opinion there.
--
Regards,
Gabi
http://bugspy.net
On 10/31/07, Paulo J. Matos [EMAIL PROTECTED] wrote:
Hello all,
I, along with some friends, have been looking to Haskell lately. I'm
very happy with Haskell as a language, however, a friend sent me the
link:
http://shootout.alioth.debian.org/gp4/
Careful: it's worse than you think. Many
Hello all,
I, along with some friends, have been looking to Haskell lately. I'm
very happy with Haskell as a language, however, a friend sent me the
link:
http://shootout.alioth.debian.org/gp4/
which enables you compare several language implementations. Haskell
seems to lag behind of Clean.
From
From what I've seen of Clean it seems almost like Haskell. It even
distributes a Haskell-Clean translator so the obvious question is,
why is Haskell slower?
It's also something I've wondered about, and I'm curious about the
answer...
One of the differences between Haskell and Clean is
Paulo J. Matos wrote:
Hello all,
I, along with some friends, have been looking to Haskell lately. I'm
very happy with Haskell as a language, however, a friend sent me the
link:
http://shootout.alioth.debian.org/gp4/
which enables you compare several language implementations. Haskell
seems to
bf3:
Are these benchmarks still up-to-date? When I started learning FP, I had
to choose between Haskell and Clean, so I made a couple of little
programs in both. GHC 6.6.1 with -O was faster in most cases, sometimes
a lot faster... I don't have the source code anymore, but it was based
on
Are these benchmarks still up-to-date? When I started learning FP, I had
to choose between Haskell and Clean, so I made a couple of little
programs in both. GHC 6.6.1 with -O was faster in most cases, sometimes
a lot faster... I don't have the source code anymore, but it was based
on the book
Henning Sato von Rosen wrote:
I am curious as to why Haskell not is homoiconic?
I am interested in the reasons behind that design descision.
I ask using this defintion og homiconicity:
Homiconic means that the primary representation of programs is also a
data structure in a primitive type of
Hi all!
I am curious as to why Haskell not is homoiconic?
I am interested in the reasons behind that design descision.
I ask using this defintion og homiconicity:
Homiconic means that the primary representation of programs is also a
data structure in a primitive type of the language itself --
Albert Lai wrote:
Let's have a fun quiz! Guess the mainstream languages in question:
Spoilers for the quiz
0. What language would allow
4[hello world]
when a normal person would just write
hello world[4]
This is a classic C misfeature.
On Aug 8, 2006, at 5:36 PM, Albert Lai wrote:
Brian Hulley [EMAIL PROTECTED] writes:
Also, the bottom line imho is that Haskell is a difficult language to
understand, and this is compounded by the apparent cleverness of
unreadable code like:
c = (.) . (.)
when a normal person would
robdockins:
On Aug 8, 2006, at 5:36 PM, Albert Lai wrote:
Brian Hulley [EMAIL PROTECTED] writes:
Also, the bottom line imho is that Haskell is a difficult language to
understand, and this is compounded by the apparent cleverness of
unreadable code like:
c = (.) . (.)
when a
Brian Hulley [EMAIL PROTECTED] writes:
Also, the bottom line imho is that Haskell is a difficult language to
understand, and this is compounded by the apparent cleverness of
unreadable code like:
c = (.) . (.)
when a normal person would just write:
c f g a b = f (g a b)
All
Brian Hulley [EMAIL PROTECTED] writes:
I meant even a non-programmer in the sense of even someone who is
not a C hacker to show that the threat of people being able to steal
code from a program is not the only source of problems that GPL could
impose on a commercial application. No
On Sun, Aug 06, 2006 at 10:46:16AM +0100, Chris Kuklewicz wrote:
[...]
The GPL only gets in the way if you put it there by choosing to derive work
from GPL code. Note that most commercial programs do not allow you the
choice of deriving your work from theirs at all. The GPL adds to
There is a false statement that must be corrected, about NDA's.
Matthias Fischmann wrote:
On Sun, Aug 06, 2006 at 10:46:16AM +0100, Chris Kuklewicz wrote:
[...]
The GPL only gets in the way if you put it there by choosing to derive work
from GPL code. Note that most commercial programs do
Matthias Fischmann wrote:
But if GPL is stuck to any part of the code and
manages to infect the rest, the client can make you sign as many NDAs
as there can be. The GPL still entitles you to sell it.
Nonsense. The GPL says, *if* you distribute a binary, *then* you also
have to distribute the
Note that there are many people who will not do work on a BSD project since a
company can just come along and take it. People are free to choose GPL or BSD
for their work and then other people are free to choose whether to derive work
from them.
But this is just the thing, isn't it? The GPL
On Mon, Aug 07, 2006 at 12:57:47PM +0100, Chris Kuklewicz wrote:
To: Matthias Fischmann [EMAIL PROTECTED]
CC: haskell-cafe@haskell.org
From: Chris Kuklewicz [EMAIL PROTECTED]
Date: Mon, 07 Aug 2006 12:57:47 +0100
Subject: Re: [Haskell-cafe] Why Not Haskell? (sidenote on licensing
Matthias Fischmann wrote:
And it's really not as easy to control as you suggest: If you ever
take in a single patch under the GPL,
This kind of thing doesn't happen by accident. Patches don't magically
creep into your code, you have to apply them deliberately and you should
always know whether
Udo,
us:
mf:
AFAIR this happened to SSH.com with the
bigint code in ssh-v1.3
SSH included GMP, which was licensed under the GPL. Nothing happened
there, only the OpenSSH folks disliked the license and reimplemented
GMP.
... and had to fight an ugly battle over the question whether
On 06/08/06, Brian Hulley [EMAIL PROTECTED] wrote:
Afaict a license such as GPL allows anyone, even a non-programmer, to just
re-distribute whatever application you created because one condition of it
is that anyone should be free to share software with anyone else without
having to pay anything
Brian Hulley wrote:
Henning Thielemann wrote:
On Fri, 4 Aug 2006, Brian Hulley wrote:
4) Haskell is open source and licensing restrictions forbid
commercial applications. I haven't seen any such restrictions, but
is this a problem for the standard modules?
The reason you have no seen any
On 06/08/06, Brian Hulley [EMAIL PROTECTED] wrote:
Therefore I think this distinction between concepts is just sophistry.
The distinction is there and relies on the community and people being
honest to avoid situations as you described. If you don't want it
however (well in this case relying
Piotr Kalinowski wrote:
On 06/08/06, Brian Hulley [EMAIL PROTECTED] wrote:
Therefore I think this distinction between concepts is just
sophistry.
The distinction is there and relies on the community and people being
honest to avoid situations as you described. If you don't want it
however
On 07/08/06, Brian Hulley [EMAIL PROTECTED] wrote:
So now Ned, who's a very conscientious person, is faced with an impossiblemoral dilemma, ie a choice between helping Nick establish his business orlosing Homer (who's a bit slow when it comes to matters of conscience) as a
friend.A good friend
On Aug 4, 2006, at 11:10 PM, Bulat Ziganshin wrote:
Friday, August 4, 2006, 8:17:42 PM, you wrote:
1) Haskell is too slow for practical use, but the benchmarks I found
appear to contradict this.
it's an advertisement :D just check yourself
2) Input and output are not good enough, in
Hello Kaveh,
Saturday, August 5, 2006, 10:16:06 AM, you wrote:
1 - monads : there must be something to make a clear tool for a
none-mathematician programmer. (I still have understanding problems
with them).
http://haskell.org/haskellwiki/IO_inside and All about monads
2 - there must be an
Hello Bjorn,
Saturday, August 5, 2006, 6:59:33 PM, you wrote:
yes, thank you
2) Input and output are not good enough, in particular for graphical
user interfacing and/or data base interaction. But it seems there are
several user interfaces and SQL and other data base interfaces for
Haskell,
Henning Thielemann wrote:
On Fri, 4 Aug 2006, Brian Hulley wrote:
4) Haskell is open source and licensing restrictions forbid
commercial applications. I haven't seen any such restrictions, but
is this a problem for the standard modules?
You can discover the licensing situation by downloading
Hello All,
I'm wondering why I can't find any commercial Haskell applications on
the Internet. Is there any reason for this?
I can think of the following possibilities only:
1) Haskell is too slow for practical use, but the benchmarks I found
appear to contradict this.
2) Input and output are not
On Fri, 4 Aug 2006, Hans van Thiel wrote:
...
Are there other reasons why there seem to be just a few thousand
(hundred?) Haskell programmers in the world, compared to the 3 million
Java programmers and x million C/C++ programmers?
I can think of several other possible reasons -
6.
Hans van Thiel wrote:
Hello All,
I'm wondering why I can't find any commercial Haskell applications on
the Internet. Is there any reason for this?
I can think of the following possibilities only:
1) Haskell is too slow for practical use, but the benchmarks I found
appear to contradict this.
2)
Hans van Thiel wrote:
I'm wondering why I can't find any commercial Haskell applications on
the Internet. Is there any reason for this?
Of course. Corporations are conservative to the point of being
boneheaded. So to avoid risk, they all went on the internet and said,
Gee, I can't find any
Hans van Thiel wrote:
Hello All,
I'm wondering why I can't find any commercial Haskell applications on
the Internet. Is there any reason for this?
I'm actually working on a Haskell program which I hope to release as a
commercial application. The biggest problem I'm encountering is the lack
On Fri, 4 Aug 2006, Udo Stenzel wrote:
Hans van Thiel wrote:
I'm wondering why I can't find any commercial Haskell applications on
the Internet. Is there any reason for this?
Of course. Corporations are conservative to the point of being
boneheaded. So to avoid risk, they all went on the
On Fri, 4 Aug 2006, Brian Hulley wrote:
4) Haskell is open source and licensing restrictions forbid commercial
applications. I haven't seen any such restrictions, but is this a
problem for the standard modules?
You can discover the licensing situation by downloading the GHC source (or
Hello Hans,
Friday, August 4, 2006, 8:17:42 PM, you wrote:
1) Haskell is too slow for practical use, but the benchmarks I found
appear to contradict this.
it's an advertisement :D just check yourself
2) Input and output are not good enough, in particular for graphical
user interfacing
Hello Jason,
Friday, August 4, 2006, 10:01:31 PM, you wrote:
15. OO is now tried and true in industry. I would say it's far from
optimal but people do know they can build large applications (say
~100k lines of C++).
it's medium size. GHC is larger :)
--
Best regards,
Bulat
G'day all.
Quoting Udo Stenzel [EMAIL PROTECTED]:
Uh, this one's wrong. Does C++ of 15 years ago support today's programs?
C++ of _today_ doesn't support today's programs in some cases. Just
ask the Boost developers about the various workarounds they still have
to deal with.
No. C++ of 10
On Jul 26, 2006, at 6:44 PM, Sebastian Sylvan wrote:
For example ...
if :: Bool - a - a - a
if True t _ = t
if False _ e = e
-- example usage
myAbs x = if (x 0) (negate x) x
I suppose there might also be a case for flipping the arguments about
like this:
if :: a - a - Bool - a
I often find myself at odds with this choice. The reason is that I use
Haskell as a host for embedded languages, and these often come with
their own control flows. So I find myself wanting to write my own
definition of the if-then-else construct that works on terms of some
other type, e.g. tests
I often find myself at odds with this choice. The reason is that I use
Haskell as a host for embedded languages, and these often come with
their own control flows. So I find myself wanting to write my own
definition of the if-then-else construct that works on terms of some
other type, e.g. tests
Niklas Broberg wrote:
I often find myself at odds with this choice. The reason is that I use
Haskell as a host for embedded languages, and these often come with
their own control flows. So I find myself wanting to write my own
definition of the if-then-else construct that works on terms of some
On Wed, 26 Jul 2006, Fritz Ruehr wrote:
On Jul 26, 2006, at 6:44 PM, Sebastian Sylvan wrote:
For example ...
if :: Bool - a - a - a
if True t _ = t
if False _ e = e
-- example usage
myAbs x = if (x 0) (negate x) x
I suppose there might also be a case for flipping the
On 2006-07-27 at 01:33EDT Paul Hudak wrote:
Thanks for asking about this -- it probably should be in the paper. Dan
Doel's answer is closest to the truth:
I imagine the answer is that having the syntax for it looks nicer/is
clearer. if a b c could be more cryptic than if a then b
to put a feature request in Trac?
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Niklas
| Broberg
| Sent: 27 July 2006 09:01
| To: Haskell-cafe
| Subject: Re: [Haskell-cafe] Why does Haskell have the if-then-else
syntax?
|
| I often find myself
On Thu, Jul 27, 2006 at 10:22:31AM +0100, Jon Fairbairn wrote:
On 2006-07-27 at 01:33EDT Paul Hudak wrote:
Thanks for asking about this -- it probably should be in the paper. Dan
Doel's answer is closest to the truth:
I imagine the answer is that having the syntax for it looks
On 2006-07-27 at 13:01+0200 Tomasz Zielonka wrote:
But because if-then-else is an expression, there is another
problem.
That was exactly my point when I made the muttering about
self-bracketing (if ... fi, like everything else, is an
expression in Algol68) all those years ago. I really regret
Jon Fairbairn wrote:
On 2006-07-27 at 13:01+0200 Tomasz Zielonka wrote:
Also, after a few years of Haskell programming, I am still not
sure how to indent if-then-else.
what I was alluding to in my footnote...
I think there's really only one way when it needs to occupy more than one
line:
On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote:
I think there's really only one way when it needs to occupy more than one
line:
if c
then t
else f
Confusingly,
if c
then t
else f
Also works, although no-one really knows why.
--
-David House, [EMAIL
David House wrote:
On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote:
I think there's really only one way when it needs to occupy more
than one line:
if c
then t
else f
Confusingly,
if c
then t
else f
Also works, although no-one really knows why.
Only if
On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote:
I'd be in favour of /if /case /let /\ etc instead of fi esac tel because it
looks more systematic and follows the usual XML conventions for end tags.
I'd suggest that floating point division should just be written `divide` -
it's just a very
Thanks for the answer. (And doubly thanks for giving the answer I
hoped for!)
I propose that ifThenElse and thenElseIf be added to the Prelude for
Haskell'. While these names are a bit long, I think we want both
functions and these names make the behaviors clear (to me, at least).
Comments?
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
___
Haskell-Cafe mailing list
As opposed to what?
Mike
Mike Gunter wrote:
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
On 7/27/06, mvanier [EMAIL PROTECTED] wrote:
As opposed to what?
For example case-of, guards (in combination with let or where), or
just a function:
if :: Bool - a - a - a
if True t _ = t
if False _ e = e
-- example usage
myAbs x = if (x 0) (negate x) x
/S
--
Sebastian Sylvan
Quoth Sebastian Sylvan [EMAIL PROTECTED]:
| On 7/27/06, mvanier [EMAIL PROTECTED] wrote:
| As opposed to what?
|
| For example case-of, guards (in combination with let or where), or
| just a function:
|
| if :: Bool - a - a - a
| if True t _ = t
| if False _ e = e
|
| -- example usage
| myAbs x =
Mike Gunter wrote:
I had hoped the History of Haskell paper would answer a question
I've pondered for some time: why does Haskell have the if-then-else
syntax? The paper doesn't address this. What's the story?
thanks,
-m
Thanks for asking about this -- it probably should be in the paper.
94 matches
Mail list logo