On Wed, 29 Apr 2009, michael rice wrote:
==
import System.Random
rollDice :: IO Int
rollDice = getStdRandom (randomR (1,6))
rollNDice :: Int - [IO Int]
rollNDice 0 = []
rollNDice n = rollDice : rollNDice (n-1)
replicateM n rollDice
Is there anyway when defining a dat type record struct to indicate
default values for some of the fields?
A bit dated, but still ...
http://article.gmane.org/gmane.comp.lang.haskell.general/2078
J.W.
--
View this message in context:
What I need to do is build a type of database. Firstly have a few questions,
whether what I have done it right...and how to do something else.
This is my algebraic type for the database (correct me if its wrong)
data Film = Film String String Int String
with this as the data.
testDatabase
First off, is this homework?
You really ought to start with passing your code to GHCi, or the
compiler, to see whether it's accepted before sending questions to the
mailing list. At least if you are interested in getting constructive
replies.
On Thu, Apr 30, 2009 at 12:33 PM, applebiz89
Do you understand very well a C library and would like
Haskell to have a binding for it? (...)
Could you perhaps then summarise what design rules you're using?
Yes. They are summarised at the main module documentation:
firstly no it isnt homework. I havent run it through the compiler because I
know it won't compile as I havent finished the function as you can see. I
was just asking for guidance on how to understand what to do. So now I know
to put the fan's into a list, which I have done. So then I can just add
import System.Random
rollDice :: IO Int
rollDice = getStdRandom (randomR (1,6))
rollNDice :: Int - [IO Int]
rollNDice 0 = []
rollNDice n = rollDice : rollNDice (n-1)
replicateM n rollDice
http://www.haskell.org/haskellwiki/Avoiding_IO#State_monad
Or, if you want the original idea:
On Thu, 30 Apr 2009, Maurício wrote:
import System.Random
rollDice :: IO Int
rollDice = getStdRandom (randomR (1,6))
rollNDice :: Int - [IO Int]
rollNDice 0 = []
rollNDice n = rollDice : rollNDice (n-1)
replicateM n rollDice
http://www.haskell.org/haskellwiki/Avoiding_IO#State_monad
Hi,
Maurício wrote:
My goal is to have a place where one can find reliable and
comprehensive low-level bindings to foreign libraries, so that
writing higher level bindings becomes an easier task.
Like others, I think you should consider making this place not a single
package, but a bunch of
Hi,
applebiz89 wrote:
data Film = Film String String Int String
with this as the data.
testDatabase :: [Film]
testDatabase = [(Casino Royale, Martin Campbell,2006, Garry, Dave,
Zoe)]
Try to compile this part of the program, to get a feeling for whether
you are on the right track. If it
Maurício briqueabra...@yahoo.com wrote:
bindings-agar
http://permalink.gmane.org/gmane.comp.lang.haskell.cafe/51478
--
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this
Hey thanks, that was really helpful actually. I know it must be annoying for
you, and im sorry but ive done what you said, try and compile it to see if
it does and fix it. I have tried every possible way of using brackets in
different place's etc (as u can tell Im not good with haskell at all)
I'm intermediate-level myself so I hesitate to say something wrong, but I'll go
ahead and point out the obvious.
applebiz89 wrote:
Hey thanks, that was really helpful actually. I know it must be annoying for
you, and im sorry but ive done what you said, try and compile it to see if
it does and
On Thu, Apr 30, 2009 at 4:04 PM, applebiz89 applebi...@hotmail.com wrote:
Hey thanks, that was really helpful actually. I know it must be annoying for
you, and im sorry but ive done what you said, try and compile it to see if
it does and fix it. I have tried every possible way of using
Thanks Ross.
Does anyone know how to tackle this? Combining GHC's builtin arrow processor
and rewrite rules?
On Wed, Apr 29, 2009 at 3:43 PM, Ross Paterson r...@soi.city.ac.uk wrote:
On Wed, Apr 29, 2009 at 03:07:25PM +0200, Peter Verswyvelen wrote:
After doing some pragmatic tests, it seems
Am Mittwoch, 29. April 2009 11:25:31 schrieb Duncan Coutts:
On Mon, 2009-04-27 at 19:03 +0200, Sven Panne wrote:
[...]
As usual, things are always a bit trickier than they appear initially: On
non- Windows systems it is not always sufficient to link against libGL
alone, sometimes you'll
Hello all,
I'm one of the lucky individuals accepted for this year's Summer of
Code. Here's the abstract of my proposal:
http://socghop.appspot.com/student_project/show/google/gsoc2009/haskell/t124022468245
There's less than a month left before I'm supposed to jump into coding,
and I'd love to
On Thu, 2009-04-30 at 19:44 +0200, Sven Panne wrote:
That's why the autoconf macros are so tricky. Re-inventing the wheel in
Haskell is not something I'd like to do. Note: I see autoconf as a necessary
evil, not as a glorious tool. The predefined autoconf macros contain man
years
(if not
My goal is to have a place where one can find reliable and
comprehensive low-level bindings to foreign libraries, so that
writing higher level bindings becomes an easier task.
(...) In your guidelines, you say:
Code should be portable and easy to build.
Does your understanding of
I gather that ...making it possible to use ST code directly
on IORef's. is what we have today?
--
Jason Dusek
|...making it possible to use ST code directly on IORef's.|
http://www.mail-archive.com/glasgow-haskell-b...@haskell.org/msg03568.html
On Thu, Apr 30, 2009 at 11:42 AM, Peter Verswyvelen bugf...@gmail.comwrote:
Thanks Ross.
Does anyone know how to tackle this? Combining GHC's builtin arrow
processor and rewrite rules?
Another possibility is to make an optimizer arrow transformer that encodes
the rules. Eg.
data Optimize a
On Thu, Apr 30, 2009 at 12:44:49PM -0700, Jason Dusek wrote:
I gather that ...making it possible to use ST code directly
on IORef's. is what we have today?
No, we have stToIO :: ST RealWorld a - IO a, but STRef and IORef are
still incompatible types. (I now think that's a good thing,
If you are serious about arrow optimizations, it might be worthwhile to
modify the original preprocessor to output a richer GADT (with cases for
things like ArrSwap) with all the information it knows, so that user code
can experiment with optimizations.
Godspeed on this interesting problem.
The thing is, it doesn't really matter if autoconf macros work fine for
every Unix ever invented. The Windows users simply cannot use packages
with configure scripts. They complain about it a lot. We can call them
foolish for not installing cygwin/mingw, but they will not do it and
instead will
Hello,
http://www.ninebynine.org/Software/swish-0.2.1.html I am trying
to get permission from the author of Swish to move it into Hackage. I will
write cabalize it get up to current Haskell standards. Before I go to this
effort is anybody attempting to do this?
Kind regards, Vasili
http://socghop.appspot.com/student_project/show/google/gsoc2009/haskell/t124022468245
There's less than a month left before I'm supposed to jump into coding,
and I'd love to hear about any little idea you think would make this
project even better! I created a project page with a rough draft of
On Thu, 2009-04-30 at 23:31 +0100, Claus Reinke wrote:
The thing is, it doesn't really matter if autoconf macros work fine for
every Unix ever invented. The Windows users simply cannot use packages
with configure scripts. They complain about it a lot. We can call them
foolish for not
If someone wants to use a unix shell on an unknown platform, they
should at least check that one exists there or -even better- provide
one, not just assume that there'll always be one (and then be surprised
about getting complaints from those windows users). Same for
autoconf, make co.
You
Hi,
Q1: I am trying to create an Alex equivalent of the following flex file:
http://code.haskell.org/yc2js/es-idl/lexer.ll (lexer for Web IDL which
is a dialect of OMG IDL)
I haven't been able to find Alex equivalent for the following line:
PoundSign ^{WhiteSpace}*#
that is any
Hi!
I need this function with requirement of heavy reads, *possibly under DDoS
attack*.
Was trying to write such function, but discovered some serious problems of
** possible racings,
** possible starvations
** unbalance: readAdvChan users may get better service than ones of
tryReadAdvChan
Just a reminder, the Haskell Reddit is live and active:
http://www.reddit.com/r/haskell/
It is a a place for fast, daily, comprehensive news about what's going
on in the Haskell community, combining blogs, mail, irc, ghc's patches,
the freaking types@ mailing list! It's all here, with
31 matches
Mail list logo