Stephen Tetley stephen.tet...@gmail.com writes:
oddSquareSum :: Integer
oddSquareSum = sum . takeWhile (1) . filter odd . map (^2) $ [1..]
Why filter out the evens after generating them?
In other words:
sum . takeWhile (1) . filter odd . map (^2) $ [1..]
Since odd (x^2) = odd x:
Casey Hawthorne cas...@istar.ca writes:
For example, I have this:
list1 = [a, b, c]
list2 = [d, e, f]
list3 = [g, h, i]
Think in abstract terms what you want to accomplish.
A bit more specifically, let's say the input is a list of lists, and you
want to produce all combinations of drawing
Johannes Waldmann waldm...@imn.htwk-leipzig.de writes:
Well, meaningful identifier names is nice, but I think
here we have a case of the code smell type info embedded in the name.
Strictness of a function should be expressed in the function's type instead.
I've stumbled into this sentiment
Arnoldo Muller arnoldomul...@gmail.com writes:
I am trying to use haskell in the analysis of bio data. One of the main
reasons I wanted to use haskell is because lazy I/O allows you to see a
large bio-sequence as if it was a string in memory.
Funny you should mention it. I've written a
Daniel Fischer daniel.is.fisc...@web.de writes:
3.06GHz Pentium 4, 2 cores.
[I.e. a single-core hyperthreaded CPU]
I have mixed results with parallelism, some programmes get a speed-up of
nearly a factor 2 (wall-clock time), others 1.4, 1.5 or so, yet others take
about the same wall-clock
Hi,
For convenience, I often build binaries with -optl-static, and
distribute them. Except for the slightly annoying necessity of adding
-optl-pthread as well, this works great.
Now I just upgraded my Ubuntu box from 9.10 (Karmic) to 10.4 (Lucid),
and suddently static binaries refuse to work
sorry. My mistake :-). I wanted to send to haskell-cafe, so I just
pick up a mail thread and send reply. But I forgot to change the
title.
Don't do that! Your email contains headers like the following:
In-Reply-To: ccd8be491003232152u60ed0396wc01eecd00c296...@mail.gmail.com
References:
michael rice nowg...@yahoo.com writes:
When I'm learning a new language I like to translate old programs into
the new language as a test of my understanding. However, many of the
old programs are from old programming texts, many written in the time
of punch-cards for batch processing, and
Chris Dornan ch...@chrisdornan.com writes:
I am choosing a Linux distribution for a production Haskell project and
would would normally just go with Debian
I think Debian (I use Ubuntu, which inherits its packages) just got
a lot better. I upgraded to 10.4 Lucid, and now I have ghc 6.12.1 and
Jochem Berndsen joc...@functor.nl writes:
Could you point us to any evidence that supports your assumption that
there are sexual differences in mathematical abilities?
Luce Irigaray? (Amply butcherd by Sokal and Bricmont, or see
e.g. http://www.absoluteastronomy.com/topics/Luce_Irigaray)
Günther Schmidt gue.schm...@web.de writes:
are there any gay haskellers?
Look, Günther, I'll give you credit for trying, but you might as well
accept the fact that using Haskell isn't going to get you laid.
Which is just as well, since this list is for discussing a certain
programming
Hi,
Once upon a time, I proposed a GSoC project for a machine learning
library.
I still get some email from prospective students about this, whom I
discourage as best I can by saying I don't have the time or interest to
pursue it, and that chances aren't so great since you guys tend to
prefer
Don Stewart d...@galois.com writes:
I notice that posts from the Haskell elders are pretty rare now. Only
every now and then we hear from them.
I'm not sure who the 'elders' are, but generally grown-ups with a day
time job (professorships, say) tend to be busy people, without much time
for
Jason Dagit:
The reason I started telling everyone to avoid GHC in apt was the way
it was packaged. [..]
If they are lucky they figure out which apt package to install.
I think people who are too lazy to bother to find out how their
distribution works, should avoid any distribution.
%
Joachim Breitner nome...@debian.org writes:
The profiling data is put in -prof packages, i.e. ghc-prof,
libghc6-network-prof etc. Indeed, there is no easy way to tell the
package system: Whenever I install a Haskell -dev package, please
install the -prof package as well.
One option might to
Pekka Enberg penb...@cs.helsinki.fi writes:
Can you really legally distribute your software under an open source
license if you don't use your real name?
I think it would be hard to enforce any copyright license without
revealing the connection between your pseudonym and real person, but
I
David House dmho...@gmail.com writes:
Let me summarise the main arguments against the restriction:
1. It stops people from contributing [..]
2. Inconsistency [..]
3. Privacy issues [..]
4. It inteferes with people's freedom - who has the right to dictate what
name a person (or, for that
Mads Lindstrøm mads_lindstr...@yahoo.dk writes:
It may seem unfair that I put byte-strings and char-strings in the
same bucket, but libraries do use byte-strings to contain
characters. For example, Parsec has a [Char] and a bytestring
interface.
It bears noting that Data.ByteString and
Daniel Fischer daniel.is.fisc...@web.de writes:
However, I wanted to know what the etc stood for, with taking care of
dependencies and uninstalling already mentioned. Upgrading, yes, but what
else?
Keeping the system consistent with other systems? If I use the system
packages, I can have a
Ivan Miljenovic ivan.miljeno...@gmail.com writes:
Which packages are these? I don't recall seeing any with this kind of
maintainer address...
http://www.google.no/search?q=site%3Ahackage.haskell.org+maintainer+libraries%40haskell.org
-k
--
If I haven't seen further, it is by standing in
Dan Piponi dpip...@gmail.com writes:
I have a situation where I have a bunch of lists and I'll frequently
be making new lists from the old ones by applying map and filter.
(While keeping the old ones around, I presume?)
One option (or source of inspiration) might be lazy bytestrings, which
Duncan Coutts duncan.cou...@googlemail.com writes:
Here are a few things which I would like to see implemented that would
help all this:
* Build reporting in the hackage server
The idea here is that cabal sends back anonymous reports to the
server to say if a package
Joe Fredette jfred...@gmail.com writes:
Consider the set of all rationals with 1 as a numerator, and positive
denominator, eg:
S = {1/n, n : Nat}
this is bounded, enumerable, but infinite.
Isn't making this an instance of Enum something of an abuse?
How would you use enumFromThenTo
Ashley Yakeley ash...@semantic.org writes:
Another practical consideration is that checking a function taking a
simple Int parameter for equality would mean 2^65 function evaluations.
I think function equality would be too much of a black hole to be
worth it.
Oh FFS, _don't do that_.
I
Ashley Yakeley ash...@semantic.org writes:
There's an impedance mismatch between the IEEE notion of equality
(under which -0.0 == 0.0), and the Haskell notion of equality (where
we'd want x == y to imply f x == f y).
Do we also want to modify equality for lazy bytestrings, where equality
is
Don Stewart d...@galois.com writes:
http://shootout.alioth.debian.org/u64q/haskell.php
Observations:
Although we're mostly beaten on speed, and about the same on code size,
we're using a lot less memory than Java.
As for code size, the programs are heavily tuned for speed. Although it
is
Ketil Malde ke...@malde.org writes:
Is it an idea to go back a few steps to more idiomatic code?
I had a whirl at the 'reverse complement' benchmark, where we're in the
Java ballpark for performance and memory, but at twice the code size.
My simple implmentation is down from seventy to about
Felipe Lessa felipe.le...@gmail.com writes:
On Thu, Apr 29, 2010 at 10:54:09AM +0200, Ketil Malde wrote:
Anyway - it occurs to me that this can fairly simply be sped up by
parallelizing: chunk the input, complement chunks in parallel, and
reverse. Any takers?
Do you mean, something like
Henning Thielemann lemm...@henning-thielemann.de writes:
http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#v%3Athrow
I see. This should be forbidden, at all! :-)
Why is this worse than or different from 'error'? To me it looks like
'error', only with a
Gregory Collins g...@gregorycollins.net writes:
Henning Thielemann lemm...@henning-thielemann.de writes:
http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#v%3Athrow
I see. This should be forbidden, at all! :-)
Why is this worse than or different from
Aran Donohue aran.dono...@gmail.com writes:
I have a program that I can reliably cause to hang. It's concurrent using
STM, so I think it could be a deadlock or related issue. I also do some IO,
so I think it could be blocking in a system call.
If it's the latter, 'strace' might help you. Use
b...@telenet.be writes:
Or maybe this would be a nice research topic: how to generate C code
that looks like it’s human written…
Nah, that's too easy: just add a sprinkling of buffer overflows,
undefined behavior, and off-by one index errors.
-k
--
If I haven't seen further, it is by
Michael Snoyman mich...@snoyman.com writes:
* If you're standardizing on UTF-8, why not support bytestrings?
+1
I'm aware that a user could shoot him/herself in the foot by passing
in non-UTF8 data, but I would imagine the performance gains would outweigh
this.
Wrap them in a (new)type?
Antoine Latter aslat...@gmail.com writes:
*Main PortNum
47138
The PortNum constructor should rarely be used directly
So, shouldn't the constructor be hidden, and exported from an .Internal
module?
- it contains the port number in network-order. You should try:
Or perhaps even
Daniel Fischer daniel.is.fisc...@web.de writes:
So why is there a UTF8 implementation for bytestrings? Does that not
duplicate what Text is trying to do? If so, why the duplication?
I think Data.ByteString.UTF8 predates Data.Text.
One difference is that Data.Text uses UTF-16 internally, not
Ozgur Akgun ozgurak...@gmail.com writes:
Then people would need to put spaces between those things, right?
What a horrible consequence!
I like to think that Haskell is a language where aesthetics matter. So,
in my opinion this is indeed a horrible consequence.
I find mixing of symbols and
Pete Chown 1...@234.cx writes:
This code attempts to create an infinite list of random numbers -- a
technique also used by network-dns. It turns out that this code works
with binary-0.4.4 but not with binary-0.5.0.2.
There was a deliberate change in strictness in 0.5 making binary strict,
Alexey Khudyakov alexey.sklad...@gmail.com writes:
This issue was discussed on the list before. Get monad definition
was changed in binary 0.5.0.2. It was made strict and evaluation
of result of runGet is forced. This increased performance but
broke programs which relies on lazyness to work.
Martin Drautzburg martin.drautzb...@web.de writes:
If I have a function, say compute whose last parameter is some value ...
and I create another function, which applies compute to a list of values,
how would I call this function?
If I understand you correctly, and it's not simply map .
braver delivera...@gmail.com writes:
In fact, the tag cafe2, when run on the full dataset, gets stuck at 11
days, with RAM slowly getting into 50 GB
One tip might be to limit available heap memory by using +RTS -M2G (or
whatever your real memory is). If (as seems likely) the RAM usage leads
Edward Kmett ekm...@gmail.com writes:
I realize that this is addressing the symptom, not the cause
I'm not so sure Wikipedia is a good source of information for this.
I've tried to read some of their articles on e.g. type systems or
generic programming, but they tend to be confused by other
Roman Beslik ber...@ukr.net writes:
I do not agree. They are not confused by other languages, they treat
all languages as born equal.
Are you saying this is a good thing?
creating our separate source
of knowledge leads to isolationism and narrow-minded vision.
But also to a consistent,
Roman Beslik ber...@ukr.net writes:
I do not agree. They are not confused by other languages, they treat
all languages as born equal.
Are you saying this is a good thing?
Yes. There is more than Haskell.
Sure. But when I am programming in Haskell, I am generally most
interested in using
Don Stewart d...@galois.com writes:
Some people might be quite excited by Milan's work on significant
performance improvements to the containers package...
Yes, this is great news - both a well written article and an important
piece of work on a cornerstone of the Haskell libraries.
But I am
Albert Y.C.Lai tre...@vex.net writes:
The doc of deleteBy states: The deleteBy function behaves like delete, but
takes a user-supplied equality predicate. A precondition is that the
user-supplied predicate is an equality predicate. (=) is not an equality
predicate, be it in the layperson
Daniel Fischer daniel.is.fisc...@web.de writes:
Maybe it is because deleteBy is defined wrongly? i.e. it is not logical,
doesn't follow the common sense user might expect. It accepts any
predicate but narrows requirements only in docs.
Unfortunately, you can't easily encode the requirement
Max Rabkin max.rab...@gmail.com writes:
Your deleteBy is (filter . not), isn't it?
With the caveat that I haven't actually used it, my impression is that
delete only removes one element, while filter removes all of them.
-k
--
If I haven't seen further, it is by standing in the footprints of
Daniel Fischer daniel.is.fisc...@web.de writes:
An important point of a powerful type system is to model your program so
that only sensible code is legal.
That would be an awesomely powerful type system :)
Heh. But while we're waiting for it, we can try to use what we got to
eliminate as
Patrick Browne patrick.bro...@dit.ie writes:
Why do some cases such as 1) fail to run even if they are the only
instantiation.
I think this is because literal numbers are polymorphic, i.e. a '1' in
your source code is shorthand for 'fromIntegral 1', which is a type of
Num a = a. Thus,
Walt Rorie-Baety black.m...@gmail.com writes:
My work environment is what I'd call typical US corporate - IRC nodes are
blocked, but I can use a web-based client to access it.
I solve these kinds of problems by routing stuff through an SSH
connection to an outside server - which isn't blocked,
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes:
People still use Hugs? :p
Well, I just did a quick count of Haskell libraries in Debian and Ubuntu
(as a sort of comment to Don's blog post), but I forgot Hugs. It seems
to be installed on 6000 Ubuntu-respondents, compared to 17000
wren ng thornton w...@freegeek.org writes:
A bit more seriously: is there any listing anywhere of which extensions
Hugs supports?
Cabal has a partial listing embedded in its code, though I can't seem
to find a textual version at the moment. In general, Hugs has all the
features of GHC 6.6:
d...@patriot.net writes:
d...@hypno:~/haschorus-1.2.1$ ghci
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude :m Haskore
No error
Daniel Fischer daniel.is.fisc...@web.de writes:
First of all: I'm not sure if this question is allowed here. If not, I
apologize
You might want to check out the haskell-beginners list, but IMO most
questions are okay to post here.
Just a couple of style issues Daniel didn't mention:
process
C K Kashyap ckkash...@gmail.com writes:
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's do
notation to invisibly pass around a state. So, does the use of Monadic
style fetch us more than syntactic
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes:
I'd like to request some clarification of some of the questions:
You might want to add a don't know or similar option, so that people
don't have to fill in questions arbitrarily in the case they feel none
of the answers match.
3. I use
Christopher Done chrisd...@googlemail.com writes:
Sadly nobody has the time nor inclination to do proper web development
and actually test designs and get feedback, so I suppose we're working
with the time we've got. At least with theme support, we can write a
load of themes, and then
Don Stewart d...@galois.com writes:
(Looking at http://code.haskell.org/haskell-platform/download-website)
* The three columns at the bottom overlap! Perhaps this is a valid
case for a table rather than three divs and CSS layout.
Agreed and implemented. That was easier!
Scaling is still a
John Goerzen jgoer...@complete.org writes:
I need to read the LGPL and analyze it closer, but my first analysis
suggests that this would work fine for me and others.
I'm using the LGPL for library code, and GPL for applications. Although
a lot of noise is generated from the linking issues,
Vo Minh Thu not...@gmail.com writes:
For a LGPL library, why do you make the distinction between open
source and proprietary applications? They can all link to a LGPL
library.
The problem with the LGPL is that in order to distribute a program
using an LGPL library, the recipient must be
I've rather recently started to use cabal-install to install packages
from Hackage. Unfortunately, so far many packages fail to install. I
try to email authors/maintainers, but when I check build logs on
Hackage, I discover that some of these packages have failed building for
some time.
Robin KAY komad...@gekkou.co.uk writes:
the redirects and ignore the original URLs [2]. Using a 302 Found
redirect instead might produce better results, at least for Google
But the page you point to suggests 302 is discouraged, and says they
don't help for the other search engines. Perhaps
Brandon S Allbery KF8NH allb...@ece.cmu.edu writes:
Usenet *is* NNTP.
In the same way the web is HTTP...
(Usenet is a set of global, distributed forums using a message format
similar enough to email (RFC822 + extensions) that many mail reader
software supports news, and vice versa. NNTP is
bri...@aracnet.com writes:
Seems to be ok rendering to png files.
I'm using timeplot, which is based on Chart, to plot temperatures from
my server in the attic (http://malde.org/~ketil/temp.png if you're
curious :-). This runs from crontab, and I notice that I occasionally
get mails saying
(Reposted to café - my -libraries mail seems to have gotten lost along
the way)
Hi,
I'm building an interface to a C library, which comes in the form of
two .a files. I can't seem to get Cabal to link statically with
these, so that the resulting package (libHSfoo-v.v.a) is self
contained.
Simon Marlow [EMAIL PROTECTED] writes:
What you actually want to do, I suspect, is to include verbatim copies
of the .a dependencies in your (binary) Cabal package, to make it
self-contained.
Exactly.
But it's quite easy: just copy the .a files from /usr/lib (or
wherever) and put them in
Ketil Malde [EMAIL PROTECTED] writes:
But it's quite easy: just copy the .a files from /usr/lib (or
wherever) and put them in the same place as your libHSpackage.a.
I managed to get it to work by following that advice, and also
renaming foo.a to libfoo.a, and linking with -lfoo.
Now you see
Bulat Ziganshin [EMAIL PROTECTED] writes:
I'm not belittling the underlying problem, which is real. But there do
seem to be many possible design choices without an obvious optimium. If
someone can boil out a principled and simple solution, it'd be a good
contribution.
You can also use CPP
Brian Hulley [EMAIL PROTECTED] writes:
But how does this change the fact that y still has 1 more element
than yq? yq is after all, not a circular list.
infinity+1 = infinity
Surely this is just a mathematical convention, not reality! :-)
Not even that. Infinity isn't a number, and it
Simon Marlow [EMAIL PROTECTED] writes:
No idea, I'm afraid. ghc -v might help you. Try cut-and-pasting the
linker command line and play around with ordering of -l options.
I noticed the linker is incredibly picky about the sequence of
options. Anyway, I suspected that, but I couldn't seem
Brian Hulley [EMAIL PROTECTED] writes:
because if the suggested syntax is used, import directives come in two
flavours: ones that use from to import from a different package and
ones that don't use from and therefore must refer to the current
package.
What is the current package? My
Simon Peyton-Jones [EMAIL PROTECTED] writes:
Brian Hulley wrote:
| import A.B.C( T1 ) from foo
| import A.B.C( T2 ) from bar
| type S = A.B.C.T1 - A.B.C.T2
| I'd suggest that the above should give a compiler error that A.B.C is
| ambiguous (as a qualifier), rather than allowing T1
Bulat Ziganshin [EMAIL PROTECTED] writes:
The problem I'm having with SQL right now is that there are a number
of not complete and splintered implementation efforts. Having one
library outside GHCs libraries but still promoted as the default
implementation (and hosted under haskell.org) would
Tamas K Papp [EMAIL PROTECTED] writes:
Most of the mistakes I make are related to indentation,
I use Emacs, which has a reasonably decent mode for this. Hit TAB
repeatedly to show the possible indentations.
precedence (need to remember that function application binds
tightly).
It's not
Daniel Fischer [EMAIL PROTECTED] writes:
Maybe I've misused the word segfault.
I think so. A segfault is the operating-system complaining about an
illegal memory access. If you get them from Haskell, it is likely a
bug in the compiler or run-time system (or you were using unsafeAt, or
FFI).
Carajillu [EMAIL PROTECTED] writes:
I get line 18:parse error (possibly incorrect indentation)
..which is a bit misleading, as the problem is on the preceeding line
of code.
if x == e then return l2
And if x /= e? What is check_elem then?¹
-- Tries to match two lists. If
Andrea Rossato [EMAIL PROTECTED] writes:
I forgot, obviously, that lists are an instance of the Eq class...
so, this is enough:
comp l1 l2 = if l1 == l2 then True else False
Or why not:
comp l1 l2 = l1 == l2
Or simply:
comp = (==)
:-)
-k
--
If I haven't seen further, it is by
Jason Dagit [EMAIL PROTECTED] writes:
Ubuntu seems to be a bit behind then. The current official release of
the 6.4 branch is at 6.4.2. Debian seems to provide this version,
maybe you can use the debian package? But, if I were you I wouldn't
worry so much about upgrading ghc but instead
Ketil Malde [EMAIL PROTECTED] writes:
I filed a request to backport [ghc 6.4.2 to Ubuntu Dapper], but for
some reason, I am unable to find it again.
Hah! Found it (with some IRC assistance):
https://launchpad.net/distros/ubuntu/+source/ghc6/+bug/56516
-k
--
If I haven't seen further
Lyle Kopnicky [EMAIL PROTECTED] writes:
If you have some other metric other than prefix in mind for partial
matches, then things probably get a lot more complicated. You're
probably looking at calculating minimum distances in some
feature-space, which calls for pretty sophisticated
Mikael Johansson [EMAIL PROTECTED] writes:
* It violates the principle of least damage, and it encourages a
failure mode that can be extremely embarrassing -- or worse.
I'd be surprised if private mail leakage happens that much to
Haskell-cafe, or for that matter if it'd be embarrassing to
Udo Stenzel [EMAIL PROTECTED] writes:
However, I don't recall problems with multiple copies of emails.
I did get your mail twice, which I don't consider a huge problem.
And for people who do, perhaps they can set up procmail to deal with
this? E.g.,
Silviu Gheorghe [EMAIL PROTECTED] writes:
slowFunctionCacheList= [slowFunction (i) | i -[0..500]]
and use slowFunctionCacheList !! i instead of slowFunction (i)
i am still curious about a better method (and a general one)
Not much different in principle, but better in practice - you
Robert Dockins [EMAIL PROTECTED] writes:
slowFunctionCacheList= [slowFunction (i) | i -[0..500]]
and use slowFunctionCacheList !! i instead of slowFunction (i)
Not much different in principle, but better in practice - you could
use an array rather than a list. O(1) lookups should make
Clifford Beshers [EMAIL PROTECTED] writes:
There was some excellent advice in the other responses, but I thought
it worth mentioning that your Haskell code converges if you step up
from Float - Float to Double - Double.
Used to be faster, too, IIRC. Is that still the case?
-k
--
If I
Daniel Fischer [EMAIL PROTECTED] writes:
ghci-6.6 [prints the result of IO actions] by default
I consider printing the value when it is used in an assignment a bug.
It makes it more difficult to test laziness issues or behavior on
e.g. large files.
Anybody know why it was changed to the
[EMAIL PROTECTED] (Donald Bruce Stewart) writes:
But we could do with more information on:
[...]
How to make cabal projects into distribution-specific (.deb, .rpm, and
so on) packages?
-k
--
If I haven't seen further, it is by standing in the footprints of giants
Lennart Augustsson [EMAIL PROTECTED] writes:
Should Haskell also provide unrestricted side effects, setjmp/
longjmp, missile launching functions, etc? After all, people who
don't want to use them can just avoid them. :)
Yes.
It is indeed a common problem that programs have unintended
Henning Thielemann wrote:
On Sat, 2 Dec 2006 [EMAIL PROTECTED] wrote:
-- The IO --
Who rides so late through the bits and the bytes?
It's Haskell with his child Hank;
He has the boy type safe in his arm,
He holds him pure, he holds him warm.
I vote for an art/lyrics section on
Paul Hudak wrote:
Maybe some of you can do better, but it's really tough to show someone how an
/advanced/ Haskell programmer would solve /advanced /problems that arise in the
real world. As a simple example, I love this recent quote by Garrett Morris:
I'm personally fond of framing most
Simon Marlow wrote:
+ add a dedicated command cabal, which does nothing more
than runhaskell Setup, but is more memorable and suggestive
cabal-setup does this, but wasn't included with the latest release of
Cabal. It should be in the next one, I hope. The plan is to
deprecate
Fernan Bolando wrote:
what is the simplest way to implement the following code in haskell?
it's just printing the contents of 2D array.
for(i = 0; i imax; i++){
for(n = 0; n nmax; n++){
printf(%i:%i = %f\n, array[i][n]);
}
}
*%* ghci
___ ___ _
* / _ \ /\ /\/ __(_)
jamin1001 wrote:
What if I want to do something like
data Chair = Chair {pos:: Int, color :: Int}
data Table = Table {pos:: Int, color :: Int}
data Properties = Props { pos, color :: Int }
data Chair = Chair Props
data Table = Table Props
or:
data Chair = Chair Int Int
data Table =
Kirsten Chevalier wrote:
On 1/31/07, Bill Wood [EMAIL PROTECTED] wrote:
On Wed, 2007-01-31 at 19:51 +1100, Donald Bruce Stewart wrote:
. . .
foldl (\water dish - wash water dish) soapywater dishes ::
[Dishes]
Nice example. First, note that you can't get close with map -- you need
[EMAIL PROTECTED] wrote:
I would like to create a Haskell function that generates a truth table, for all
Boolean values, say, using the following and function :
and :: Bool - Bool - Bool
and a b = a b
What is the type of the resulting table?
I have tried creating a second function called
[EMAIL PROTECTED] wrote:
Ketil,
thanks for you help.
Here's the code:
and2 :: Bool - Bool - Bool
and2 a b = a b
loop = [ and2 x y | x - [True,False], y - [True,False] ]
Now, how do I have Haskell print
printStrLn(True and True = ) + result of calling and2 True True
printStrLn(True and
Bjorn Lisper wrote:
Erlang actually stands for Ericsson Language. I think the alternative
interpretation is intentional, though.
According to this:
http://www.erlang.org/pipermail/erlang-questions/1999-February/98.html
A.K.E. was the actual origin, but with an intentional ambiguity.
Donald Bruce Stewart wrote:
Following recent discussion about a cross-implementation performance
benchmark suite, based on nofib, I've gone and combined nofib with the
great language shootout programs, and rewritten the build system to
support cross implementation measurements.
Great work!
apfelmus [EMAIL PROTECTED] writes:
I imagine this can only ease the process of learning Haskell, and
broaden the base of possible Haskellers, as more people on using .NET
stuff become familiar with modern typed FP.
There's a reason the STM monad hatched in Haskell: how does the above
STM in
Peter Verswyvelen [EMAIL PROTECTED] writes:
Prelude Data.Char map ord ö
[195,182]
Prelude Data.Char length ö
2
there are actually 2 bytes there, but your terminal is showing them as
one character.
So let's all switch to unicode ASAP and leave that horrible
multi-byte-string-thing behind
101 - 200 of 923 matches
Mail list logo