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.
applySk
On Tue, Jul 19, 2011 at 02:16, Ting Lei 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 doesn't:
>
> a
> 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 ($).
__
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
Quoth "Richard O'Keefe" ,
[ ... re Werner Kuhn "An Image-Schematic Account of Spatial Categories" ... ]
> class BUILDING building where
>
> class BUILDING house => HOUSE house where
>
> any instance of HOUSE *will* have in its interface everything that
> any instance of BUILDING will.
But .
On 19/07/2011, at 11:09 AM, Patrick Browne wrote:
> data Emperor = Emperor
> data Robin = Robin
>
> class Bird a where
> fly :: a -> a -> a
> walk :: a -> a -> a
>
> instance Bird Robin where
> fly x y = y
> walk x y = x
>
> instance Bird Emperor where
> -- No fly method
> walk x y = y
On 19/07/2011, at 5:09 AM, Patrick Browne wrote:
> On 18/07/2011 13:52, Ketil Malde wrote:
>> I'm not sure the question makes sense, if "fly" is a method of class
>> Bird, then it can't also be a member of class Penguin.
>
> I am actually doing a language comparison and I was checking out a pape
On Tue, 2011-07-19 at 01:13 +0200, Yves Parès wrote:
> Oh, I got it: You want to have:
>
> class Bird b where
>
> class Penguin p where
>
> instance (Penguin b) => Bird b where
>fly = -- fly method for penguins
>
I haven't followed the thread carefully but why does the bird have to be
a pe
On Mon, Jul 18, 2011 at 3:14 PM, Jerzy Karczmarczuk
wrote:
> That's why I suggested how you might do that: for some datatypes, say the
> Emperors, you specify some special flying method (e.g. dummy or bombing), or
> you don't specify it at all. And the Emperors won't fly.
Instead of flying, they'
Oh, I got it: You want to have:
class Bird b where
class Penguin p where
instance (Penguin b) => Bird b where
fly = -- fly method for penguins
2011/7/19 Patrick Browne
> On 18/07/2011 19:14, Jerzy Karczmarczuk wrote:
> > That's why I suggested how you might do that: for some datatypes, say
On 18/07/2011 19:14, Jerzy Karczmarczuk wrote:
> That's why I suggested how you might do that: for some datatypes, say
> the Emperors, you specify some special flying method (e.g. dummy or
> bombing), or you don't specify it at all. And the Emperors won't fly.
-- Here is my attempt
data Emperor =
On Mon, Jul 18, 2011 at 1:10 PM, Rogan Creswick wrote:
> We're happy to announce the release of cabal-dev 0.8! This version is
> available on hackage now, and contains many bug fixes and improvements,
> as outlined in the full release notes below.
>
Wonderful! This is absolutely one of those ind
On Mon, Jul 18, 2011 at 11:45 AM, Albert Y. C. Lai wrote:
> On 11-07-17 12:29 AM, william murphy wrote:
>>
>> : cannot satisfy -package-id
>> network-2.3.0.2-24fdc6b92867c7236e81708f93cae7d0
>
> Look at the output of "ghc -v" and be very horrified.
>
> The problem is not lacking packages or being
We're happy to announce the release of cabal-dev 0.8! This version is
available on hackage now, and contains many bug fixes and improvements,
as outlined in the full release notes below.
--Rogan
cabal-dev release 0.8
==
The 0.8 release of `cabal-d
On 11-07-17 12:29 AM, william murphy wrote:
: cannot satisfy -package-id
network-2.3.0.2-24fdc6b92867c7236e81708f93cae7d0
Look at the output of "ghc -v" and be very horrified.
The problem is not lacking packages or being outdated. The problem is
possessing too many packages and upgrading too
Patrick Browne :
> I was checking out a paper that said: "Type classes allow for partial
inheritance, so that penguins can be birds without flying behavior."
> ... as pointed out by Jerzy my question is silly because can penguins
can fly ...
No, the question is not silly because of that crazy
On 18/07/2011 13:52, Ketil Malde wrote:
> I'm not sure the question makes sense, if "fly" is a method of class
> Bird, then it can't also be a member of class Penguin.
I am actually doing a language comparison and I was checking out a paper
that said:
"Type classes allow for partial inheritance, s
Hello,
I'm trying to use Yesod oAuth plugin to a SNS site which is very similar
to Twitter.
I add oAuth into the authPlugin and I'm able to see the auth URL at login
page.
I click the URL and it forwards me to a page ask me input that SNS site
account.
I fill in my account then the browser
> But now my assignment is a lot tougher than I thought so I'll need some
> guidelines.
I'm pretty sure your course instructor has already given you
the exact guidelines that are required, in her lecture.
There's hundreds of ways to "make a calculator",
and it really depends on what the teache
2011/7/18 Emanuil Boyanov :
> Hi guys, I'm new to Haskell, I learn it for couple of months now and we've
> learned only simple functions like map, zip etc. But now my assignment is a
> lot tougher than I thought so I'll need some guidelines. I've googled my
> assignment and I saw a person with the
Hi guys, I'm new to Haskell, I learn it for couple of months now and we've
learned only simple functions like map, zip etc. But now my assignment is a
lot tougher than I thought so I'll need some guidelines. I've googled my
assignment and I saw a person with the exact assignment so I am gonna copy
I want to implement generic comparison on top of syb-with-class, and
based on looking at syb, it seems I could base it on something like
gzipWithQ from syb's Data.Generics.Twins. However, there's no
Data.Generics.SYB.WithClass.Twins. So I set out to see if I can write
one myself (well, one with jus
Patrick Browne writes:
> Is it possible to model partial inheritance using Haskell type classes?
> For example, if the class Bird has a flying method can we represent
> Penguins as a sub-class of Bird without a flying method?
I'm not sure the question makes sense, if "fly" is a method of class
B
With apologies, I now announce docidx-1.0.1 which fixes a problem kindly
pointed out by Jack Henahan. If you tried to install docidx using "cabal
install" over the weekend and failed, please try again now.
The docidx-1.0.0.tar.gz uploaded to hackage on Friday was missing most of its
source cod
24 matches
Mail list logo