[Haskell-cafe] [ANN] hoodle-0.2

2013-03-29 Thread Ian-Woo Kim
Hi, all,

Pen note-taking program hoodle, which is being developed entirely in
haskell, is updated to version 0.2.
The previous version was 0.1.1.
About what is hoodle, please refer to http://ianwookim.org/hoodle

The changes in this version are
- hoodle data format updated. now hoodle document has a unique id.
- linking between documents implemented
- vertical space inserting tool implemented
- a widget introduced for panning and zooming
- drag and drop linking implemented
- drag and drop image embedding implemented
- poppler pdf support is mandatory
- pdf can be embedded in a file
- toolbox ui reflects current hoodle state more correctly
- slimmer select box design
- several rendering glitches fixed

Note that poppler is mandatory for hoodle (in the previous versions,
poppler support was optional). One needs to install poppler-glib before
installing hoodle.
After gtk2hs and poppler installed, installing hoodle should be simply

> cabal install hoodle

As for the detail information about wacom tablet support, please read
installation page on the webpage.

If you were using the previous versions of hoodle, you will find this
version gives you much smoother experience and many interesting
improvements. (especially adding vertical space tool and pan-zoom widget )

Enjoy~

best,
Ian-Woo Kim
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread 山本和彦
Hi Niklas,

> No, it does not stack overflow, and it seems to perform slightly better
> than the other implementations; it also doesn't suffer from the toList
> slowness problem as does listlike.

Thanks. It's nice.

> However, it is probably not as generally usable as it hardcodes the
> priorities to be Doubles.

I think that you can import the tips of GHC PSQ to original PSQ.

P.S.

If you need test cases, you can find some properties for Heap
(priority queue) here:

https://github.com/kazu-yamamoto/llrbtree/blob/master/test/Heap.hs

You can add some properties relating dilatation to them.

--Kazu

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Idea: Source maps for GHC's -pgmF

2013-03-29 Thread Christopher Done
Here's an idea. For the -pgmF flag, because compile errors become
really obscure and line numbers rendered unhelpful, why don't we use
source maps as recently done for JavaScript in the browser?

Info:

https://wiki.mozilla.org/DevTools/Features/SourceMap

https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit

Here is an example I experimented with the Fay (Haskell→JS compiler):

https://dl.dropbox.com/u/62227452/Screenshots/Screenshot%20from%202012-09-26%2000%3A48%3A01.png

This shows the original source code and a backtrace of an exception
thrown in JavaScript.

We can use Mozilla/Google's format:
http://hackage.haskell.org/package/sourcemap Though it's kind of an
obscure format because it's aimed at being small, but if it's already
been done, why not? Otherwise a simple JSON format is probably
sufficient.

It could be used both in GHC's compilation, pattern match exceptions,
and even in debugger stepping, if desired. Provided with, e.g. -pgmFsm
foo.map. This would make things like the XML mode or other syntactical
extensions feel quite natural and not awkward in GHC's error messages.

What say you, -pgmF users and GHC hackers?

Ciao!

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Announcement - HGamer3D - 0.2.1 - why netwire

2013-03-29 Thread Ertugrul Söylemez
Heinrich Apfelmus  wrote:

> In the case of HGamer3D, the sink combinator would replace the need to
> declare a final "wire which runs all the wires at each step".  It
> feels a bit weird to me to have wires like guiSetPropW that perform
> side effects, i.e. where it makes a different whether you observe
> their results or not. That's a complexity where I feel that something
> "has been swept under the rug".

I did not review the interface of HGamer3D, mostly because it's
Windows-only.  But I'd like to point out that you would prefer a non-IO
monad for wires.  In most cases I would recommend a monad for which (>>)
is commutative like a reader and/or a commutative writer.  The purpose
of the underlying monad is to allow some event wires to be written more
cleanly.  Without the monad:

keyPressed :: (Monad m, Monoid e)
  => SDL.Keysym
  -> Wire e m SDL.Event SDL.Event

With the monad:

keyPressed :: (SDLMonad m, Monoid e)
  => SDL.Keysym
  -> Wire e m a a

In particular imperative wires like guiSetPropW (or anything for which
*set* is a sensible name) are simply wrong.  A widget, e.g. a button,
should look like this:

type MyWire= WireM (Reader MyConfig)
type MyEvent a = MyWire a a

button :: MyEvent Button

This wire takes a button configuration describing the current state of
the button.  Given an IsString Button instance and OverloadedStrings a
GUI with a button could look like this:

numberField =
label >>>
textField "" <|> errorLabel . "Please enter a valid number"

dialog = proc _ -> do
n1 <- numberField -< "Number 1"
n2 <- numberField -< "Number 2"

let s = n1 + n2 :: Integer
label -< "Sum: " ++ show s

button -< "Okay"
id -< s

As most event wires the button wire acts like identity when the button
is pressed, so it would return back the button configuration.  I hope
this sheds some light onto what GUI code in Netwire /should/ (in fact
/will/) look like.


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.


signature.asc
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Niklas Hambüchen wrote:


On 29/03/13 20:14, Henning Thielemann wrote:

Was it on code.haskell.org? Then it might have been moved to a non-web
directory after the last attack 2011.


Does that mean the repo is still there without web access


I assume that.


or gone?


If the original author has not deleted it, then it should still be 
somewhere:


http://www.haskell.org/pipermail/haskell-cafe/2011-February/089352.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Does that mean the repo is still there without web access or gone?

On 29/03/13 20:14, Henning Thielemann wrote:
> Was it on code.haskell.org? Then it might have been moved to a non-web
> directory after the last attack 2011.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Louis Wasserman
I don't remember the answer to either of your questions, I'm afraid --
queuelike was last updated in 2009 (!), and that's really the last time I
looked at it.  That said, I'm not sure I follow how queuelike is a psqueue
at all as opposed to a pqueue?

Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis


On Fri, Mar 29, 2013 at 3:17 PM, Niklas Hambüchen  wrote:

> Hey Louis,
>
> I think that queuelike is still a nice psqueue implementation (and I
> personally don't dislike the api), so may I ask two more questions:
>
> * Do you have any clue why toList is 10 times slower than in the other
> implementation? It is based on extract, and queuelike's extract is very
> fast compared to the others ... that is weird.
>
> * What could I do such that queuelike creation is not measured as
> instant? Using whnf does not seem to be enough.
>
> Thank you
> Niklas
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Louis,

I think that queuelike is still a nice psqueue implementation (and I
personally don't dislike the api), so may I ask two more questions:

* Do you have any clue why toList is 10 times slower than in the other
implementation? It is based on extract, and queuelike's extract is very
fast compared to the others ... that is weird.

* What could I do such that queuelike creation is not measured as
instant? Using whnf does not seem to be enough.

Thank you
Niklas

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Monad.Reader #22 call for copy

2013-03-29 Thread Edward Z. Yang
Call for Copy: The Monad.Reader - Issue 22


Another ICFP submission deadline has come and gone: why not celebrate by
submitting something to The Monad.Reader?  Whether you're an established
academic or have only just started learning Haskell, if you have
something to say, please consider writing an article for The
Monad.Reader!  The submission deadline for Issue 22 will be:

**Saturday, June 1**

The Monad.Reader


The Monad.Reader is a electronic magazine about all things Haskell. It
is less formal than journal, but somehow more enduring than a wiki-
page. There have been a wide variety of articles: exciting code
fragments, intriguing puzzles, book reviews, tutorials, and even
half-baked research ideas.

Submission Details
~~

Get in touch with me if you intend to submit something -- the sooner
you let me know what you're up to, the better.

Please submit articles for the next issue to me by e-mail (ezy...@mit.edu).

Articles should be written according to the guidelines available from

http://themonadreader.wordpress.com/contributing/

Please submit your article in PDF, together with any source files you
used. The sources will be released together with the magazine under a
BSD license.

If you would like to submit an article, but have trouble with LaTeX
please let me know and we'll work something out.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Louis Wasserman wrote:


Bearing in mind that I haven't looked at this in several years...
> Why did you switch from queuelike to pqueue?

Because I liked the API better?

> Could you put the code up somewhere manageable (repo)?

I had it up on darcs, but since that's not there any more, I don't have any 
more source history than you do.


Was it on code.haskell.org? Then it might have been moved to a non-web 
directory after the last attack 2011.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Louis Wasserman
Bearing in mind that I haven't looked at this in several years...

> Why did you switch from queuelike to pqueue?

Because I liked the API better?

> Could you put the code up somewhere manageable (repo)?

I had it up on darcs, but since that's not there any more, I don't have any
more source history than you do.

> Is it possible to make pqueue a full pSqueue implementation?
Not without rewriting the API and data structure...or, equivalently, just
starting from scratch.


Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis


On Thu, Mar 28, 2013 at 10:20 PM, Niklas Hambüchen  wrote:

> (This is a slightly detailed email. If you are the maintainer of one of
> the packages benchmarked here, you might want to read it though.)
>
>
> Today I was looking for a Priority Queue that also allows a delete
> operation (some call this a "Priority Search Queue").
>
> I found
>
> http://stackoverflow.com/questions/6976559/comparison-of-priority-queue-implementations-in-haskell
> and after looking at the 10 queue alternatives, I got to the following
> conclusions:
>
> * Only 3 of them allow to delete entries (are p*s*queues)
> * Most of them are outdated or at least unmaintained for the last 3-5 years
> * There was an effort to get a priority queue into containers (see the
> stackoverflow link), but it was not agreed on
> * Those efforts were driven by Louis Wasserman, who wrote one of the 3
> psqueues (queuelike), but now only maintains a non-ps-queue (pqueue)
> that seems to be the most popular priority queue implementation
>
>
> PSQueue implementations
> ---
>
> The three packages that are psqueues are:
>
> - PSQueue (http://hackage.haskell.org/package/PSQueue-1.1)
>   * original implementation from paper of Ralf Hinze
>   * last upload 2008
>   * no test suite (but small commented out QC properties), no benchmarks
>   * no code repository
>
> - fingertree-psqueue
> (http://hackage.haskell.org/package/fingertree-psqueue-0.3)
>   * last upload 2011
>   * no tests, no benchmarks
>   * no code repository
>
> - queuelike (http://hackage.haskell.org/package/queuelike-1.0.9)
>   * last upload 2009
>   * no tests, no benchmarks
>   * no code repository
>
>
> Benchmarks
> --
>
> Unfortunately, none of them had tests, code in repositories or any
> indication about their real-world performance, so I made some criterion
> benchmarks. You can find them here:
>
> https://github.com/nh2/psqueue-benchmarks
> Graphs:
>
> http://htmlpreview.github.com/?https://raw.github.com/nh2/psqueue-benchmarks/master/report.html
>
>
> Benchmark results
> -
>
> * PSQueue throws a stack space overflow if you try to put in 10 Ints
>
> * PSQueue suffers from some significant worst case in terms of queue
> creation, sometimes creating a queue from random numbers just takes 5
> times longer (1st graph). This only happens sometimes (despite Criterion)
>
> * queuelike creation is instant - it seems to work around my benchmark
> somehow
>
> * converting a queuelike queue to a list surprisingly takes 10 times
> longer than with the other packages
>
> * in terms of average performance, the three are quite close to each
> other (apart from the point above). queuelike seems fastest,
> fingertree-psqueue is second and PSQueue slowest, with a difference of
> +30% to the next one
>
>
> My questions to the maintainers
> ---
>
> @Scott:
> Do you have an idea why PSQueue stack overflows?
>
> @Louis:
> Why did you switch from queuelike to pqueue?
> Could you put the code up somewhere manageable (repo)?
> Is it possible to make pqueue a full pSqueue implementation?
>
> Niklas
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] my knucleotide fast on 64 bit but extremely slow on 32 bit?

2013-03-29 Thread Branimir Maksimovic
Corrected, little bit slower on 64 bit but much faster on 32 bit version.(also 
made hashmap grow from small default size as it is becnh 
req)http://benchmarksgame.alioth.debian.org/u32q/program.php?test=knucleotide&lang=ghc&id=228
 secs for 32 
bit.http://benchmarksgame.alioth.debian.org/u64q/program.php?test=knucleotide&lang=ghc&id=225
 secs for  64 bit

Date: Thu, 28 Mar 2013 20:23:39 +
Subject: Re: [Haskell-cafe] my knucleotide fast on 64 bit but extremely slow on 
32 bit?
From: don...@gmail.com
To: bm...@hotmail.com
CC: haskell-cafe@haskell.org

Int64 is emulated on 32 bit. So it is not as efficient by a long shot.


  
  ___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Kazu,

I added GHC's PSQ to the benchmark, the new figures are on
http://htmlpreview.github.com/?https://raw.github.com/nh2/psqueue-benchmarks/master/report.html

No, it does not stack overflow, and it seems to perform slightly better
than the other implementations; it also doesn't suffer from the toList
slowness problem as does listlike.

However, it is probably not as generally usable as it hardcodes the
priorities to be Doubles.

(So far I only benchmark really trivial things and the other functions
could be benchmarked as well.)

Niklas

On 29/03/13 06:16, Kazu Yamamoto (山本和彦) wrote:
> Hi Niklas,
> 
>> * PSQueue throws a stack space overflow if you try to put in 10
>> * Ints
> 
> A slightly different implementation is used in GHC:
> 
>   https://github.com/ghc/packages-base/blob/master/GHC/Event/PSQ.hs
> 
> Could you test it? If this code also has the same problem, I need to
> fix it.
> 
> --Kazu
> 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Johan Tibell
I had a 5 second look at the PSQueue implementation and here's what I got
so far:

 * fromList should use foldl'.
 * LTree should be spine strict (i.e. strict in the (LTree k p) fields).
 * Winner should be strict in the (LTree k p) field and probably in all
other fields as well.

This is a nice example showing that strict fields is the right default. If
fields need to be lazy there should ideally be a comment explaining why
that is needed (e.g. in the case of finger trees and lists).


On Fri, Mar 29, 2013 at 9:53 AM, Niklas Hambüchen  wrote:

> Hey Scott,
>
> I quickly tried your suggestion, plugging in foldr' from Data.Foldable
> and sprinkling a few seqs in some places, but it doesn't help the stack
> overflow.
>
> On Fri 29 Mar 2013 16:23:55 GMT, Scott Dillard wrote:
> > I do not know why it overflows. It's been a while, but isn't the
> > answer usually "too much laziness"? Maybe try changing the foldr in
> > fromList to foldr'? I would try it out quickly but do not have ghc
> > installed on any computers here.
> >
> > I am happy start a repo for this library, but there is not much
> > history to import so anyone else may do it. I'm not sure how hackage
> > upload permissions work... I guess I just change the maintainer field
> > in the .cabal file from myself to someone else...? Any volunteers?
> >
> >
> >
> >
> > On Thu, Mar 28, 2013 at 11:16 PM, Kazu Yamamoto  > > wrote:
> >
> > Hi Niklas,
> >
> > > * PSQueue throws a stack space overflow if you try to put in 10
> > > * Ints
> >
> > A slightly different implementation is used in GHC:
> >
> >
> > https://github.com/ghc/packages-base/blob/master/GHC/Event/PSQ.hs
> >
> > Could you test it? If this code also has the same problem, I need to
> > fix it.
> >
> > --Kazu
> >
> >
>
> ___
> Haskell mailing list
> hask...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Niklas Hambüchen
Hey Scott,

I quickly tried your suggestion, plugging in foldr' from Data.Foldable 
and sprinkling a few seqs in some places, but it doesn't help the stack 
overflow.

On Fri 29 Mar 2013 16:23:55 GMT, Scott Dillard wrote:
> I do not know why it overflows. It's been a while, but isn't the
> answer usually "too much laziness"? Maybe try changing the foldr in
> fromList to foldr'? I would try it out quickly but do not have ghc
> installed on any computers here.
>
> I am happy start a repo for this library, but there is not much
> history to import so anyone else may do it. I'm not sure how hackage
> upload permissions work... I guess I just change the maintainer field
> in the .cabal file from myself to someone else...? Any volunteers?
>
>
>
>
> On Thu, Mar 28, 2013 at 11:16 PM, Kazu Yamamoto  > wrote:
>
> Hi Niklas,
>
> > * PSQueue throws a stack space overflow if you try to put in 10
> > * Ints
>
> A slightly different implementation is used in GHC:
>
>
> https://github.com/ghc/packages-base/blob/master/GHC/Event/PSQ.hs
>
> Could you test it? If this code also has the same problem, I need to
> fix it.
>
> --Kazu
>
>

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Scott Dillard
I do not know why it overflows. It's been a while, but isn't the answer
usually "too much laziness"? Maybe try changing the foldr in fromList to
foldr'? I would try it out quickly but do not have ghc installed on any
computers here.

I am happy start a repo for this library, but there is not much history to
import so anyone else may do it. I'm not sure how hackage upload
permissions work... I guess I just change the maintainer field in the
.cabal file from myself to someone else...? Any volunteers?




On Thu, Mar 28, 2013 at 11:16 PM, Kazu Yamamoto  wrote:

> Hi Niklas,
>
> > * PSQueue throws a stack space overflow if you try to put in 10
> > * Ints
>
> A slightly different implementation is used in GHC:
>
> https://github.com/ghc/packages-base/blob/master/GHC/Event/PSQ.hs
>
> Could you test it? If this code also has the same problem, I need to
> fix it.
>
> --Kazu
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] cabal install pandoc [solved]

2013-03-29 Thread Roger Mason

Hello,

On 03/29/2013 08:13 AM, Roger Mason wrote:

Hello,

It appears in my case that cabal may be looking in a strange place for 
installed pacckages.  At least, that is how I interpret the output I 
just pasted here:

http://pastebin.ca/2344794

Thanks,
Roger
ghc-pkg check showed that there were problems with 'array'. ghc-pkg 
unregister and a fresh installation of ghc and cabal-install have fixed 
the problem.


Thanks to all who responded.

Roger

This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell SBV Package with Z3

2013-03-29 Thread Levent Erkok
Sorry, there were a couple of typos in the last example. It should read:

  allSat $ \(x::SWord8) -> x `shiftL` 2 ./= x

Note that this will return all 255 values that satisfy this property; i.e.,
everything except 0. (Here, we're using "sat/allSat" as opposed to "prove,"
 and hence the inversion of equality in the property.)

-Levent.


On Fri, Mar 29, 2013 at 6:49 AM, Levent Erkok  wrote:

> You're welcome Jun Jie.
>
> Regarding getting a different counter example: That's perfectly normal.
> When SMT solvers build models they use random seeds. Furthermore, different
> versions of the same solver can use different algorithms/heuristics to
> arrive at the falsifying model. So, it's entirely expected that you get a
> different counter-example. You can turn the question around, and ask the
> solver to give you all counter-examples like this:
>
>  allSat $ \x -> \(x::SWord8) -> x `shiftL` 2 .!= x
>
> -Levent.
>
> On Mar 29, 2013, at 1:42 AM, "J. J. W."  wrote:
>
> Dear Levent,
>
> Thank you for your support. I am very honoured to have the developer of
> the SBV package to solve my elementary problem. I noticed that the
> counter-example given by my Z3 differs from the one said on HackageDB:
> sbv-2.10.
>
> Code that is on Hackage:
>
>  Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .==
> x
>Falsifiable. Counter-example:
>  x = 128 :: SWord8
>
> My current GHCi output:
>
> Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
> Falsifiable. Counter-example:
>   x = 51 :: SWord8
> (0.02 secs, 1196468 bytes)
>
> Thank you for your help!
>
> Yours sincerely,
>
> Jun Jie
>
>
> 2013/3/29 Levent Erkok 
>
>> Hi Jun Jie:
>>
>> SBV uses some of the not-yet-officially-released features in Z3. The
>> version you have, while it's the latest official Z3 release, will not work.
>>
>> To resolve, you need to install the "development" version of Z3
>> (something that is at least 4.3.2 or better). Here're instructions from the
>> Microsoft folks explaining how to get these builds:
>> http://research.microsoft.com/en-us/um/people/leonardo/blog/2013/02/15/precompiled.html
>>
>> Let me know if you find any issues after you get the latest-development
>> version of Z3 installed.
>>
>> -Levent.
>>
>>
>> On Thu, Mar 28, 2013 at 10:22 PM, J. J. W.  wrote:
>>
>>>  Dear all,
>>>
>>> I have a small question regarding the installation of the SBV package. I
>>> first installed the SBV 2.10 package with cabal with the following
>>> instructions:
>>>
>>> cabal install sbv
>>>
>>> Next I installed the Z3 theorem prover and adding the path to my system
>>> variables (Windows 7 x64). Next I tested whether I could find it by opening
>>> cmd.exe and then typing z3, I get an error message of Z3, so I can safely
>>> assume the system can find it. (I added the path to the bin of Z3, I have
>>> not included the include directory, I see no reason why I should add a path
>>> to this directory, but maybe I am wrong).
>>>
>>> I ran the program: SBVUnitTests. However it had some errors in the
>>> beginning and afterwards a few failures. Having no idea how to fix this, I
>>> continued to check whether I can get the SBV to work. So I started to
>>> execute the SBV package:
>>>
>>> ghci -XScopedTypeVariables
>>> ghci> :m Data.SBV
>>> ghci> prove $ \(x::SWord8) -> x `shiftL` 2 .== 4*x
>>>
>>> Now this should return Q.E.D., however it returned the following:
>>>
>>> An error occured.
>>> Failed to complete the call to z3
>>> Executable: "C:\\Program Files\\z3-4.3.0-x64\\bin\\z3.exe
>>> Options: /in /smt2
>>> Exit code: 0
>>> Solver output:
>>> ===
>>> ; :smt.mbqi
>>> ; :pp.decimal_precision
>>> ===
>>>
>>> Giving up..
>>>
>>> It does seems like that the Z3 has a normal output, however not a
>>> result. Can someone help me to figure out what I actually did wrong?
>>>
>>> I am using Z3 version 4.3.0, SBV 2.10 and GHCi 7.4.2
>>>
>>> Thank you for your help!
>>>
>>> Yours sincerely,
>>>
>>> Jun Jie
>>>
>>>
>>> ___
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell SBV Package with Z3

2013-03-29 Thread Levent Erkok
You're welcome Jun Jie. 

Regarding getting a different counter example: That's perfectly normal. When 
SMT solvers build models they use random seeds. Furthermore, different versions 
of the same solver can use different algorithms/heuristics to arrive at the 
falsifying model. So, it's entirely expected that you get a different 
counter-example. You can turn the question around, and ask the solver to give 
you all counter-examples like this:

 allSat $ \x -> \(x::SWord8) -> x `shiftL` 2 .!= x

-Levent. 

On Mar 29, 2013, at 1:42 AM, "J. J. W."  wrote:

> Dear Levent,
> 
> Thank you for your support. I am very honoured to have the developer of the 
> SBV package to solve my elementary problem. I noticed that the 
> counter-example given by my Z3 differs from the one said on HackageDB: 
> sbv-2.10.
> 
> Code that is on Hackage:
> 
>  Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
>Falsifiable. Counter-example:
>  x = 128 :: SWord8
> 
> My current GHCi output:
> 
> Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
> Falsifiable. Counter-example:
>   x = 51 :: SWord8
> (0.02 secs, 1196468 bytes)
> 
> Thank you for your help!
> 
> Yours sincerely,
> 
> Jun Jie
> 
> 
> 2013/3/29 Levent Erkok 
>> Hi Jun Jie:
>> 
>> SBV uses some of the not-yet-officially-released features in Z3. The version 
>> you have, while it's the latest official Z3 release, will not work.
>> 
>> To resolve, you need to install the "development" version of Z3 (something 
>> that is at least 4.3.2 or better). Here're instructions from the Microsoft 
>> folks explaining how to get these builds: 
>> http://research.microsoft.com/en-us/um/people/leonardo/blog/2013/02/15/precompiled.html
>> 
>> Let me know if you find any issues after you get the latest-development 
>> version of Z3 installed.
>> 
>> -Levent.  
>> 
>> 
>> On Thu, Mar 28, 2013 at 10:22 PM, J. J. W.  wrote:
>>> Dear all,
>>> 
>>> I have a small question regarding the installation of the SBV package. I 
>>> first installed the SBV 2.10 package with cabal with the following 
>>> instructions:
>>> 
>>> cabal install sbv
>>> 
>>> Next I installed the Z3 theorem prover and adding the path to my system 
>>> variables (Windows 7 x64). Next I tested whether I could find it by opening 
>>> cmd.exe and then typing z3, I get an error message of Z3, so I can safely 
>>> assume the system can find it. (I added the path to the bin of Z3, I have 
>>> not included the include directory, I see no reason why I should add a path 
>>> to this directory, but maybe I am wrong).
>>> 
>>> I ran the program: SBVUnitTests. However it had some errors in the 
>>> beginning and afterwards a few failures. Having no idea how to fix this, I 
>>> continued to check whether I can get the SBV to work. So I started to 
>>> execute the SBV package:
>>> 
>>> ghci -XScopedTypeVariables
>>> ghci> :m Data.SBV
>>> ghci> prove $ \(x::SWord8) -> x `shiftL` 2 .== 4*x
>>> 
>>> Now this should return Q.E.D., however it returned the following:
>>> 
>>> An error occured.
>>> Failed to complete the call to z3
>>> Executable: "C:\\Program Files\\z3-4.3.0-x64\\bin\\z3.exe
>>> Options: /in /smt2
>>> Exit code: 0
>>> Solver output:
>>> ===
>>> ; :smt.mbqi
>>> ; :pp.decimal_precision
>>> ===
>>> 
>>> Giving up..
>>> 
>>> It does seems like that the Z3 has a normal output, however not a result. 
>>> Can someone help me to figure out what I actually did wrong?
>>> 
>>> I am using Z3 version 4.3.0, SBV 2.10 and GHCi 7.4.2
>>> 
>>> Thank you for your help!
>>> 
>>> Yours sincerely,
>>> 
>>> Jun Jie
>>> 
>>> 
>>> ___
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] cabal install pandoc

2013-03-29 Thread Roger Mason

Hello,

On 03/29/2013 06:47 AM, Henk-Jan van Tuyl wrote:

On Thu, 28 Mar 2013 19:08:46 +0100, Roger Mason  wrote:

I installed ghc (7.6.2) on an Arch Linux machine.  I'm trying to 
install pandoc via cabal but it fails:


...
Configuring text-0.11.2.3...
Warning: This package indirectly depends on multiple versions of the 
same

package. This is highly likely to cause a compile failure.
package deepseq-1.3.0.1 requires array-0.4.0.1
package text-0.11.2.3 requires array-0.4.0.1
Building text-0.11.2.3...
Preprocessing library text-0.11.2.3...
: cannot satisfy -package-id 
array-0.4.0.1-db49bb8b0087ae85b5875d4c0cc12874

 (use -v for more information)
Failed to install text-0.11.2.3
...


I had something similar with Ubuntu (before there was a binary package 
available for this platform); I installed several packages, that gave 
such message, again. That solved it.


Regards,
Henk-Jan van Tuyl

It appears in my case that cabal may be looking in a strange place for 
installed pacckages.  At least, that is how I interpret the output I 
just pasted here:

http://pastebin.ca/2344794

Thanks,
Roger



This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] cabal install pandoc

2013-03-29 Thread Roger Mason

Thank you for your response.  'ghc-pkg check' shows some problems:

http://pastebin.ca/2344794

On 03/28/2013 08:01 PM, Patrick Wheeler wrote:
So I printed off the requirements for pandoc on a empty ghc-7.6.2 
install you can find it at:

http://hpaste.org/84794

I do not see any odd package versions listed in what you posted so far.

No promise I will be able to help afterwards but it might help to see 
the full log, and then again with verbosity turned on. So seperate 
pastes for:


* `cabal install pandoc --dry-run`
* `cabal install pandoc --dry-run --verbose=2`
* `cabal install pandoc --dry-run --verbose=3`

You might also want to run a `ghc-pkg check` to check to see if your 
packages are consistent/unbroken.




'ghc-pkg check' shows some problems:

http://pastebin.ca/2344794

Thanks for any help you can offer.

Roger

This electronic communication is governed by the terms and conditions at
http://www.mun.ca/cc/policies/electronic_communications_disclaimer_2012.php

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Announcement - HGamer3D - 0.2.1 - why netwire

2013-03-29 Thread Heinrich Apfelmus

Peter Althainz wrote:

Hi Heinrich:

Its simply the types are more cumbersome, now. In netwire you basically 
have one type, which is "Wire " with some type parameters 
(underlying monad, inhibition type, in-type, out-type), When underlying 
monad and inhibition type is choosen, you can define a type synonym and 
all boils done to "GameWire a b" in all types, events (GameWire a a), 
behaviours (GameWire a b), what you want. Signal inhibition makes Events 
and Behviours looks equal. Also the overall network has this type. And 
by the way, no generalized datatypes (forall t. ), which I'm also 
not too comfortable with.


In reactive banana we have considerably more types then in netwire:

- One tpye for Behaviours

- One type for Events

- sinks in addition: sinkoutput[text:==showNumber<$>result]- what is 
that? (I know it has something to do with feedback loops)


- scary type for the network description: "forallt.Frameworkst=>Momentt()"


Thanks Peter!

The distinction between Behavior and Event is something fundamental that 
I don't want to give up easily. They behave differently under products 
and coproducts, they correspond to modalities in temporal logic and they 
are also very useful for recursion.


Concerning the  sink  combinator, it's actually part of the GUI bindings 
and not of the core library. It's used to bind, say the text value of an 
edit widget to display the value of a  Behavior String .


Likewise, the  forall t. Frameworks t => Moment t ()  type signature is 
used when binding to a GUI framework. The explicit  forall  is only used 
to be get the right name for the type  t , usually you would just write 
 Frameworks t => Moment t () .


Overall, I like to think that the complexity is only superficial. I 
agree that the type parameter t is somewhat annoying, but it's necessary 
for fundamental reasons. Fortunately, it has a nice conceptual 
interpretation as "starting time".



In the case of  HGamer3D, the  sink  combinator would replace the need 
to declare a final "wire which runs all the wires at each step". It 
feels a bit weird to me to have wires like  guiSetPropW  that perform 
side effects, i.e. where it makes a different whether you observe their 
results or not. That's a complexity where I feel that something "has 
been swept under the rug".



Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] cabal install pandoc

2013-03-29 Thread Henk-Jan van Tuyl

On Thu, 28 Mar 2013 19:08:46 +0100, Roger Mason  wrote:

I installed ghc (7.6.2) on an Arch Linux machine.  I'm trying to install  
pandoc via cabal but it fails:


...
Configuring text-0.11.2.3...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package deepseq-1.3.0.1 requires array-0.4.0.1
package text-0.11.2.3 requires array-0.4.0.1
Building text-0.11.2.3...
Preprocessing library text-0.11.2.3...
: cannot satisfy -package-id  
array-0.4.0.1-db49bb8b0087ae85b5875d4c0cc12874

 (use -v for more information)
Failed to install text-0.11.2.3
...


I had something similar with Ubuntu (before there was a binary package  
available for this platform); I installed several packages, that gave such  
message, again. That solved it.


Regards,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] introducing Maybe at managing level

2013-03-29 Thread David Virebayre
The link to LYAH that John provided,
http://learnyouahaskell.com/making-our-own-types-and-typeclasses ,
doesn't mention monad at all.

Laziness is mentionned only once while explaining recursive types, but
you could omit that line.

Now Algebraic is mentionned 6 times, but if you're afraid it might
scare someone, why not replace it by 'Haskell' ( thus, Algebraic data
type becomes Haskell data type, for the purpose of your introduction )


2013/3/29 Luc TAESCH :
> Thanks John.
>
> I was indeed thinking to Maybe and the monad bindings,
> and  LYAH, or http://book.realworldhaskell.org/read/error-handling.html
>
> the problems is I cannot uses these links in isolation ( to a Non
> haskellers) because they mention Monads, Lazyness, Algebric types, all this
> vocabularies that side track a beginner, ( or a manager ;-)
>
> then all I want to show is the generic concept ( powerpoint level)
> of how a forest of (non core) case can be streamlined in one major case (
> the good outcome) , and all the rest ( exceptions in a non technical sense)
> are catched by the maybe monad, without sidetracking the readability of the
> code .
>
> I saw this somewhere on the blogosphere, but cannot remember where..
>
> this is management level, and this is even worse than beginners techies,
> because they derails very quickly when talking "details"
>
>
> --
> Luc
> be.linkedin.com/in/luctaesch/
> Envoyé avec Sparrow
>
> Le vendredi 29 mars 2013 à 06:47, John Lato a écrit :
>
> In FP, I think this sort of problem is generally handled via algebraic data
> types rather than exceptions.  In particular this directly addresses the
> issue of "exceptions don't necessarily shout themselves out", since the
> compiler warns you if you've missed a case.
>
> They sound mathy, but algebraic data types are actually a pretty simple
> concept.  I think the "Learn You a Haskell" explanation is decent:
> http://learnyouahaskell.com/making-our-own-types-and-typeclasses
>
> Provided I understand the context properly, actually using exceptions for
> this sort of issue would be extremely rare practice.
>
>
> On Fri, Mar 29, 2013 at 12:21 AM, luc taesch  wrote:
>
> I was looking for some link introducing the way FP/ Haskell handles errors
> and Exceptions.
>
> This is for a non FP Guy, and ideally withought scaring them with Monads and
> category theory :-).
>
> for the background :
>
> the guy said : As I mentioned in another thread in banking (in particular)
> it is the exception processing that often dominates the functionality of a
> system - as the core concept is generally very straightforward. Developing
> for "exception handling" (not in a Java/C++ sense) is a tricky thing - as
> the exception don't necessarily shout themselves out - and are often why we
> have large misunderstood legacy systems which are hard to replace.
>
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] introducing Maybe at managing level

2013-03-29 Thread Luc TAESCH
Thanks John.

I was indeed thinking to Maybe and the monad bindings,  
and  LYAH, or http://book.realworldhaskell.org/read/error-handling.html

the problems is I cannot uses these links in isolation ( to a Non haskellers) 
because they mention Monads, Lazyness, Algebric types, all this vocabularies 
that side track a beginner, ( or a manager ;-)

then all I want to show is the generic concept ( powerpoint level)  
of how a forest of (non core) case can be streamlined in one major case ( the 
good outcome) , and all the rest ( exceptions in a non technical sense) are 
catched by the maybe monad, without sidetracking the readability of the code .

I saw this somewhere on the blogosphere, but cannot remember where..

this is management level, and this is even worse than beginners techies, 
because they derails very quickly when talking "details"


--
Luc
be.linkedin.com/in/luctaesch/ (http://be.linkedin.com/in/luctaesch/)
Envoyé avec Sparrow (http://www.sparrowmailapp.com/?sig)


Le vendredi 29 mars 2013 à 06:47, John Lato a écrit :

> In FP, I think this sort of problem is generally handled via algebraic data 
> types rather than exceptions.  In particular this directly addresses the 
> issue of "exceptions don't necessarily shout themselves out", since the 
> compiler warns you if you've missed a case.
>  
> They sound mathy, but algebraic data types are actually a pretty simple 
> concept.  I think the "Learn You a Haskell" explanation is decent: 
> http://learnyouahaskell.com/making-our-own-types-and-typeclasses  
>  
> Provided I understand the context properly, actually using exceptions for 
> this sort of issue would be extremely rare practice.
>  
>  
> On Fri, Mar 29, 2013 at 12:21 AM, luc taesch  (mailto:luc.tae...@gmail.com)> wrote:
> > I was looking for some link introducing the way FP/ Haskell handles errors 
> > and Exceptions.
> >  
> > This is for a non FP Guy, and ideally withought scaring them with Monads 
> > and category theory :-).
> >  
> > for the background :
> >  
> > the guy said : As I mentioned in another thread in banking (in particular) 
> > it is the exception processing that often dominates the functionality of a 
> > system - as the core concept is generally very straightforward. Developing 
> > for "exception handling" (not in a Java/C++ sense) is a tricky thing - as 
> > the exception don't necessarily shout themselves out - and are often why we 
> > have large misunderstood legacy systems which are hard to replace.
> >  
> >  
> >  
> > ___
> > Haskell-Cafe mailing list
> > Haskell-Cafe@haskell.org (mailto:Haskell-Cafe@haskell.org)
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>  

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell SBV Package with Z3

2013-03-29 Thread J. J. W.
Dear Levent,

Thank you for your support. I am very honoured to have the developer of the
SBV package to solve my elementary problem. I noticed that the
counter-example given by my Z3 differs from the one said on HackageDB:
sbv-2.10.

Code that is on Hackage:

 Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
   Falsifiable. Counter-example:
 x = 128 :: SWord8

My current GHCi output:

Prelude Data.SBV> prove $ forAll ["x"] $ \(x::SWord8) -> x `shiftL` 2 .== x
Falsifiable. Counter-example:
  x = 51 :: SWord8
(0.02 secs, 1196468 bytes)

Thank you for your help!

Yours sincerely,

Jun Jie


2013/3/29 Levent Erkok 

> Hi Jun Jie:
>
> SBV uses some of the not-yet-officially-released features in Z3. The
> version you have, while it's the latest official Z3 release, will not work.
>
> To resolve, you need to install the "development" version of Z3 (something
> that is at least 4.3.2 or better). Here're instructions from the Microsoft
> folks explaining how to get these builds:
> http://research.microsoft.com/en-us/um/people/leonardo/blog/2013/02/15/precompiled.html
>
> Let me know if you find any issues after you get the latest-development
> version of Z3 installed.
>
> -Levent.
>
>
> On Thu, Mar 28, 2013 at 10:22 PM, J. J. W.  wrote:
>
>> Dear all,
>>
>> I have a small question regarding the installation of the SBV package. I
>> first installed the SBV 2.10 package with cabal with the following
>> instructions:
>>
>> cabal install sbv
>>
>> Next I installed the Z3 theorem prover and adding the path to my system
>> variables (Windows 7 x64). Next I tested whether I could find it by opening
>> cmd.exe and then typing z3, I get an error message of Z3, so I can safely
>> assume the system can find it. (I added the path to the bin of Z3, I have
>> not included the include directory, I see no reason why I should add a path
>> to this directory, but maybe I am wrong).
>>
>> I ran the program: SBVUnitTests. However it had some errors in the
>> beginning and afterwards a few failures. Having no idea how to fix this, I
>> continued to check whether I can get the SBV to work. So I started to
>> execute the SBV package:
>>
>> ghci -XScopedTypeVariables
>> ghci> :m Data.SBV
>> ghci> prove $ \(x::SWord8) -> x `shiftL` 2 .== 4*x
>>
>> Now this should return Q.E.D., however it returned the following:
>>
>> An error occured.
>> Failed to complete the call to z3
>> Executable: "C:\\Program Files\\z3-4.3.0-x64\\bin\\z3.exe
>> Options: /in /smt2
>> Exit code: 0
>> Solver output:
>> ===
>> ; :smt.mbqi
>> ; :pp.decimal_precision
>> ===
>>
>> Giving up..
>>
>> It does seems like that the Z3 has a normal output, however not a result.
>> Can someone help me to figure out what I actually did wrong?
>>
>> I am using Z3 version 4.3.0, SBV 2.10 and GHCi 7.4.2
>>
>> Thank you for your help!
>>
>> Yours sincerely,
>>
>> Jun Jie
>>
>>
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Niklas Hambüchen wrote:


(This is a slightly detailed email. If you are the maintainer of one of
the packages benchmarked here, you might want to read it though.)


Could you please put your experiences the Wiki? This would help others to 
choose a package.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe