Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  firering event in netwire (Nathan H?sken)
   2.  best way to proceed with package install (Michael Litchard)
   3. Re:  best way to proceed with package install (Miguel Negrao)
   4. Re:  firering event in netwire (Ertugrul S?ylemez)
   5. Re:  Prolog (Kim-Ee Yeoh)
   6. Re:  best way to proceed with package install (Chadda? Fouch?)


----------------------------------------------------------------------

Message: 1
Date: Mon, 29 Oct 2012 12:24:51 +0100
From: Nathan H?sken <[email protected]>
Subject: Re: [Haskell-beginners] firering event in netwire
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hey,
I am posting on this old topic because I did not have time in the mean
time to concentrate on this in the past weeks and now I resume.

On 10/01/2012 02:22 PM, Ertugrul S?ylemez wrote:
> Nathan H?sken <[email protected]> wrote:
> 
>>>> But this does not do the accumulation every frame, but whenever an
>>>> event happens.
>>>
>>> That wire by itself does the accumulation at every frame, so you
>>> probably have an inhibiting wire earlier in the chain.
>>
>> Let me restate my problem. My wire is this:
>>
>> pos = accum (+) 0.0 . speed
>>
>> and all I do is putStrLn the output at every frame.
> 
> As a side note, see testWire and testWireM in Control.Wire.Session. =)
> 
> 
>> If withing one frame where speed has the value (1) several events are
>> sent over the wire (for example several keyup and keydown events for
>> an unrelated key), then pos gets incremented for one for each of this
>> events. So I have to prevent the accumulation if the event is not
>> NoEvent.
> 
> That's because you're using constant time deltas.  Even if your time
> frame has a constant rate you should still make use of your time deltas.
> In particular notice that Netwire can deal with time deltas of 0.  Then
> instead of accum you would use integral_.

Yes, ok. But now I want to do something with collision detection and
response. So I am trying the stanard FRP Pong example. For the ball I am
using

ballWire :: PaddleState BallState
ballWire = proc ps -> do
  object_ collDet startState -< (Accelerate (0.0, 0.0), ps)
  where
    collDet paddle ball = doCollisionResponseWithPaddleAndWalls paddle ball

now I do not want the doCollisionResponseWithPaddleAndWalls to be
applied every time an input event is send over the wire but only when
the Update event is fired.
Now I could add the event type (or the time delta) to the "paddle"
argument and test for it

collDet (paddle, eventType) ball = if eventType = Update then
doCollisionResponseWithPaddleAndWalls paddle ball else ball

But this feels like an unnecessary effort ...

Thanks!
nathan



------------------------------

Message: 2
Date: Mon, 29 Oct 2012 16:10:16 -0700
From: Michael Litchard <[email protected]>
Subject: [Haskell-beginners] best way to proceed with package install
To: [email protected]
Message-ID:
        <CAEzeKYrnFUgMyme6rPTbtDTgMSHAmcZCik6u9-O=w5a+7pn...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I am trying to install updated version of yesod-platform, and got this
output from "cabal install yesod-platform". Could someone please
advise on the most efficient way to proceed?

SHA-1.5.1 (new version)
asn1-data-0.7.1 (new version)
base-unicode-symbols-0.2.2.4 (new version)
base64-bytestring-1.0.0.0 (new version)
blaze-markup-0.5.1.1 (new version)
blaze-html-0.5.1.0 (new version)
cipher-aes-0.1.2 (new package)
data-default-0.5.0 (new version)
cookie-0.4.0.1 (new version)
date-cache-0.3.0 (new package)
file-embed-0.0.4.6 (new version)
hashable-1.1.2.5 (new version)
case-insensitive-0.4.0.3 (new version)
hspec-expectations-0.3.0.2 (new package)
hspec-1.3.0.1 (new version)

... many more, snipping ...
my concern was the next part of the message

cabal: The following packages are likely to be broken by the reinstalls:
yesod-platform-1.0.5
tls-extra-0.4.6
http-conduit-1.4.1.10
yesod-auth-1.0.2.1
yesod-1.0.1.6
authenticate-1.2.1.1
certificate-1.2.3
tls-0.9.5
yesod-core-1.0.1.2
yesod-static-1.0.0.3
yesod-persistent-1.0.0.1
yesod-form-1.0.0.4
yesod-json-1.0.0.1
yesod-default-1.0.1.1
skein-0.1.0.7
clientsession-0.7.5
pureMD5-2.1.0.3
wai-app-static-1.2.0.4
pwstore-fast-2.2
cprng-aes-0.2.3
crypto-conduit-0.3.2
yaml-0.7.0.3
persistent-template-0.9.0.2
persistent-sqlite-0.9.0.2
persistent-0.9.0.4
yesod-test-0.2.1
Use --force-reinstalls if you want to install anyway.



------------------------------

Message: 3
Date: Tue, 30 Oct 2012 00:00:25 +0000
From: Miguel Negrao <[email protected]>
Subject: Re: [Haskell-beginners] best way to proceed with package
        install
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1


A 29/10/2012, ?s 23:10, Michael Litchard escreveu:

> I am trying to install updated version of yesod-platform, and got this
> output from "cabal install yesod-platform". Could someone please
> advise on the most efficient way to proceed?

I get this sort of errors all the time and never seem to understand how to fix 
them. Is there some place I can read on how to understand these errors, and 
understand what to do about them, instead of feeling totally at loss and coming 
every time to the list to ask for help ? Also, why can the reinstalls mess up 
things ?

best
Miguel Negr?o


------------------------------

Message: 4
Date: Tue, 30 Oct 2012 04:39:17 +0100
From: Ertugrul S?ylemez <[email protected]>
Subject: Re: [Haskell-beginners] firering event in netwire
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Nathan H?sken <[email protected]> wrote:

> >> If withing one frame where speed has the value (1) several events
> >> are sent over the wire (for example several keyup and keydown
> >> events for an unrelated key), then pos gets incremented for one for
> >> each of this events. So I have to prevent the accumulation if the
> >> event is not NoEvent.
> >
> > That's because you're using constant time deltas.  Even if your time
> > frame has a constant rate you should still make use of your time
> > deltas. In particular notice that Netwire can deal with time deltas
> > of 0.  Then instead of accum you would use integral_.
>
> Yes, ok. But now I want to do something with collision detection and
> response. So I am trying the stanard FRP Pong example. For the ball I
> am using
>
> ballWire :: PaddleState BallState
> ballWire = proc ps -> do
>   object_ collDet startState -< (Accelerate (0.0, 0.0), ps)
>   where
>     collDet paddle ball = doCollisionResponseWithPaddleAndWalls
> paddle ball
>
> now I do not want the doCollisionResponseWithPaddleAndWalls to be
> applied every time an input event is send over the wire but only when
> the Update event is fired.
> Now I could add the event type (or the time delta) to the "paddle"
> argument and test for it
>
> collDet (paddle, eventType) ball = if eventType = Update then
> doCollisionResponseWithPaddleAndWalls paddle ball else ball
>
> But this feels like an unnecessary effort ...

First of all, Netwire 4 is now released on Hackage.  The interface has
changed slightly, so you may want to adapt your code.

Now to your problem:  If you need object_, chances are it's easier to do
using mkGen, but in this simple case I doubt that it's necessary.  Have
a look into the Control.Wire.Trans module tree, where you will find many
convenient switching combinators.  It should be possible to implement
this by using simple integrals and switching.

In the next version there will be more switching combinators to make
applications like yours easier to write.


Greets,
Ertugrul

-- 
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20121030/a3fe5061/attachment-0001.pgp>

------------------------------

Message: 5
Date: Tue, 30 Oct 2012 13:08:20 +0700
From: Kim-Ee Yeoh <[email protected]>
Subject: Re: [Haskell-beginners] Prolog
To: Christopher Howard <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID:
        <CAPY+ZdRd34e8HWMUeuObCBwbZsL=NTVDqaCz0s3cWH7vHEk=h...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

There are multiple senses of the word "declarative". I'd say the
terminology came from trying to figure out the difference
between describing a problem (declarative) and telling the computer exactly
how to solve it (imperative).

You might want to take a look at how Haskell and Prolog approach the
n-queens problem. The haskell solutions I've seen, with prolog as foil, now
take a positively imperative hue!

-- Kim-Ee


On Sun, Oct 28, 2012 at 1:27 PM, Christopher Howard <
[email protected]> wrote:

> Hi. I still have a lot to learn in Haskell (who doesn't?) but I was
> thinking about learning Prolog on the side. I was wondering what you
> thought about the language. I was interested in it primarily because I
> understood it was a purely declarative language and that everything is
> defined in the programs as relations. However, at the Wikipedia page it
> states that Prolog is not actually purely declarative, referencing an
> article which points out that it is necessary to think about Prolog
> programs procedurally because of the way that Prolog resolves queries.
> Is this not as big a deal as it sounds like? Or is there some other
> similar language I should learn instead? (One of the "successors" of
> Prolog?)
>
> I'm fairly open minded, so long as all the tools are FOSS. Though of
> course, a language with better community support, documentation, etc. is
> preferable.
>
> --
> frigidcode.com
> indicium.us
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20121030/bb1d9086/attachment-0001.htm>

------------------------------

Message: 6
Date: Tue, 30 Oct 2012 10:33:45 +0100
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] best way to proceed with package
        install
To: Miguel Negrao <[email protected]>
Cc: [email protected]
Message-ID:
        <CANfjZRaWwDxYWSvq_S=Sp=e_wxgdy+tiv6pk96tocd6aqbd...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Tue, Oct 30, 2012 at 1:00 AM, Miguel Negrao
<[email protected]> wrote:
>
> A 29/10/2012, ?s 23:10, Michael Litchard escreveu:
>
>> I am trying to install updated version of yesod-platform, and got this
>> output from "cabal install yesod-platform". Could someone please
>> advise on the most efficient way to proceed?
>
> I get this sort of errors all the time and never seem to understand how to 
> fix them. Is there some place I can read on how to understand these errors, 
> and understand what to do about them, instead of feeling totally at loss and 
> coming every time to the list to ask for help ? Also, why can the reinstalls 
> mess up things ?
>

There is some good explanations of that phenomenon around under the
name "Butterfly effect" like :
http://cdsmith.wordpress.com/2011/01/17/the-butterfly-effect-in-cabal/

This is really painful when you start to have accumulated a number of
packages, and the more dependencies, the more likely you are to hit
this...
Which is why most people now recommend using sandboxes for
installations, to allows you to have several different packages
database and not have to scratch your whole GHC installation once
you've damaged it (there are always alternative to this radical step,
but it takes more time than restarting from zero so nobody use them).
Basically, as soon as you hit a problem with a cabal installation that
would require a reinstall, you restart from a new sandbox. The
solutions to do that are virthualenv, capri or cabal-dev and the next
release of cabal itself should have a sandbox mode.

The proper solution would be to allow several version of the same
package version to cohabit but that's pretty complicated and not yet
possible.

-- 
Jeda?



------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 52, Issue 33
*****************************************

Reply via email to