Dan Piponi wrote:
I suspect that most of the complaints about line noise stem
from this - to beginners Haskell expressions just look like sequences
of identifiers with no apparent grammar to bind them together.
This was the exact complaint that some people voiced, yes. (The (.) and
($)
Mads Lindstrøm wrote:
Andrew Coppin wrote:
Idiomatic Haskell seems to consist *only* of single-letter variable
names.
The more abstract (generic) thing gets, the less likely you will be able
to find a telling name. And if you cannot find a telling name, you can
just as well make it
Don Stewart wrote:
Thanks to those guys who've submitted parallel programs to the language
benchmarks game, we're climbing up the rankings, now in 3rd, and ahead
of C :)
http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=all
Yay! This makes me very happy. ;-)
Hi Gwern,
On Fri, Sep 19, 2008 at 09:01:46PM -0400, Gwern Branwen wrote:
Hi Andrea. So I was looking at the README. Does citeproc-hs only
support adding refs from a .xml file when one's written in Pandoc
markdown? That is, I don't see how I could take a .lhs file and a .bib
file and produce
Andrew Coppin wrote:
[...]
- Variable names such as x and f aren't fabulously helpful to lost
programmers trying to find their way.
I'm not a fan of cryptic variable names, either, and I try to use
descriptive names wherever I can. But in Haskell...
- ... you often have variables, which have
On Wed, 17 Sep 2008, Mitchell, Neil wrote:
I tend to use openFile, hGetContents, hClose - your initial readFile
like call should be openFile/hGetContents, which gives you a lazy
stream, and on a parse error call hClose.
I could use a function like
withReadFile :: FilePath - (Handle - IO a)
Richard A. O'Keefe [EMAIL PROTECTED] writes:
Erlang's equivalent of [m..n] is lists:seq(M, N),
which is currently defined to raise an exception when N M.
In particular, lists:seq(1, N) returns a list of length N
when N 0, but not when N = 0.
I'm currently arguing that lists:seq(1, 0)
Don Stewart ha scritto:
Thanks to those guys who've submitted parallel programs to the language
benchmarks game, we're climbing up the rankings, now in 3rd, and ahead
of C :)
This is cheating, IMHO.
Some test comparisons are unfair.
The first problem is with the thread-ring benchmark.
On 22 Sep 2008, at 11:46, Manlio Perillo wrote:
Don Stewart ha scritto:
Thanks to those guys who've submitted parallel programs to the
language
benchmarks game, we're climbing up the rankings, now in 3rd, and
ahead
of C :)
This is cheating, IMHO.
Some test comparisons are unfair.
The
Andrew Coppin [EMAIL PROTECTED] writes:
Idiomatic Haskell seems to consist *only* of single-letter variable
names.
Good thing, too.
Well, qsort (element : list) would be maximally intuitive, but who's
going to implement it like that? ;-)
Why not listElement : restOfList ?
The rationale
I am cross-posting this message to several lists.
I had learned the trick before the documentation was updated. It seems I have
used a very unreliable trick. And the use castToSTUArray suggested
alternative is a really poor one since I am not using arrays at all.
Who can suggest a way to
On Wed, 17 Sep 2008, Mitchell, Neil wrote:
I tend to use openFile, hGetContents, hClose - your initial readFile
like call should be openFile/hGetContents, which gives you a lazy
stream, and on a parse error call hClose.
I could use a function like
withReadFile :: FilePath - (Handle - IO
Chris Kuklewicz wrote:
Who can suggest a way to cast from Float to Word32 and Double to Word64
using ghc? The actual task is that I need to write out the Float as a
little endian sequence of four bytes and also be able to read it back in.
The writing and reading are done in Put and Get
And, though I had never seen it before, the current winner for speed is ATS (
http://www.ats-lang.org/ ) which is dependently-typed functional language.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello Manlio,
Monday, September 22, 2008, 1:46:55 PM, you wrote:
This is cheating, IMHO.
Some test comparisons are unfair.
this overall test is uselles for speed comparison. afair, there are
only 2-3 programs whose speed isn't heavily depend on libraries. in
DNA test, for example, Tcl (or
Hello Chris,
Monday, September 22, 2008, 2:48:16 PM, you wrote:
used a very unreliable trick. And the use castToSTUArray suggested
alternative is a really poor one since I am not using arrays at all.
castToSTUArray does the same as your code, only in ST monad so you can
skip unsafePerformIO
Am Montag, 22. September 2008 08:32 schrieb Andrew Coppin:
However, I will grant you that Map k v, could have used longer type
variables. But we are not alone with using one letter type variable
names http://java.sun.com/javase/6/docs/api/java/util/HashMap.html . And
frankly, in this
Hi
For no escaping of any characters, or more likely do something like ,
and conversions. See the docs:
http://hackage.haskell.org/packages/archive/tagsoup/0.6/doc/html/Text-HTML-TagSoup-Render.html
Well, I did look at that Haddock page, as well as the others. But honestly,
just a bare
On Sun, Sep 21, 2008 at 10:04 PM, Claus Reinke [EMAIL PROTECTED] wrote:
Once your readers understand
your code, you can add the one-liner and ask for applause
This should make it HWN's quotes of the week !
___
Haskell-Cafe mailing list
That is a good idea!
If I implement head, tail, take drop operations, I can use my KMP
implementation out of the box...
On Sun, Sep 21, 2008 at 11:10, Nicolas Pouillard
[EMAIL PROTECTED] wrote:
Excerpts from Rafael Gustavo da Cunha Pereira Pinto's message of Sat Sep 20
12:54:26 +0200 2008:
jwlato:
On Wed, 17 Sep 2008, Mitchell, Neil wrote:
I tend to use openFile, hGetContents, hClose - your initial readFile
like call should be openFile/hGetContents, which gives you a lazy
stream, and on a parse error call hClose.
I could use a function like
withReadFile :: FilePath
Hi Chris,
you're absolutely right. The mistake was in the where-part of withForm.
The function handleOk' gets an environment d as argument but uses an
extractor that was created without passing d to runFormState. I've put a
corrected version on hpaste [1] and also posted it to the wiki on
On Mon, Sep 22, 2008 at 1:50 PM, Daniel Fischer [EMAIL PROTECTED]wrote:
Am Montag, 22. September 2008 08:32 schrieb Andrew Coppin:
However, I will grant you that Map k v, could have used longer type
variables. But we are not alone with using one letter type variable
names
On Mon, Sep 22, 2008 at 2:07 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
this overall test is uselles for speed comparison. afair, there are
only 2-3 programs whose speed isn't heavily depend on libraries. in
DNA test, for example, Tcl (or PHP?) was leader just because it has
better regexp
Hello Simon,
Monday, September 22, 2008, 9:03:52 PM, you wrote:
With bytestrings, unboxed arrays, light-weight threads and other
tricks, we can usually replace all those ugly low-level programs with
nice high-level haskell ones
i don't think that these 3 libs allows to write high-level
Hello, haskellers!
Suppose we have function (it filters package filenames from apt Packages file):
getPackageList :: FilePath - IO [FilePath]
getPackageList packageFile = withFile packageFile ReadMode $
\h - do c - hGetContents h
--- Simon Brenner [EMAIL PROTECTED] wrote:
On Mon, Sep 22, 2008 at 2:07 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
this overall test is uselles for speed comparison. afair, there are
only 2-3 programs whose speed isn't heavily depend on libraries. in
DNA test, for example, Tcl (or
igouy2:
--- Simon Brenner [EMAIL PROTECTED] wrote:
On Mon, Sep 22, 2008 at 2:07 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
this overall test is uselles for speed comparison. afair, there are
only 2-3 programs whose speed isn't heavily depend on libraries. in
DNA test, for
-- Forwarded message --
From: Rafael Gustavo da Cunha Pereira Pinto [EMAIL PROTECTED]
Date: Mon, Sep 22, 2008 at 15:46
Subject: Re: [Haskell-cafe] hGetContents and lazyness
To: Max Vasin [EMAIL PROTECTED]
Why don't you use OpenFile?
getPackageList packageFile = do
On Sun, Sep 21, 2008 at 1:10 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
I posted a snippet of code which included the phrase
mapM_ (\(n,v) - putStrLn $ [ ++ show n ++ ] = ++ show v) (zip [0..]
vs)
To somebody familiar with Haskell, that is as clear as day. But to a
newbie... well *you*
On Mon, Sep 22, 2008 at 1:12 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
Hello Simon,
Monday, September 22, 2008, 9:03:52 PM, you wrote:
With bytestrings, unboxed arrays, light-weight threads and other
tricks, we can usually replace all those ugly low-level programs with
nice high-level
Hello Graham,
i don't think that these 3 libs allows to write high-level
high-performance code in *most* cases. just for example, try to write wc
without using words.
To a newbie, that's a cryptic statement. Are you saying that these
libs aren't needed to make a high-performance wc, and
Hello Luke,
Monday, September 22, 2008, 11:00:12 PM, you wrote:
mapM_ (\(n,v) - putStrLn $ [ ++ show n ++ ] = ++ show v) (zip [0..]
vs)
forM_ (zip [0..] vs) $ \(n,v) - putStrLn $ [ ++ show n ++ ] = ++
show v
for (zip [0..] vs) $ \(n,v) - do
putStrLn $ [ ++ show n ++ ] = ++ show
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Max Vasin wrote:
Hello, haskellers!
Suppose we have function (it filters package filenames from apt Packages
file):
getPackageList :: FilePath - IO [FilePath]
getPackageList packageFile = withFile packageFile ReadMode $
If i have functions in the IO monad, is there a way to use quickcheck
to test them? I have a bunch of C bindings that unfortunately are not
safe. But i would like to be able to use QuickCheck to test them.
Thanks,
Anatoly
___
Haskell-Cafe mailing list
igouy2:
--- Simon Brenner [EMAIL PROTECTED] wrote:
On Mon, Sep 22, 2008 at 2:07 PM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
this overall test is uselles for speed comparison. afair, there are
only 2-3 programs whose speed isn't heavily depend on libraries. in
DNA test, for
--- Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Graham,
i don't think that these 3 libs allows to write high-level
high-performance code in *most* cases. just for example, try to
write wc
without using words.
To a newbie, that's a cryptic statement. Are you saying that these
Don Stewart ha scritto:
[...]
I've now submitted a Text.Regex.PCRE parallelised entry written by Tim
Newsham. It is by far the fastest haskell regex entry so far (down to 9s
on quad core, from 100+ seconds on single core for the old entry),
Hello Isaac,
Monday, September 22, 2008, 11:49:30 PM, you wrote:
i mean that naive haskell code is very slow and 3 or 5 or twelve libs
can't solve the problem of ghc generating slow code
Is there something particularly fascinating about naive code written in
any language?
yes, in asm
On Tue, 2008-09-23 at 00:20 +0400, Bulat Ziganshin wrote:
Hello Isaac,
Monday, September 22, 2008, 11:49:30 PM, you wrote:
i mean that naive haskell code is very slow and 3 or 5 or twelve libs
can't solve the problem of ghc generating slow code
Is there something particularly
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
I thought I was getting this, but this part is confusing. What
exactly does declaring data Z do?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello Jonathan,
Tuesday, September 23, 2008, 12:30:19 AM, you wrote:
yes, in asm number of instructions executed more or less define
number of CPU cycles used.
well, i more or less know all this stuff. but are you really compare
to Haskell??? does Haskell programs typically written in
Stephan Friedrichs wrote:
Andrew Coppin wrote:
[...]
- Variable names such as x and f aren't fabulously helpful to lost
programmers trying to find their way.
I'm not a fan of cryptic variable names, either, and I try to use
descriptive names wherever I can. But in Haskell...
- ...
Ketil Malde wrote:
The rationale for having long names is that you have too many names,
and too large a scope to keep track of them all in your head. Needing
long names is a symptom that your code is too complex, and that you
should refactor it.
Well, yeah. In Haskell, functions tend to be
Someone could probably give a better explanation but I'll give this a
shot! :)
What you are actually doing is defining a family of types. Every
value in the
type Nat a has it's own type. For instance Z has type Nat Z, (S
Z) or one
has type Nat (S Z), (S (S Z)) has type Nat (S (S Z)) and
On Tue, 2008-09-23 at 00:46 +0400, Bulat Ziganshin wrote:
Hello Jonathan,
Tuesday, September 23, 2008, 12:30:19 AM, you wrote:
yes, in asm number of instructions executed more or less define
number of CPU cycles used.
well, i more or less know all this stuff. but are you
aeyakovenko:
If i have functions in the IO monad, is there a way to use quickcheck
to test them? I have a bunch of C bindings that unfortunately are not
safe. But i would like to be able to use QuickCheck to test them.
Typically, via unsafePerformIO, and check the invariants that need to
On Mon, Sep 22, 2008 at 2:42 PM, Anatoly Yakovenko
[EMAIL PROTECTED] wrote:
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
I thought I was getting this, but this part is confusing. What
exactly does declaring data Z do?
Well, in Haskell without closed type
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Most people seem far more confused by what a fold might be.
A fold by any other name would smell as sweet. ;)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkjYE7kACgkQTkPEVFd3yxh7HwCfVzopoOCgg49YI0Y88g9rjXqI
Hello Bulat,
On Mon, Sep 22, 2008 at 3:09 PM, Bulat Ziganshin
[EMAIL PROTECTED]wrote:
Hello Graham,
i don't think that these 3 libs allows to write high-level
high-performance code in *most* cases. just for example, try to write wc
without using words.
To a newbie, that's a cryptic
Hello Donnie,
Tuesday, September 23, 2008, 2:53:17 AM, you wrote:
i mean that naive haskell code is very slow and 3 or 5 or twelve libs
can't solve the problem of ghc generating slow code
I'm fairly new to Haskell and the Haskell community, but I can say
from my experience of hacking on
ICFP is on now, for those wondering why the list is a bit quiet :)
http://www.icfpconference.org/icfp2008/schedule.html
I'm doing live updates of events at ICFP/Haskell Symposium here in Canada.
http://twitter.com/galoisinc
So you can follow events remotely.
Cheers,
Don
bulat.ziganshin:
Hello Donnie,
Tuesday, September 23, 2008, 2:53:17 AM, you wrote:
i mean that naive haskell code is very slow and 3 or 5 or twelve libs
can't solve the problem of ghc generating slow code
I'm fairly new to Haskell and the Haskell community, but I can say
from my
On 2008.09.22 21:12:06 +0400, Bulat Ziganshin [EMAIL PROTECTED] scribbled
0.5K characters:
Hello Simon,
Monday, September 22, 2008, 9:03:52 PM, you wrote:
With bytestrings, unboxed arrays, light-weight threads and other
tricks, we can usually replace all those ugly low-level programs with
Hello Gwern,
Tuesday, September 23, 2008, 3:33:02 AM, you wrote:
high-performance code in *most* cases. just for example, try to write wc
without using words
http://haskell.org/haskellwiki/Wc seems to do fine; you'll notice
it drops lines after the first version.
actually it counts lines
2008/9/23 Bulat Ziganshin [EMAIL PROTECTED]:
http://haskell.org/haskellwiki/Wc seems to do fine; you'll notice
it drops lines after the first version.
actually it counts lines using built-in function. you may find that
naive C is 6x fatser than naive Haskell and difference is so small
only
bulat.ziganshin:
when gcc developers will start to add to C libraries functions
performing shootout benchmarks we will continue this discussion :D
atoi(3).
-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello Don,
Tuesday, September 23, 2008, 4:22:19 AM, you wrote:
bulat.ziganshin:
when gcc developers will start to add to C libraries functions
performing shootout benchmarks we will continue this discussion :D
atoi(3).
it isn't the same as readInt which was added specifically for this
bulat.ziganshin:
Hello Don,
Tuesday, September 23, 2008, 4:22:19 AM, you wrote:
bulat.ziganshin:
when gcc developers will start to add to C libraries functions
performing shootout benchmarks we will continue this discussion :D
atoi(3).
it isn't the same as readInt which was
2008/9/23 Bulat Ziganshin [EMAIL PROTECTED]:
Hello Don,
Tuesday, September 23, 2008, 4:22:19 AM, you wrote:
bulat.ziganshin:
when gcc developers will start to add to C libraries functions
performing shootout benchmarks we will continue this discussion :D
atoi(3).
it isn't the same as
On Sun, 21 Sep 2008, wren ng thornton wrote:
Even with functionalists ---of the OCaml and SML ilk---
this use of spaces can be confusing if noone explains that function
application binds tighter than all operators.
Bwuh? Ocaml programmers certainly know that application binds tighter
Hello Don,
Tuesday, September 23, 2008, 4:36:55 AM, you wrote:
it isn't the same as readInt which was added specifically for this
test. it doesn't support arbitrary-size streams and doesn't return
rest of stream
Hmm? That is wrong. These functions explicitly work on arbitrarily long
lazy
Hello Chaddaï,
Tuesday, September 23, 2008, 4:39:18 AM, you wrote:
it isn't the same as readInt which was added specifically for this
test. it doesn't support arbitrary-size streams and doesn't return
rest of stream
I think we should write all the entries in Haskell98 and disable any
At the risk of getting sucked into a silly discussion, I'd like to point out
that the c code uses the following really simple and naive function:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/strtol.c?rev=1.42.2.2content-type=text/x-cvsweb-markupcvsroot=glibc
On Mon, Sep 22, 2008 at 6:27 PM, Brian Hurt [EMAIL PROTECTED] wrote:
On Sun, 21 Sep 2008, wren ng thornton wrote:
Even with functionalists ---of the OCaml and SML ilk--- this use of spaces
can be confusing if noone explains that function application binds tighter
than all operators.
Bwuh?
Hello,
I am trying to figure out if there is an existing abstraction I am
missing here.
I have an expression data-type:
data Expr
= Quotient Expr Expr
| Product Expr Expr
| Sum Expr Expr
| Difference Expr Expr
| Lit Double
| Var Char
deriving (Eq, Ord, Data,
I can implement these with some 'sugar' as:
identity (Sum (Lit 0) a)= a
identity (Sum a (Lit 0))= a
identity (Difference a (Lit 0)) = a
identity (Product a (Lit 1))= a
identity (Product (Lit 1) a)= a
identity (Quotient a (Lit 1)) = a
identity a
Oops, never mind. This is just the shallow application you referred to.
Too fast with that send button!
Dan Weston wrote:
I can implement these with some 'sugar' as:
identity (Sum (Lit 0) a)= a
identity (Sum a (Lit 0))= a
identity (Difference a (Lit 0)) = a
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
n00 = Z
n01 = S n00
n02 = S n01
n03 = S n02
n04 = S n03
data MaxList t where
Nil :: MaxList a
Cons :: Nat a - MaxList a - MaxList a
a = Cons n02 $ Cons n02 $ Cons n01 $ Nil
--- :t a gives forall a.
Hi Jeremy,
There are some approaches that support such generic transformations.
The simplest is probably Uniplate by Neil Mitchell:
http://www-users.cs.york.ac.uk/~ndm/uniplate/
The function 'rewrite' is what you are looking for. If you change the
definition of 'identity' to:
On Mon, Sep 22, 2008 at 10:20 PM, Anatoly Yakovenko
[EMAIL PROTECTED] wrote:
Is there a way to define a function that only takes a list with a max
of 1? Because
only1 :: MaxList (S a) - String
only1 _ = only1
will work over
a = Cons n02 $ Cons n02 $ Cons n01 $ Nil
without any problems
type One = S Z
type Two = S One
etc.
why does:
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
type One = S Z
n00 = Z
n01::One = S n00
give me:
test.hs:10:11:
Couldn't match expected type `One'
against inferred type `Nat (S a)'
In the
Oops, meant to send this to the whole list.
You can add -optL -q to your ghc command line to disable that
behavior; blank lines will no longer be required.
-- ryan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Try
n01 :: Nat One
-- ryan
On Mon, Sep 22, 2008 at 8:10 PM, Anatoly Yakovenko
[EMAIL PROTECTED] wrote:
type One = S Z
type Two = S One
etc.
why does:
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
type One = S Z
n00 = Z
n01::One = S n00
give me:
On Mon, Sep 22, 2008 at 11:27 PM, Ryan Ingram [EMAIL PROTECTED] wrote:
Oops, meant to send this to the whole list.
You can add -optL -q to your ghc command line to disable that
behavior; blank lines will no longer be required.
This little gem that Ryan found was exactly what I was looking
Ah yes, I just adjusted the code until it compiled, I must confess I
didn't check whether it actually worked ;). Thanks for the wiki-update!
-chris
On 22 sep 2008, at 09:47, Martin Huschenbett wrote:
Hi Chris,
you're absolutely right. The mistake was in the where-part of
withForm. The
Excerpts from Jeremy Shaw's message of Mon Sep 22 18:46:22 -0700 2008:
Hello,
I am trying to figure out if there is an existing abstraction I am
missing here.
You can try to pick some information in the mocac [1] project, that is for
OCaml.
Moca is a general construction functions
It is not much covered in the docs. It has something to do
with magic triggered by a postfix octothorpe?
--
_jsn
|...docs.|
http://haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html
___
Haskell-Cafe mailing list
On Mon, 2008-09-22 at 21:58 -0700, Jason Dusek wrote:
It is not much covered in the docs. It has something to do
with magic triggered by a postfix octothorpe?
All it does is allow them in identifiers.
___
Haskell-Cafe mailing list
Derek Elkins [EMAIL PROTECTED] wrote:
Jason Dusek wrote:
It is not much covered in the docs. It has something to do
with magic triggered by a postfix octothorpe?
All it does is allow them in identifiers.
That's it? So it's for use in conjunction with primitive
types, I guess (those
On Mon, Sep 22, 2008 at 11:10 PM, Anatoly Yakovenko
[EMAIL PROTECTED] wrote:
type One = S Z
type Two = S One
etc.
why does:
data Nat a where
Z :: Nat a
S :: Nat a - Nat (S a)
data Z
data S a
type One = S Z
n00 = Z
n01::One = S n00
give me:
test.hs:10:11:
Couldn't match
81 matches
Mail list logo