Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread David Barbour
Is there any way to `query` a diagram, i.e. associate data with each pixel
for mouse clicks? Or are the composition rules mostly write-only?

On Sun, Oct 23, 2011 at 11:47 AM, Brent Yorgey byor...@seas.upenn.eduwrote:

 I am pleased to announce the release of version 0.4 of diagrams, a
 full-featured framework and embedded domain-specific language for
 declarative drawing.

 The last announcement was of the 0.1 release; there have been quite a
 few changes and improvements since then, including:

 -   A new website including a gallery of examples:

  http://projects.haskell.org/diagrams/gallery.html

 -   A new comprehensive user manual with lots of illustrative
examples:

  http://projects.haskell.org/manual/diagrams-manual.html

 -   New primitive shapes: rounded rectangles, wedges, and a new
flexible API for generating polygons

 -   Cubic splines

 -   Basic text support

 -   Support for external image primitives

 -   Lots more convenient combinators, bug fixes, and improvements

 Cool, how can I try it out?
 ---

 For the truly impatient:

cabal install gtk2hs-buildtools
cabal install diagrams

 For the slightly less impatient, read the quick tutorial, which has
 detailed information about how to install the necessary packages and
 will introduce you to the fundamentals of the framework:

  http://projects.haskell.org/diagrams/tutorial/DiagramsTutorial.html

 For those who are even less impatient but want to really dig in and
 use the power features, read the user manual:

  http://projects.haskell.org/manual/diagrams-manual.html

 Cool, how can I contribute?
 ---

 There are lots of ways you can contribute! First, you may want to
 subscribe to the project mailing list
 (http://groups.google.com/group/diagrams-discuss), and/or come hang
 out in the #diagrams IRC channel on freenode.org.

 -   There are lots of easy bug fixes, improvements, and feature requests
just waiting for people wanting to get involved: see the bug
tracker for a list of open tickets:

  http://code.google.com/p/diagrams/issues/list

 -   The source repositories are mirrored using both darcs (on
patch-tag.com) and git (on github.com), and patches are accepted
in either place, thanks to Owen Stephen's great work on
darcs-bridge [1].

 -   Create a higher-level module built on top of the diagrams framework
(e.g. tree or graph layout, generating Turing machine
configuration diagrams, Penrose tilings ... your imagination is
the only limit!)  and submit it for inclusion in a special
diagrams-contrib package which will be created for such
higher-level user-contributed modules.

 -   Use diagrams to create some cool graphics and submit them for
inclusion in the gallery.

 -   Start your own project built on top of diagrams and let us know how
it goes!

 -   Last but certainly not least, just try it out for your pet graphics
generation needs and contribute your bug reports and feature
requests.


 Happy diagramming!


 Brought to you by the diagrams team:

 -   Brent Yorgey
 -   Ryan Yates

 with contributions from:

 -   Sam Griffin
 -   Claude Heiland-Allen
 -   John Lato
 -   Vilhelm Sjöberg
 -   Luite Stegeman
 -   Kanchalai Suveepattananont
 -   Scott Walck


 [1] http://wiki.darcs.net/DarcsBridgeUsage

 ___
 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] Package documentation complaints -- and a suggestion

2011-10-24 Thread Antti-Juhani Kaijanaho
On Mon, Oct 10, 2011 at 09:06:01AM +0100, Paterson, Ross wrote:
 The distinction between synopsis and description is borrowed from the
 Debian package format:
 
 http://www.debian.org/doc/debian-policy/ch-binary.html#s-descriptions
 
 The two fields are aimed at different audiences.

Not in Debian.  The synopsis and description are a bit like the title and the
abstract of a scholarly paper: you might see a title without the abstract (and
it must work alone), but both are aimed at the same audience - people who are
unsure whether they should read the paper (install the package) and look for
information sufficient to decide that it's not what they need (or that it
probably is).

-- 
Antti-Juhani Kaijanaho, Jyväskylä, Finland
http://antti-juhani.kaijanaho.fi/newblog/
http://www.flickr.com/photos/antti-juhani/

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Ketil Malde
Rustom Mody rustompm...@gmail.com writes:

 I remember (vaguely) a 'live page' ie where one could enter (into the
 browser) changes to the diagrams code and see the results immediately.
 Is that page there? (Or am I mixing up with something else?)

Chris Smith's web interface to Ben Lippmeier's Gloss, perhaps?
http://dac4.designacourse.com:8000/

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants

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


Re: [Haskell-cafe] hello Haskell

2011-10-24 Thread Ketil Malde
Tom Murphy amin...@gmail.com writes:

 Blocking/unsubscribing people based on their email provider seems... sort of
 impolite or unwelcoming.
 A greylist could work.

Greylist, as in temporarily refuse a message, and wait for the sending
mail server to retry?  I don't see how it would work against hijacked
hotmail accounts, they most likely use the real hotmail service - which
would retry appropriately.  My own experience indicates that spammers
now often correctly retry deliveries, so greylisting is less effective
than it used to be.

 Given the relatively low volume of spam, my vote is for the original
 suggestion of first-message-moderated, with the ability to put an address
 back on moderation if their account is hacked.

+1

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants

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


Re: [Haskell-cafe] is Haskell missing a non-instantiating polymorphic case?

2011-10-24 Thread Heinrich Apfelmus

Adam Megacz wrote:


I'm starting to suspect that there are very useful aspects of the 
parametricity of System F(C) which can't be taken advantage of by 
Haskell in its current state.  To put it briefly, case-matching on a

 value of type (forall n . T n) forces one to instantiate the n,
even though the branch taken within the case cannot depend on n 
(parametricity).


I came up with the simplest example I could and posted it to
StackOverflow, but there haven't been any successes (despite some
excellent attempts!):

http://stackoverflow.com/questions/7720108/


Actually, polymorphism is not implicit in System F, you have to use a 
big Λ to bind type parameters. For instance, the identity function is 
written


id :: ∀a.(a - a)
id = Λa.λ(x::a).x

The first argument is the type and the second argument is the actual 
argument.


With this in mind, it's clear that you can't write your example; it 
would look like this:


hard :: ∀n.Maybe (f n) - Maybe (∀n.f n)
hard f = case f n of   -- n is not in scope
   Nothing - Nothing
   Just x  - Just (Λn.x)  -- n bound here

Of course, parametricity tells you that that the function f is actually 
constant in a certain sense. But to my knowledge, there is no way to 
make this knowledge internal to System F.



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] hello Haskell

2011-10-24 Thread Ivan Lazar Miljenovic
On 24 October 2011 18:15, Ketil Malde ke...@malde.org wrote:
 Tom Murphy amin...@gmail.com writes:

 Blocking/unsubscribing people based on their email provider seems... sort of
 impolite or unwelcoming.
 A greylist could work.

 Greylist, as in temporarily refuse a message, and wait for the sending
 mail server to retry?  I don't see how it would work against hijacked
 hotmail accounts, they most likely use the real hotmail service - which
 would retry appropriately.  My own experience indicates that spammers
 now often correctly retry deliveries, so greylisting is less effective
 than it used to be.

 Given the relatively low volume of spam, my vote is for the original
 suggestion of first-message-moderated, with the ability to put an address
 back on moderation if their account is hacked.

I see greylisting as specialised form of moderation:

* If it's a new user and they send spam, kick them off the list.

* If it seems an existing user has had their email hacked, give them
more than one chance before kicking them off the list, possibly
sending a message to them directly to check if they are still able to
access their account and stop the hijacking.

But +1 to at least moderating new users; I'd prefer something more
concrete for dealing with possibly hacked accounts than just
moderating them again.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] hello Haskell

2011-10-24 Thread Yitzchak Gale
Daniel Fischer wrote:
 Just for the record, not a newcomer, and has non-spam
 messages

Conrad Parker wrote:
 There was a recent hotmail exploit, with people reporting their
 account sent spam...

No exploit is needed. It is trivial for an impostor to
seem as if he is sending email from someone else's
account, and spammers do that all the time.
There is nothing special about Hotmail.

There are some ways to detect that kind of fraud.
One method is SPF, which is currently being pushed by
Google and some other email providers:

http://openspf.org/

Unfortunately, Mailman, or at least the version
we are currently using on all of our servers, does
not support this AFAIK.

In fact, our domains do not even have SPF records
themselves yet. So all mail from our mailing lists
is flagged as suspicious by Google and many other
providers. I hope that will be fixed soon.

It's true, even when a system like SPF is in place,
it is still possible to bypass it by breaking in
to an email account and actually sending the
spam from there. But we have not yet reached
the point where such an exploit is even needed.

For now, we are just relying on the classic
method of using a server-side spam filter.
This incident seems to have gotten past that.

Thanks,
Yitz

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


Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-24 Thread Ryan Newton

 Good point. On the other hand, nobody points package authors to the
 Debian documentation (and Debian also has review for newly uploaded
 packages, as far as I know).


Re: review process -- Perhaps there would be a use for a review process
somewhere between haskell-platform and the unwashed masses?

HP covers a very small percentage of packages, but a larger percentage could
probably pass some kind of review akin to the debian process.  And it would
be a good forcing function to get people to do the things they don't get
around to

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


[Haskell-cafe] Haskell in Munich 2

2011-10-24 Thread Dr . Heinrich Hördegen

Dear all,

last month's meeting of Haskellers in Munich was a success. Let's 
repeat it! We will meet on Wednesday, 26 Oct, at Cafe Puck at Cafe Puck 
(www.cafepuck.de). Everybody interested in Haskell or functional 
programming is cordially invited. If you can't make it this time, check 
out this site for other dates:


http://www.haskell-munich.de

See you on Wednesday,
Heinrich Hördegen

P.S.: Some hours ago, I send this message with a wrong date. The 
correct date is Wednesday, 26 Oct, 19h30. Sorry.


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


Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-24 Thread Gregory Collins
On Mon, Oct 24, 2011 at 12:55 PM, Ryan Newton rrnew...@gmail.com wrote:
 Good point. On the other hand, nobody points package authors to the
 Debian documentation (and Debian also has review for newly uploaded
 packages, as far as I know).

 Re: review process -- Perhaps there would be a use for a review process
 somewhere between haskell-platform and the unwashed masses?
 HP covers a very small percentage of packages, but a larger percentage could
 probably pass some kind of review akin to the debian process.  And it would
 be a good forcing function to get people to do the things they don't get
 around to

I'm skeptical. We seem to have trouble getting enough of people's
spare time to tackle interesting engineer work, let alone relatively
thankless administrative/bureaucratic/procedural work. If people are
going to devote time towards solving this particular problem (poorly
documented libraries), an interesting first step would be to try
solving the problem using technological means, i.e.: prohibit or
otherwise discourage uploads to hackage that fail
automatically-verifiable criteria here.

Examples could include: Your package lacks a description, more than
X% of your modules lack toplevel module comments, fewer than Y% of
your toplevel exports have haddock comments, etc... Packages with
stability=experimental would probably be exempt from the requirements.
Duncan could probably comment authoritatively, but I'm guessing
Hackage 2 might provide a better framework for tackling these kinds of
policy issues, because it would probably allow you to e.g. filter the
package list by stability.

G
-- 
Gregory Collins g...@gregorycollins.net

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Stephen Tetley
 Rustom Mody rustompm...@gmail.com writes:

 I remember (vaguely) a 'live page' ie where one could enter (into the
 browser) changes to the diagrams code and see the results immediately.
 Is that page there? (Or am I mixing up with something else?)

Maybe it was Péter Diviánszky's 'dia' (entirely different to 'diagrams') ?

 http://pnyf.inf.elte.hu/fp/Diagrams_en.xml

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


Re: [Haskell-cafe] thespian thoughts

2011-10-24 Thread Simon Michael
Hi Alex. I'm testing thespian in rss2irc, FYI: 
http://joyful.com/darcsden/simon/rss2irc/browse/rss2irc.hs#L-114 . 

Maybe there's a better way to use it, but for now it brings me one extra thread 
and higher memory usage/leakage - an instance grew to 350M overnight where I'd 
normally see 50-100M. The leak may be in my code, but I haven't found it yet. 
Did you notice high memory usage when using thespian ?

Whether or not I end up keeping it, it has influenced the ordinary thread-based 
manager for the better, eg see forkMonitoredIO which is like a poor man's 
monitor using exceptions rather than actor messages.

Best,
- Simon


On Oct 12, 2011, at 8:44 AM, Simon Michael wrote:

 Hi Alex, thanks for the reply (it didn't seem to reach haskell-cafe, if that 
 matters) and the update on status. I passed over CloudHaskell as it seemed 
 (a) over-complex for my needs and (b) not ready, eg not on hackage. I need 
 something that will still permit cabal install rss2irc. But perhaps that's 
 not far off. I'll look again more closely, at both.
 
 Best - Simon
 
 
 On Oct 11, 2011, at 10:48 PM, Alex Constandache wrote:
 
 Hi Simon,
 
 Sorry for the late reply. I no longer work on thespian, as there is
 another project, called Cloud Haskell which provides much more
 functionality than thespian (including Erlang style distributed
 computing). It is not available on Hackage, but it lives on Github at
 
 https://github.com/jepst/CloudHaskell
 
 Simon Peyton-Johnes himself seems to be associated with the project,
 so you should have a look at it. If it does not match your needs, feel
 free to hack thespian and send me a pull request on bitbucket. You are
 the second person who emailed about thespian in the last month, so
 maybe I should reconsider the decision to abandon it (which was
 motivated by my desire to avoid contributing to the insane
 fragmentation that plagues Hackage).
 
 --Alex
 
 On Sun, Oct 9, 2011 at 12:45 PM, Simon Michael si...@joyful.com wrote:
 Hi Alexander,
 I went looking for something to clean up rss2irc's thread management, and
 your recently released thespian package looks like the simplest, most
 practical actors/erlang/OTP-ish lib for haskell so far. Thanks!
 I need to restart threads (actors) in a controlled way when they die or
 hang. I think some of all of that is also part of Erlang/OTP, and maybe it's
 already on your todo list. Here are some notes I made, for your interest and
 in case you have any further thoughts.
 I thought of adding some actor-transforming combinators like these:
 -- | Spawn the specified action and restart it whenever it dies, unless
 --   the restart frequency exceeds any of the given maximum frequencies in
 --   which case throw an exception.
 restart :: [Frequency] - IO a - IO Address
 restart fs action = spawn $ do
  setFlag TrapRemoteExceptions
  let start times = []
  forever
   t - getCurrentTime
   update start times
   when (any fs exceeded by start times) throw error
   worker - spawn action
   monitor worker
   receive worker [Case _ - return ()]
 -- | Convert hangs to exceptions using a watchdog timer: spawn the
 --   specified action under the control of a watcher which monitors it and
 --   also kills it and throws an exception if the worker ever fails to
 --   send (something) to the watcher within the specified interval.
 watchdog :: Seconds - (Address - IO a) - IO Address
 watchdog t action = spawn $ do
  watcher - self
  worker - spawn $ action watcher
  monitor worker
  forever
   receiveTimeout t [Case _  - return ()
 Default - throw error
]
 which I would use something like:
 main = do
  (feed, bot) - ...
  spawn $ do
   reader- restart [MaxPerHour 2] $ watchdog 60 $ feedReader feed bot
   announcer - restart [MaxPerHour 2] $ watchdog 60 $ ircAnnouncer bot
   responder - restart [MaxPerHour 2] $ watchdog 60 $ ircResponder bot
   monitor reader
   monitor announcer
   monitor responder
   setFlag TrapRemoteExceptions
   receive [Case e :: RemoteException - exitFailure (show e) -- one of the
 above died or hung too frequently
   ]
 but the types aren't right. I'm not sure if these combinators are possible
 with the current thespian api. Also they would complicate things, eg what is
 the address of a restarted actor ?
 On second thoughts it might be better if these features were built in to the
 library. I imagine something like:
 main = do ...
  reader- spawnWith [RestartSpec [MinInterval (minutes 5), MaxPerHour
 3, MaxPerWeek 6], Watchdog (seconds 60)] $ feedReader feed bot
 feedReader = do
  forever
poll feed, do stuff
resetWatchdog
 What do you think ?
 Best - Simon
 
 
 
 -- 
 AC
 I used to have a signature, but now I don't.
 
 -BEGIN PGP PUBLIC KEY BLOCK-
 Version: BCPG v1.45
 
 mQINBE2kb5sBEADO/4u9AVkyz+jEnhgYzfdJ2tIIxOfAL4rqx2jXbxeFVq7vyBRS
 vM+K8u2Xw2TBC0dXzNy9GiBf9qjZS1EGPPiIvTLsp5aIoQLsO7E6H6g7Z5eqijMC
 

Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Brent Yorgey
On Mon, Oct 24, 2011 at 08:21:30AM +0530, Rustom Mody wrote:
 Thanks.  This is attractive.
 I remember (vaguely) a 'live page' ie where one could enter (into the
 browser) changes to the diagrams code and see the results immediately.
 Is that page there? (Or am I mixing up with something else?)

You might also have been thinking of Luite Stegeman's Wolfgang
Lambda project, which supports diagrams in this way (as well as many
other things!).  There was an early preview version of it up for a
little while which a bunch of people saw, but it's not ready for
release yet.

 How does diagrams compare with graphviz?  If this is an inappropriate
 (type-wrong?) question thats ok :-)  Its just that when I last looked at
 graphviz I found the documentation somewhat impenetrable -- like much else
 in Hackage -- lots of types, no examples.

graphviz is a special-purpose tool for doing graph layout and
visualization.  diagrams is a general-purpose framework for drawing
anything at all.  As for documentation, you do realize that the graphviz
package on Hackage is a set of bindings? So there's a lot of helpful
documentation at http://www.graphviz.org/ .

One of my goals with diagrams is to have excellent documentation, so
if you find anything that is unclear or poorly documented, please file
a bug report (http://code.google.com/p/diagrams/issues/list)!

-Brent

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Brent Yorgey
On Mon, Oct 24, 2011 at 03:46:26PM +1100, Ivan Lazar Miljenovic wrote:
 
 Hmmm... might be interesting to try and use dot/neato/etc. to do the
 layout of a graph, and then use diagrams for the actual
 visualisation...

I agree!  This has been on my list of
things-to-do-with-diagrams-eventually for quite a while. It shouldn't
even be very hard since your graphviz bindings can so nicely
round-trip a graph description through dot/neato/etc. (right?)
graphviz is great at graph layout but not so hot at graph *drawing*.

-Brent

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Brent Yorgey
On Sun, Oct 23, 2011 at 11:06:19PM -0700, David Barbour wrote:
 Is there any way to `query` a diagram, i.e. associate data with each pixel
 for mouse clicks? 

Yes.  Every diagram has an associated 'query function', which
associates a monoidal value to every point.  By default it just
returns True/False indicating whether the given point is in the
interior of any shape, but you can use any monoid you like.  I believe
John Lato has been using this in conjunction with the support for
rendering directly to a gtk widget to develop some sort of interactive
graphical application (I don't know many details).

For more info see 

  http://projects.haskell.org/diagrams/manual/diagrams-manual.html#using-queries

-Brent


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


Re: [Haskell-cafe] lost in generics

2011-10-24 Thread Neil Mitchell
Hi Rustom,

I tend to find that I use Uniplate for most stuff, and SYB for very
complex stuff (SYB is quite a bit more complicated to do the simple
things, but can do things out of reach for Uniplate). The example of
manipulating AST's is very common, and using a generics library is a
very good idea.

One way to start would be to read the Uniplate manual:
http://community.haskell.org/~ndm/darcs/uniplate/uniplate.htm - it
even uses a simple expression type as the example. It has examples of
all the functions, and also little exercises to try - even if you
don't use Uniplate the exercises might give you practice figuring out
what functions you're likely to end up using in your generics library.

Thanks, Neil


On Thu, Oct 20, 2011 at 6:12 PM, Rustom Mody rustompm...@gmail.com wrote:
 I need some help finding my way around the various generics libraries.

 My usage scenario is -- at least to start with -- the ASTs of programming
 languages.

 It appears to me that there are two generations of generics -- earlier there
 was generic haskell and strafunski
 Now there is uniplate and kure (and syb? -- not sure of its generation...)

 I get this impression because I saw a comment somewhat along these lines.

 And also the very first reference link on the strafunski webpage:
 http://www.haskell.org/haskellwiki/Applications_and_libraries/Generic_programming/Strafunski
 viz http://www.cs.vu.nl/Strafunski/
 seems to be dead. So I am wondering whether strafunski is still under
 development or is it defunct?

 The following paras from
 http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-010.pdf

 The current status of generic programming in Haskell is comparable
 to the lazy Tower of Babel preceding the birth of Haskell
 in the eighties [Hudak et al., 2007]. We have many single-site languages
 or libraries, each individually lacking critical mass in terms
 of language/library-design effort, implementations, and users.



 Although generic programming has been used in several applications,
 it has few users for real-life projects. This is understandable.
 Developing a large application takes a couple of years, and
 choosing a particular approach to generic programming for such a
 project involves a risk. Few approaches that have been developed
 over the last decade are still supported, and there is a high risk that
 the chosen approach will not be supported anymore, or that it will
 change in a backwards-incompatible way in a couple of years time.

  sound omninous :-)
 In general my question is:  What is alive/active and what is alive/active
 and what is -- um -- moved-on-from.
 And of course which are easier and which more difficult to dig into.

 Thanks

 Rusi

 ___
 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] ANN: diagrams 0.4

2011-10-24 Thread David Barbour
Thanks.

Diagrams package seems it could be promising for a declarative UI model -
i.e. integration with functional reactive programming and similar models -
so long as I'm willing to sacrifice `native` look and feel, which doesn't
seem like a big problem.

A couple more questions:
1) Am I right in assuming that Diagrams does very little `occlusion` of its
own - i.e. when rendering a soda-straw view of a complex diagram, or masking
large areas with a rectangle or sphere? There won't be any competition or
redundancy with an external index and backend (e.g. Cairo-GL layer)
occlusion?
2) Is there support for Cairo-like linear and radial gradients?

Also, it seems that for Cairo rendering, we cannot currently supply our own
Cairo context.


 renderDia Cairo (CairoOptions foo.png (PNG (100,100))) myDiagram


This section of your manual is incomplete, I admit, but from browsing the
code it seems you provide a simplified interface that fully encapsulates the
Cairo rendering. Is there any way to render a diagram within the Cairo
stack? or leverage Cairo's own experimental backends (like OpenGL)?

Regards,

Dave


On Mon, Oct 24, 2011 at 10:41 AM, Brent Yorgey byor...@seas.upenn.eduwrote:

 On Sun, Oct 23, 2011 at 11:06:19PM -0700, David Barbour wrote:
  Is there any way to `query` a diagram, i.e. associate data with each
 pixel
  for mouse clicks?

 Yes.  Every diagram has an associated 'query function', which
 associates a monoidal value to every point.  By default it just
 returns True/False indicating whether the given point is in the
 interior of any shape, but you can use any monoid you like.  I believe
 John Lato has been using this in conjunction with the support for
 rendering directly to a gtk widget to develop some sort of interactive
 graphical application (I don't know many details).

 For more info see


 http://projects.haskell.org/diagrams/manual/diagrams-manual.html#using-queries

 -Brent


 ___
 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] ANN: diagrams 0.4

2011-10-24 Thread Jason Dagit
On Sun, Oct 23, 2011 at 11:47 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
 I am pleased to announce the release of version 0.4 of diagrams, a
 full-featured framework and embedded domain-specific language for
 declarative drawing.

 The last announcement was of the 0.1 release; there have been quite a
 few changes and improvements since then, including:

 -   A new website including a gallery of examples:

      http://projects.haskell.org/diagrams/gallery.html

 -   A new comprehensive user manual with lots of illustrative
    examples:

      http://projects.haskell.org/manual/diagrams-manual.html

 -   New primitive shapes: rounded rectangles, wedges, and a new
    flexible API for generating polygons

 -   Cubic splines

 -   Basic text support

What do you use for text support?  I know at one point you were
interested in my freetype2 binding (which is still very raw and
immature), but you must be using gtk for font loading and rendering?

Jason

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


[Haskell-cafe] Error when installing RSA (for yesod) with GHC 7.2.1

2011-10-24 Thread Yves Parès
I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when
cabal install rsa

I got the error
$ cabal install rsa
Resolving dependencies...
Configuring RSA-1.0.6.2...
Preprocessing library RSA-1.0.6.2...
Preprocessing executables for RSA-1.0.6.2...
Building RSA-1.0.6.2...
[1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs,
dist/build/Codec/Crypto/RSA.o )

Codec/Crypto/RSA.hs:580:10:
Duplicate instance declarations:
  instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21
  instance Random Word8 -- Defined in System.Random
cabal: Error: some packages failed to install:
RSA-1.0.6.2 failed during the building phase. The exception was:
ExitFailure 1

Apparently it's an instance being declared twice.
However RSA hackage page states that it compiles under GHC 7.2:
http://hackage.haskell.org/package/RSA
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Error when installing RSA (for yesod) with GHC 7.2.1

2011-10-24 Thread Thomas DuBuisson
Try to install with: cabal install RSA 'random == 1.0.1.0'

I'm guessing the issue is your random library is less than 1.0.1 and
also includes an instance of Word8 (in other words, the GHC release
you use pulled an unofficial version from the repo).

Cheers,
Thomas

On Mon, Oct 24, 2011 at 2:13 PM, Yves Parès limestr...@gmail.com wrote:
 I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when
 cabal install rsa

 I got the error
 $ cabal install rsa
 Resolving dependencies...
 Configuring RSA-1.0.6.2...
 Preprocessing library RSA-1.0.6.2...
 Preprocessing executables for RSA-1.0.6.2...
 Building RSA-1.0.6.2...
 [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs,
 dist/build/Codec/Crypto/RSA.o )

 Codec/Crypto/RSA.hs:580:10:
     Duplicate instance declarations:
   instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21
   instance Random Word8 -- Defined in System.Random
 cabal: Error: some packages failed to install:
 RSA-1.0.6.2 failed during the building phase. The exception was:
 ExitFailure 1

 Apparently it's an instance being declared twice.
 However RSA hackage page states that it compiles under GHC 7.2:
 http://hackage.haskell.org/package/RSA

 ___
 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] Error when installing RSA (for yesod) with GHC 7.2.1

2011-10-24 Thread Yves Parès
Nope, I already have random 1.0.1.0 installed...


2011/10/24 Thomas DuBuisson thomas.dubuis...@gmail.com

 Try to install with: cabal install RSA 'random == 1.0.1.0'

 I'm guessing the issue is your random library is less than 1.0.1 and
 also includes an instance of Word8 (in other words, the GHC release
 you use pulled an unofficial version from the repo).

 Cheers,
 Thomas

 On Mon, Oct 24, 2011 at 2:13 PM, Yves Parès limestr...@gmail.com wrote:
  I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when
  cabal install rsa
 
  I got the error
  $ cabal install rsa
  Resolving dependencies...
  Configuring RSA-1.0.6.2...
  Preprocessing library RSA-1.0.6.2...
  Preprocessing executables for RSA-1.0.6.2...
  Building RSA-1.0.6.2...
  [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs,
  dist/build/Codec/Crypto/RSA.o )
 
  Codec/Crypto/RSA.hs:580:10:
  Duplicate instance declarations:
instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21
instance Random Word8 -- Defined in System.Random
  cabal: Error: some packages failed to install:
  RSA-1.0.6.2 failed during the building phase. The exception was:
  ExitFailure 1
 
  Apparently it's an instance being declared twice.
  However RSA hackage page states that it compiles under GHC 7.2:
  http://hackage.haskell.org/package/RSA
 
  ___
  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] Error when installing RSA (for yesod) with GHC 7.2.1

2011-10-24 Thread Daniel Fischer
On Monday 24 October 2011, 23:13:32, Yves Parès wrote:
 I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when
 cabal install rsa

 
 Apparently it's an instance being declared twice.
 However RSA hackage page states that it compiles under GHC 7.2:
 http://hackage.haskell.org/package/RSA

The instance in the rsa package is guarded by a Cabal MIN_VERSION macro:
 
#if !MIN_VERSION_random(1,0,1)
instance Random Word8 where
  randomR (a,b) g = let aI::Int = fromIntegral a 
bI::Int = fromIntegral b
(x, g') = randomR (aI, bI) g
in (fromIntegral x, g')
  random  = randomR (minBound, maxBound)
#endif

Unfortunately, that macro was broken in some Cabal versions, among them 
1.8.0.2, so the negated check goes wrong (#if !(MIN_...) would work).
[As a quickfix for this package, you could edit the source, but you'll 
probably come across more macro problems later.]

Build yourself a new cabal-install.
If you use 7.2.1 for that, the recipe at https://gist.github.com/1169332 
tells you what you have to change.
If you have an older ghc still available, the vanilla procedure should work 
with that (if you're using the old 6.12.* with the Cabal-1.8.0.2, first 
install a later Cabal version, 1.8.0.6 works).

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Ivan Lazar Miljenovic
On 25 October 2011 04:25, Brent Yorgey byor...@seas.upenn.edu wrote:
 On Mon, Oct 24, 2011 at 03:46:26PM +1100, Ivan Lazar Miljenovic wrote:

 Hmmm... might be interesting to try and use dot/neato/etc. to do the
 layout of a graph, and then use diagrams for the actual
 visualisation...

 I agree!  This has been on my list of
 things-to-do-with-diagrams-eventually for quite a while. It shouldn't
 even be very hard since your graphviz bindings can so nicely
 round-trip a graph description through dot/neato/etc. (right?)

Yup, it can.  It also has support for more easily adding and pulling
out custom attributes if you want to be able to tag them with more
information (albeit only with Text values at the moment); for example,
I use this for the round-trip'ing to be able to distinguish multiple
edges from each other.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] Error when installing RSA (for yesod) with GHC 7.2.1

2011-10-24 Thread Yves Parès
Okay, so the problem is with cabal-install.
I'd don't verily need ghc 7.2, I think I'll just stick to 7.0.4 unti
cabal-install is updated, it will be simpler.

2011/10/24 Daniel Fischer daniel.is.fisc...@googlemail.com

 On Monday 24 October 2011, 23:13:32, Yves Parès wrote:
  I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when
  cabal install rsa

 
  Apparently it's an instance being declared twice.
  However RSA hackage page states that it compiles under GHC 7.2:
  http://hackage.haskell.org/package/RSA

 The instance in the rsa package is guarded by a Cabal MIN_VERSION macro:

 #if !MIN_VERSION_random(1,0,1)
 instance Random Word8 where
  randomR (a,b) g = let aI::Int = fromIntegral a
bI::Int = fromIntegral b
(x, g') = randomR (aI, bI) g
in (fromIntegral x, g')
  random  = randomR (minBound, maxBound)
 #endif

 Unfortunately, that macro was broken in some Cabal versions, among them
 1.8.0.2, so the negated check goes wrong (#if !(MIN_...) would work).
 [As a quickfix for this package, you could edit the source, but you'll
 probably come across more macro problems later.]

 Build yourself a new cabal-install.
 If you use 7.2.1 for that, the recipe at https://gist.github.com/1169332
 tells you what you have to change.
 If you have an older ghc still available, the vanilla procedure should work
 with that (if you're using the old 6.12.* with the Cabal-1.8.0.2, first
 install a later Cabal version, 1.8.0.6 works).

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


Re: [Haskell-cafe] New rss maintainer

2011-10-24 Thread wren ng thornton

On 10/21/11 11:34 AM, Vincent Hanquez wrote:

Perhaps, unless someone step up, it would be nice to move packages that
have
no maintainer anymore into a github organisation (haskell-janitors ?),
where each package could have many owners and it's easy and simple to
add/remove push rights there.

That could also be an obvious place to look, for newcomers, to get
involved.


+1.

I wouldn't try to be too aggressive about moving ownerless projects 
over, just the ones that are popular and yet definitively abandoned. 
It'd also be nice for the janitors to coordinate helping out with 
maintenance of some of the larger non-abandoned projects which are 
understaffed. Major hacking on non-abandoned projects isn't really a 
beginner/janitor-friendly task, but something like helping to flesh out 
the Haddocks of widely used but underdocumented packages would help the 
overall image of Hackage as well as giving newbies an excuse to go 
poking around reading code to figure out what it does.


--
Live well,
~wren

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


Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-24 Thread wren ng thornton

On 10/24/11 12:34 PM, Gregory Collins wrote:

Examples could include: Your package lacks a description, more than
X% of your modules lack toplevel module comments, fewer than Y% of
your toplevel exports have haddock comments, etc... Packages with
stability=experimental would probably be exempt from the requirements.


I'm not so sure about that exemption. The experimental stability level 
seems to be the norm on Hackage and often means I use this for real 
projects, but because I use it for real projects I'm not quite willing 
to hammer the API in stone just yet. Surely we should distinguish this 
level of stability from no seriously I'm just goofing around with 
category theory, but unfortunately both classes of project are called 
experimental. While the latter may deserve a pass (to encourage 
goofing around with category theory :), the lack of documentation for 
the former seems to me like the main motivation for instituting such an 
automatic system in the first place.


Before dealing with automatic documentation requirements, perhaps it'd 
be better to develop a standard consensus on the terms used in the 
stability field and actively advocating for people to adopt it, as was 
done with the PVP.


--
Live well,
~wren

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


Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-24 Thread Ivan Lazar Miljenovic
On 25 October 2011 13:34, wren ng thornton w...@freegeek.org wrote:
 Before dealing with automatic documentation requirements, perhaps it'd be
 better to develop a standard consensus on the terms used in the stability
 field and actively advocating for people to adopt it, as was done with the
 PVP.

+1, not to mention all the to-level fields available in Haddock
(portable, etc.) as well.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Rustom Mody
On Mon, Oct 24, 2011 at 10:17 PM, Stephen Tetley
stephen.tet...@gmail.comwrote:

  Rustom Mody rustompm...@gmail.com writes:
 
  I remember (vaguely) a 'live page' ie where one could enter (into the
  browser) changes to the diagrams code and see the results immediately.
  Is that page there? (Or am I mixing up with something else?)

 Maybe it was Péter Diviánszky's 'dia' (entirely different to 'diagrams') ?

  http://pnyf.inf.elte.hu/fp/Diagrams_en.xml


Yes that was it (It is called diagrams :-)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Rustom Mody
On Mon, Oct 24, 2011 at 10:16 AM, Ivan Lazar Miljenovic 
ivan.miljeno...@gmail.com wrote:

 On 24 October 2011 13:51, Rustom Mody rustompm...@gmail.com wrote:
  How does diagrams compare with graphviz?  If this is an inappropriate
  (type-wrong?) question thats ok :-)  Its just that when I last looked at
  graphviz I found the documentation somewhat impenetrable -- like much
 else
  in Hackage -- lots of types, no examples.

 How is it now, better?  If not, what kind of more documentation would you
 like?



Without claiming to have looked very hard, I looked up grahhviz in hayoo,
gathered I should be looking at Data.GraphViz and tried clicking everything
that looked reasonable here
but still cant find an example of a graph :-) ie a graphviz graph in
haskell.

Is this a complaint against graphviz or against hackage/cabal etc?? Dunno.
[Maybe I am just tired]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: diagrams 0.4

2011-10-24 Thread Ivan Lazar Miljenovic
On 25 October 2011 16:02, Rustom Mody rustompm...@gmail.com wrote:
 On Mon, Oct 24, 2011 at 10:16 AM, Ivan Lazar Miljenovic
 ivan.miljeno...@gmail.com wrote:

 On 24 October 2011 13:51, Rustom Mody rustompm...@gmail.com wrote:
  How does diagrams compare with graphviz?  If this is an inappropriate
  (type-wrong?) question thats ok :-)  Its just that when I last looked at
  graphviz I found the documentation somewhat impenetrable -- like much
  else
  in Hackage -- lots of types, no examples.

 How is it now, better?  If not, what kind of more documentation would you
 like?


 Without claiming to have looked very hard, I looked up grahhviz in hayoo,
 gathered I should be looking at Data.GraphViz and tried clicking everything
 that looked reasonable here
 but still cant find an example of a graph :-) ie a graphviz graph in
 haskell.

Well, there are indeed examples in there, but not in Data.GraphViz:
that module is aimed more at how can I convert my existing data into
a Dot representation, not constructing one by hand.  As of the latest
version (2999.12.*), there are indeed examples for anyone that wants
them:

* Sample graph in Dot representation used as a base case:
http://hackage.haskell.org/packages/archive/graphviz/2999.12.0.3/doc/html/Data-GraphViz-Types.html
* Using the canonical representation:
http://hackage.haskell.org/packages/archive/graphviz/2999.12.0.3/doc/html/Data-GraphViz-Types-Canonical.html
* Using the graph representation:
http://hackage.haskell.org/packages/archive/graphviz/2999.12.0.3/doc/html/Data-GraphViz-Types-Generalised.html
* Using the Monadic representation (based upon the dotgen package):
http://hackage.haskell.org/packages/archive/graphviz/2999.12.0.3/doc/html/Data-GraphViz-Types-Graph.html

The Data.GraphViz.Types module also has a short description of how to
choose which representation.

However, I'll add a note in Data.GraphViz telling people to look in
Data.GraphViz.Types if they want to construct a Dot graph by hand.

 Is this a complaint against graphviz or against hackage/cabal etc?? Dunno.

I'd say it's more a case of: to the maintainer, it's _obvious_ how to
do stuff since they're intimately familiar with the details; as such,
if something isn't clear let them know that you're confused by
something (which at least in my case jogs me to go and add extra
clarification on such matters)!

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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