Ditto what everyone else has said. But to clarify what's going on:
The braces are used to introduce a list of "things", such as monadic actions,
data fields, or declarations. For example, consider the following code:
f a =
let {
a_times_2 = a*2;
a_times_4 = a*4;
} in a_times_2+a_
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
What do you mean by "a * 2"? If you don't use this value, don't
calculate it.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.
Hello zaxis,
as others have noted, you are trying to write C in Haskell. Well, that
gains you nothing and rather gets you into trouble. If you want to
write C, then use instead and not Haskell, because the idioms you're
used to in C will not work at all in Haskell. Note for example that the
'do
On Mon, Feb 1, 2010 at 12:08 PM, Jeremy Shaw wrote:
> Attached.
>
Data/Text.hs:175:63:
Module `Data.Data' does not export `mkNoRepType'
Can you send a followup patch that works against GHC 6.10.4, please?
___
Haskell-Cafe mailing list
Haskell-Cafe
On Thu, 2010-01-28 at 14:07 -0500, Steve Schafer wrote:
I'm looking for some algorithmic suggestions:
I have a set of several hundred key/value pairs. The keys are 32-bit
integers, and are all distinct. The values are also integers, but
the
number of values is small (only six in my current pr
zaxis wrote:
> For me i like C style instead of layout. For example,
> func1 a = do
> -- ...
> a * 2
> -- ...
>
> I always write it as:
> func1 a = do {
> -- ...;
>a * 2;
> -- ...;
> }
Honestly, don't do this.
When you're coding in Haskell you should write idiomatic Hask
zaxis writes:
> However, i donot know how to write pure function using C style.
> func1 a = {
> -- ...;
>a * 2;
> -- ...;
> }
You mean imperatively? Short answer: you can't and you shouldn't.
Slightly longer answer: you can possibly fudge something together using
the Identity monad from
For me i like C style instead of layout. For example,
func1 a = do
-- ...
a * 2
-- ...
I always write it as:
func1 a = do {
-- ...;
a * 2;
-- ...;
}
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
will not compil
On Feb 1, 2010, at 9:04 AM, Hans Aberg wrote:
A simple hash-function for strings is to simply exclusive-or the
bytes and then reduce modulo a prime number,
Simply exclusive-oring the bytes will give you at most 256 distinct
results. (For an ASCII source, 128 distinct results.) After that,
t
Last time I tried something like this [on Windows], it didn't seem to
work. I wanted to trap arrow keys and so forth, but they seem to be being
used for input history. (I.e., pressing the up-arrow produces
previously-entered lines of text, and none of this appears to be reaching
the Haskell pro
I would like to generate an arbitrary (large) value to benchmark the
performance of constructing that value with isomorphic types. It seems like
QuickCheck might be useful in this regards. Has anyone done something
similar?
In versions 1.*, there was a generate function:
generate :: Int -> StdGen
Attached.
Thanks!
- jeremy
On Sun, Jan 31, 2010 at 1:34 AM, Bryan O'Sullivan wrote:
> On Tue, Jan 26, 2010 at 10:08 AM, Jeremy Shaw wrote:
>
>>
>> I think so... none of the other instances do.. but I guess that is not a
>> very good excuse :)
>>
>
> Send me a final darcs patch, and I'll apply it
Am Donnerstag, den 28.01.2010, 19:37 + schrieb Maciej Piechotka:
> On Thu, 2010-01-28 at 14:07 -0500, Steve Schafer wrote:
> > I'm looking for some algorithmic suggestions:
> >
> > I have a set of several hundred key/value pairs. The keys are 32-bit
> > integers, and are all distinct. The valu
> And I'm pretty sure that there's no way to convince Agda that F = R,
> or something similar, because, despite the fact that Agda has
> injective type constructors like GHC (R x = R y => x = y), it doesn't
> let you make the inference R Unit = F Unit => R = F. Of course, in
> Agda, one could ar
Malcolm Wallace wrote:
Google has announced that the Summer of Code programme will be running
again this year. If haskell.org people would like to take part again
this year, then we need volunteers:
I'd be happy to mentor again as well. It's important to bear in mind
that the total number of m
2010/2/1 Günther Schmidt :
> Hi all,
>
> I know this sounds daft but I do have good reason to ask.
>
> Is it possible that GHC's core itself has a problem with a particular Umlaut
> only?
>
> HDBC-ODBC won't read in data from an SQLite database as soon as it comes
> accross a *lowercase* U-Umlaut (
2010/01/31 Marc Weber :
> If all you want is standard debian or such it does'nt matter.
> However I tried installing NixOS Linux and I've had lot's of
> trouble until switching to linode. NixOS was up and running
> within 30min then..
How did you get NixOS on your Linode system? They don't seem
Hi all,
I know this sounds daft but I do have good reason to ask.
Is it possible that GHC's core itself has a problem with a particular
Umlaut only?
HDBC-ODBC won't read in data from an SQLite database as soon as it comes
accross a *lowercase* U-Umlaut ("ü") ghci crashes. Other Umlauts ("ä",
I'd be willing to mentor again. I think it's really important that we think
hard about coming up with projects which improve the core Haskell tool chain
this year.
Cheers,
Johan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.or
On 28 Jan 2010, at 10:54, Dušan Kolář wrote:
Could anyone provide a link to some paper/book (electronic version
of both preferred, even if not free) that describes an algorithm of
translation of untyped lambda calculus expression to a set of
combinators? Preferably SKI or BCKW. I'm either
I would happily participate as a mentor again and I am willing to step up as
administrator if you want to get it off your plate.
-Edward Kmett
On Sun, Jan 31, 2010 at 6:04 AM, Malcolm Wallace <
malcolm.wall...@cs.york.ac.uk> wrote:
> Google has announced that the Summer of Code programme will be
I wrote several times that I want determine application directory under
Windows only. Unix version will store its config in predefined location,
in /etc. Anyway, one not subscribed man wrote me about special library
to solve this problem - http://hackage.haskell.org/package/executable-path
On Fri
Dear Dušan,
You can also find an algorithm in everyone's favourite book in
combinatorial logic "To Mock a Mockingbird"
(http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird).
Cheers,
Matthias.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://
It might be worth looking at something like a curses library.
On Mon, Feb 1, 2010 at 4:45 PM, Mark Spezzano
wrote:
> I've tried this example and it just lets me type in anything in CAPITALS,
> which is nice, but Delete key doesn't delete and the arrow keys unfortunately
> let me manoeuvre the c
I use http://www.bytemark.co.uk/ and I'm quite satisfied. They offer
Ubuntu, Debian and CentOS.
Peter
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I've tried this example and it just lets me type in anything in CAPITALS, which
is nice, but Delete key doesn't delete and the arrow keys unfortunately let me
manoeuvre the cursor all over the screen. Also the biggest problem is that
Enter doesn't terminate the input session.
Isn't there a simp
Dear all,
Dušan Kolář fit.vutbr.cz> writes:
> [...]
> Could anyone provide a link to some paper/book (electronic version of
> both preferred, even if not free) that describes an algorithm of
> translation of untyped lambda calculus expression to a set of
> combinators? Preferably SKI or BCKW
In Europe, http://www.ovh.com has quite good prices.
titto
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
28 matches
Mail list logo