Hi
I have a naive question regarding the basic use of the $ operator, and I am
confused why certain times it doesn't seem to work.
e.g.
The following works:
applySkip i f ls = (take i) ls ++ f (drop i ls)
But the following doesn't:
applySkip i f ls = (take i) ls ++ f $ drop i ls
which gives
applySkip i f ls = (take i) ls ++ f (drop i ls)
But the following doesn't:
applySkip i f ls = (take i) ls ++ f $ drop i ls
The issue is with operator precedence. The above is equivalent to:
applySkip i f ls = ((take i) ls ++ f) (drop i ls)
(++) binds more strongly than ($).
On Tue, Jul 19, 2011 at 02:16, Ting Lei tin...@hotmail.com wrote:
I have a naive question regarding the basic use of the $ operator, and I am
confused why certain times it doesn't seem to work.
e.g.
The following works:
applySkip i f ls = (take i) ls ++ f (drop i ls)
But the following
Thanks, Brandon,
That's a very clear explanation. I remembered that it's low, but forgot that
it's this low.
Maybe it's because of my mis-understanding that in C, infix operators have
lower precedence.
Just curious, the following is not allowed in Haskell either for the same
reason.
Just curious, the following is not allowed in Haskell either for the
same reason.
applySkip i f ls = (take i) ls ++ $ f $ drop i ls
This doesn't work for a slightly different reason; you can't use the
infix operators beside each other (++ $), but if you could, it'd work!
On 19 July 2011 06:52, Ting Lei tin...@hotmail.com wrote:
I read somewhere that people a couple of hundreds of years ago can manage to
express things using ($)-like notation without any parenthesis at all.
The only thing that I can think of that matches this is Reverse Polish
Notation, and
Hi Ari,
I won't really try to answer your question, but I'll give you the code for
gzipWithQ written by Alexey Rodriguez Yakushev some years ago for his
comparison on generic programming libraries. The original darcs repo no
longer exists, but here is the file which I think is relevant for you:
On 19/07/2011, at 0:09, Patrick Browne patrick.bro...@dit.ie wrote:
instance Bird Emperor where
-- No fly method
walk x y = y
instance Penguin Emperor where
-- How can I override the walk method in the instance Penguin?
-- walk x y = x
Why would you want to override the walk method
On Mon, 2011-07-18 at 15:29 -0700, Bryan O'Sullivan wrote:
Wonderful! This is absolutely one of those indispensable tools for
build automation and sanity preservation. I use cabal-dev to manage
the builds for all of my Haskell projects, under many different
configurations:
On Tue, Jul 19, 2011 at 10:10 AM, Herbert Valerio Riedel h...@gnu.org wrote:
On Mon, 2011-07-18 at 15:29 -0700, Bryan O'Sullivan wrote:
Wonderful! This is absolutely one of those indispensable tools for
build automation and sanity preservation. I use cabal-dev to manage
the builds for all of
I haven't followed the thread carefully but why does the bird have to be a
penguin?
A bird doesn't have to be a penguin :
*instance* (Penguin b) = Bird b where
fly = -- fly method for penguins
Says that every Penguin is a Bird.
But thinking back about it, there is a problem when trying to
On Tue, 2011-07-19 at 10:33 +0200, Gregory Collins wrote:
Particular tips from our configuration:
* Jenkins is a Java project, and hence gobbles RAM. My VPS couldn't
handle it, so I run it over a VPN tunnel to a machine sitting in my
living room.
* If you set up test-framework to run
On 02.07.2011 01:26, Gwern Branwen wrote:
Another thing you can do along the same lines is generate a script to
download all the repos from packages which declare repos. Some ugly
code:
If 'script' also includes Haskell code, then the 'tar' package could be
of help to walk throught the TAR
On Tue, 2011-07-19 at 10:43 +0200, Yves Parès wrote:
I haven't followed the thread carefully but why does the bird have
to be a penguin?
A bird doesn't have to be a penguin :
instance (Penguin b) = Bird b where
fly = -- fly method for penguins
Says that every Penguin is a Bird.
On Tue, 2011-07-19 at 07:11 +, Ivan Lazar Miljenovic wrote:
On 19 July 2011 06:52, Ting Lei tin...@hotmail.com wrote:
I read somewhere that people a couple of hundreds of years ago can manage to
express things using ($)-like notation without any parenthesis at all.
The only thing
On 19 July 2011 09:51, Maciej Marcin Piechotka uzytkown...@gmail.com wrote:
On Tue, 2011-07-19 at 07:11 +, Ivan Lazar Miljenovic wrote:
The only thing that I can think of that matches this is Reverse Polish
Notation, and according to Wikipedia was about 90 years ago, not
hundreds ;-)
I
Last week, I posted a message to this list looking for people interested
in joining projects using my domain-specific language Ur/Web. Some
responses rightly chastised me for the lack of documentation on the core
Ur language's novel type system features. I'm sure many Haskellers have
had the
I am new to haskell and the haskell fgl (functional graph library). l am
looking for some examples of the haskell fgl. Would appreciate any pointers
regarding the same.
--
Rohit
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I've got a small example here
https://github.com/jkff/minxmod/blob/master/Buchi.hs .
2011/7/19 Rohit Agrawalla rohit.agrawa...@gmail.com:
I am new to haskell and the haskell fgl (functional graph library). l am
looking for some examples of the haskell fgl. Would appreciate any pointers
On Mon, Jul 18, 2011 at 11:52:15PM -0700, Ting Lei wrote:
Thanks, Brandon,
That's a very clear explanation. I remembered that it's low, but forgot that
it's this low.
Maybe it's because of my mis-understanding that in C, infix operators have
lower precedence.
Just curious, the
Hi,
thank you .
I read your souce, I found the depth is only 2, right?
like data A = [A]|String, any easy way to control the maximum_depth
of generated data?
Regards,bob
于 11-7-17 下午8:13, Ivan Lazar Miljenovic 写道:
On 17 July 2011 23:42, bob zhangbobzhang1...@gmail.com wrote:
Hi,
On 19 July 2011 21:23, bob zhang bobzhang1...@gmail.com wrote:
Hi,
thank you .
I read your souce, I found the depth is only 2, right?
like data A = [A]|String, any easy way to control the maximum_depth of
generated data?
You could always use an Int parameter instead of a Bool and have
Polish notation was indeed published in 1920.
However, it relies on knowing the arity of each
symbol. Put another way, it relies on symbols
*having* definite arities. Thus if f has 2
arguments, it has 2, not 1. This does not suit
languages like Haskell at all well. Worse, as
usually
Hi,
Is there any way of getting the following code to immediately return
True without performing the element-by-element comparison? Essentially
this boils down to checking whether pointers are equal before
comparing the contents.
main = print $ f == f
where f = [1..10^9]
Thanks!!
nikhil
On Tue, Jul 19, 2011 at 23:51, Nikhil A. Patil patil.nik...@gmail.comwrote:
Is there any way of getting the following code to immediately return
True without performing the element-by-element comparison? Essentially
this boils down to checking whether pointers are equal before
comparing the
reallyUnsafePointerEq#, and it really is as unsafe as it sounds :)
20.07.2011, в 7:51, Nikhil A. Patil patil.nik...@gmail.com написал(а):
Hi,
Is there any way of getting the following code to immediately return
True without performing the element-by-element comparison? Essentially
this
26 matches
Mail list logo