On Sat, Aug 11, 2007 at 12:06:23AM -0400, David Menendez wrote:
On 8/10/07, Andrew Coppin [EMAIL PROTECTED] wrote:
My program needs to make decisions based on a pair of boolean values.
Encoding both values as a single algebraic data type means I have to
keep taking it apart so I can work
On 8/10/07, Ronald Guida [EMAIL PROTECTED] wrote:
Kim-Ee Yeoh wrote:
Monads are undoubtedly more pervasive, and that could be because there
aren't as many arrow and comonad tutorials, atomic ones or otherwise.
Moreover, Comonad isn't even in the standard libraries (Hoogle returns
no
ronguida:
Monads are undoubtedly more pervasive, and that could be because there
aren't as many arrow and comonad tutorials, atomic ones or otherwise.
Moreover, Comonad isn't even in the standard libraries (Hoogle returns
no results for it).
When I searched for tutorials on monads, I
Is it possible to write a function like this:
zipn n list_1 list_2 list_3 ... list_n
which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable number
of arguments are possible, like printf shows, so a general zipn should be
possible, too. If it is possible, why there are functions
Ronald Guida wrote:
Here's my interpretation of the table:
--
Structure | Subject | Action| Verb | Result
+--+++--
function| a | a-b
Spencer Janssen wrote:
On Friday 10 August 2007 12:37:31 Andrew Coppin wrote:
Stefan O'Rear wrote:
Bool is 32 bits, but Don is using UArray. UArray is not parametric in
the element type.
Would be nice if it *could* somehow be parametric... but I have
absolutely no idea how
Frank,
The return type of zipn would have to depend on the number of
arguments. If you are satisfied with all arguments having the same
type, then you can use transpose:
zipn list1 list2 .. listn = transpose [list1, list2, .. listn]
Can we make a polyvariadic zipn that returns a [HList]? Seems
I was looking for something like this too.
Note that Erlang can do this ;-) but Erlang is probably not so
strongly typed, so it's easier to do?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
i just don't get it.
please, can anybody explaim me how to do that?
i tried it the last few days with ghc-6.7.20070807, ghc-6.7.20070809, and
ghc-6.7.20070810.
it always results in a broken library (without Prelude):
# ghc-pkg list
/usr/local/lib/ghc-6.7.20070810/package.conf:
Hi,
I think this is just a stupid arrow question. Still I cannot find
where my mistake is located.
Suppose I have a simple xml document I want to process with HXT:
root
elem
sub /
risubtext/risub
/elem
/root
After extracting elem I want to duplicate the children trees with
the arrow
Stefan O'Rear wrote:
Good idea! Maybe it could be fit into the GHC Performance Resource
somehow? (http://www.haskell.org/haskellwiki/Performance/GHC)
OK. But it'll probably contain a lot of guessing to start with... ;-)
Wiki pages can be fixed. Private misunderstandings
On Sat, Aug 11, 2007 at 11:50:19AM +0200, Andrea Rossato wrote:
Hi,
I think this is just a stupid arrow question. Still I cannot find
where my mistake is located.
well, it was not an arrow problem but a HXT problem. This new version
of tryMe2 does work as expected:
tryMe2 = runLA arrow []
Brian Hulley schrieb:
apfelmus wrote:
However, most genuinely imperative things are often just a building
block for a higher level functional model. The ByteString library is a
good example: the interface is purely functional, the internals are
explicit memory control. It's a bad idea to let
[Sorry for the long quote, but context is important]
Dan Piponi wrote:
It's fairly standard practice, when documenting functions of a complex
variable, to specify precisely which 'branch cuts' are being used.
Here's a quote from the Mathematica documentation describing their Log
function:
Frank Buss schrieb:
Is it possible to write a function like this:
zipn n list_1 list_2 list_3 ... list_n
which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable number
of arguments are possible, like printf shows, so a general zipn should be
possible, too. If it is possible, why
On 8/11/07, Frank Buss [EMAIL PROTECTED] wrote:
Is it possible to write a function like this:
zipn n list_1 list_2 list_3 ... list_n
which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable
number
of arguments are possible, like printf shows, so a general zipn should be
On 8/10/07, Shachaf Ben-Kiki [EMAIL PROTECTED] wrote:
Also consider using:
data Step = Step { ..., scenario :: Scenario, ... }
Just to expand on Shachaf's answer, when defining a data type you can use a
special record syntax to give names to each of the components, like this:
data Monkey
Hugh,
I certainly think it would be wrong to declare that NDP is doomed to
failure... not because you would be making an enemy of SPJ (I'm pretty
sure you wouldn't!) but because it actually aims to solves a less
ambitious problem: the problem of parallelising the SAME task applied
to different
On 8/11/07, apfelmus [EMAIL PROTECTED] wrote:
Frank Buss schrieb:
Is it possible to write a function like this:
zipn n list_1 list_2 list_3 ... list_n
which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable number
of arguments are possible, like printf shows, so a
You guys might also want to take a look at the Cilk programming language,
and how it managed threads. If you know C, learning Cilk is about 2 hours
of work, as it's C with half a dozen extra keywords and a few new
concepts. I'd love to see Cilk - C + Haskell as a programming language.
The
Brian Hurt wrote:
The key idea of Cilk is that it's easier to deparallelize than it is
to parallelize, especially automatically. So the idea is that the
program is written incredibly parallel, with huge numbers of
microthreads, which are (on average) very cheap to spawn. The runtime
then
On 11/08/07, Brian Hurt [EMAIL PROTECTED] wrote:
You guys might also want to take a look at the Cilk programming language,
and how it managed threads. If you know C, learning Cilk is about 2 hours
of work, as it's C with half a dozen extra keywords and a few new
concepts. I'd love to see
I like to write documentation comments like
fix ::
( a {- ^ local argument -}
- a {- ^ local output -} )
- a {- ^ global output -}
but Haddock doesn't allow it. Or is there a trick to get it work?
___
Haskell-Cafe mailing list
Hello Brian,
Saturday, August 11, 2007, 8:35:49 PM, you wrote:
The key idea of Cilk is that it's easier to deparallelize than it is to
parallelize, especially automatically. So the idea is that the program is
written incredibly parallel, with huge numbers of microthreads, which are
(on
David Menendez wrote:
Be sure to read sigpfe's You could have invented monads! and the
Wadler paper.
http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html
http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf
Most tutorials try to explain what a monad
Frank Buss [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in
gmane.comp.lang.haskell.cafe:
Is it possible to write a function like this:
zipn n list_1 list_2 list_3 ... list_n
which implements zip3 for n=3, zip4 for n=4 etc.? Looks like variable number
of arguments are possible,
Btw. is there any application, where 'quot' and 'rem' are needed? All
occurrences of 'quot' and 'rem' I found in code so far were actually wrong
and should have been 'div' and 'mod'.
http://www.haskell.org/haskellwiki/Things_to_avoid#Forget_about_quot_and_rem
On Sat, Aug 11, 2007 at 03:00:04PM -0400, Ronald Guida wrote:
The question remains: What is special about Monad or ArrowApply,
compared to Arrow? or What is more general about Arrow, compared to
Monad or ArrowApply?
If all you have is an Arrow, then you must make up your mind what you're
going
On Sat, Aug 11, 2007 at 05:27:19PM +0800, Hugh Perkins wrote:
I was looking for something like this too.
Note that Erlang can do this ;-) but Erlang is probably not so
strongly typed, so it's easier to do?
I think the main issue is that Erlang doesn't use currying (IIRC).
Currying makes it
On Sat, 2007-08-11 at 21:10 +0200, Henning Thielemann wrote:
Btw. is there any application, where 'quot' and 'rem' are needed? All
occurrences of 'quot' and 'rem' I found in code so far were actually wrong
and should have been 'div' and 'mod'.
On Sat, Aug 11, 2007 at 11:44:17AM +0200, Marc A. Ziegert wrote:
i just don't get it.
please, can anybody explaim me how to do that?
i tried it the last few days with ghc-6.7.20070807, ghc-6.7.20070809, and
ghc-6.7.20070810.
it always results in a broken library (without Prelude):
#
I've been struggling with writing a parser that needs to parse include files
within source files. So far I cannot get this to work (in reality to get work
done I wrote a kludge that returns a list of include filenames to be run later
in a pure IO function. I realized that this just amounted
Gregory Propf wrote:
I've been struggling with writing a parser that needs to parse include
files within source files. So far I cannot get this to work (in
reality to get work done I wrote a kludge that returns a list of
include filenames to be run later in a pure IO function. I realized
Also, applicative functors can help
GHCi :m +Control.Applicative
GHCi (\x y z - x*(y+z)) $ ZipList [1,2,3]
* ZipList [-1,0,1] * ZipList [1,1,1]
ZipList [0,2,6]
GHCi
http://www.soi.city.ac.uk/~ross/papers/Applicative.pdf
quote The general scheme is as follows:
(page 2)
Marc
Henning Thielemann wrote:
Btw. is there any application, where 'quot' and 'rem' are needed? All
occurrences of 'quot' and 'rem' I found in code so far were actually wrong
and should have been 'div' and 'mod'.
http://www.haskell.org/haskellwiki/Things_to_avoid#Forget_about_quot_and_rem
Yes, my
Isaac Dupree wrote:
I do think that if you almost always want to _use_ div and mod, you
should be able to just define div and mod too (not quot and rem)
that was unclear - I mean you should have that choice, not that it
should be disallowed to define quot and rem only!
Isaac
Same problem here. I downloaded the ghc-6.7.20070811.tar.bz2 snapshot build
on amd64 under ubuntu.
From the README
The sh boot step is only necessary if this is a tree checked out
from darcs. For source distributions downloaded from GHC's web site,
this step has already been performed.
On
On Sat, 11 Aug 2007, Sebastian Sylvan wrote:
How is this any better than using par in Haskell?
Mainly how the threads are actually scheduled. Mind you, I'm an
*incredible* Haskell newbie, so take all of my comments with a 5-pound
salt block, but as I understand how the current
On Sun, Aug 12, 2007 at 12:56:31PM +1000, Alexis Hazell wrote:
On Sunday 12 August 2007 05:24, Stefan O'Rear wrote:
Currying makes it MUCH harder to implement varargs functions.
That's interesting - why is that the case?
varsum 2 3 -- varsum receives 2, and returns a function, which
Hello!
Over the past couple of days I've been working on an IRC bot in the
essence of lambdabot; that is, it should be extendable through plugins
and plugins should be easy to write, modify and contribute. I also
wanted the bot to be small in terms of LOC (as of 0.1, about ~360
including the two
On Fri, Aug 10, 2007 at 03:54:23PM -0700, Greg Meredith wrote:
Haskellians,
A quick follow up. If you look at the code that i have written there is a
great deal of repeated structure. Each of these different kinds of sets and
atoms are isomorphic copies of each other. Because, however, of
Well the docs ( http://legacy.cs.uu.nl/daan/download/parsec/parsec.html ) hint
that setInput and getInput are good for this. I can certainly how they *would*
be - if I knew how to pull in files within the parse. Actually I use those
functions to do multiple recursive passes but of course you
42 matches
Mail list logo