Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-06 Thread Jeff Heard

There's colourlovers.com as well



On Apr 6, 2010, at 12:41 PM, Thomas Schilling  
 wrote:



Well, I used http://www.colorschemedesigner.com/

On 6 April 2010 16:20, Daniel Peebles  wrote:
I'm definitely not a design/color person, but has anyone considered  
using
kuler.adobe.com as a source of "nice" color schemes, since we seem  
to have

an issue coming up with attractive combinations?

On Tue, Apr 6, 2010 at 9:58 AM, Thomas Schilling >

wrote:


Well, they make the wannabe-designer mistake of using justified text
in HTML, even worse, for columns just 3 words wide.

The overall layout, is pretty nice though.  It's essentially the
standard Web 2.0 layout (compare http://basecamphq.com/,
http://www.blinksale.com/, http://www.analysis-one.com/, etc.).  The
key design elements are (IMO):

 - Put the important stuff at the top and separate it visually from
the "other stuff".  The important things are:  (1) the quick summary
of Haskell, (2) the "Get Haskell" button, (3) link to "Learn  
Haskell"

/ "Try Haskell"

 - We may have a second row/column of secondary important stuff,  
like

community, project hosting, more implementations, the top learning
materials, etc. links to Haskell users

 - News, Events, etc. can go further down

I'm not particularly attached to any particulars of my suggested
design.  I just thought I'll try to encourage to move away much
further from the current wiki-like and somewhat dull design.

On 6 April 2010 10:36, Johan Tibell  wrote:
On Tue, Apr 6, 2010 at 5:24 AM, Simon Michael   
wrote:

On 4/2/10 5:28 AM, Thomas Schilling wrote:


How about something more colourful?

http://i.imgur.com/7jCPq.png


I really like the simplicity of the Cassandra page:

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





--
Push the envelope.  Watch it bend.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe







--
Push the envelope.  Watch it bend.
___
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] Are there any female Haskellers?

2010-03-29 Thread Jeff Heard
The Wisconsin study, which was done in the 1980s and then redone last
year is the primary source for that, and it presents data that there
is no real difference between women and men in math ability.  The only
*statistically* significant (bold because significant is a technical
term, not a term denoting quality) difference that remains in the
revisited study (which can be found in Nature toward the latter half
of last year, but I don't have the ref. on me at the moment) is
between the variances in IQ and testing distribution between the two
genders.  This causes more men to be in the 95th and above percentiles
on the tests that were given, however given what we know about the
tests and work from the specific branch of organizational psych known
as testing theory, the number of questions that differentiates the
populations in the 90th and above percentiles is too small to be
meaningful.  To put together a real test on the extrema of
mathematical ability for both genders, one would have to construct a
second test that tests only extraordinary populations.

So in other words, the results are significant, technically, but using
them to derive the conclusion that the best men are better at
engineering and math isn't possible.  It's another hypothesis, and not
explained by the results of the study.

By the way, I've been on many programming mailing lists and other
techie mailing lists where this subject has come up, and I've never
seen it so rationally discussed as on this mailing list...

-- Jeff

On Mon, Mar 29, 2010 at 10:37 AM, Alberto G. Corona  wrote:
>
>> IQ tests, for example. google it.
>>
>> 2010/3/28 Jochem Berndsen 
>>>
>>> Alberto G. Corona wrote:
>>> >  The reasons for the sexual differences in mathematical abilities are
>>> > different, because math abilities  are not a -primary- reason for
>>> > survival.  Tools engineering and mastering is. If this is politically
>>> > incorrect I beg you pardon, but this is my honest theory about that. My
>>> > other hobby is evolution and evolutionary psichology.  I really
>>> > recommend to learn about it.
>>>
>>> Could you point us to any evidence that supports your assumption that
>>> there are "sexual differences in mathematical abilities"?
>>>
>>> Thanks, Jochem
>>>
>>> --
>>> Jochem Berndsen | joc...@functor.nl
>>
>
>
> ___
> 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] Fwd: Error in building buster 1.51

2009-11-21 Thread Jeff Heard
Indeed, it was not updated for the 6.10 exception handling.  I'll
update in a few days.  In the meantime, the file operations module is
the culprit.  It is a top-level module, so if you aren't using it, you
could delete it without consequences.  Just delete it and delete its
depenency from the cabal file.  Thanks for finding this...

-- Jeff

On Sat, Nov 21, 2009 at 4:28 AM, Mikhail  wrote:
> Hi,
>
> In GHC 6.10 exception handling is changed. It is incompatible with 6.8.x
> versions.
> It seems that buster wasn't updated for 6.10. So you need or update it your
> self or
> ask an author.
> ___
> Sincerely,
> Mikhail S. Pobolovets
>
> 21 ноября 2009 г. 10:11 пользователь Лев Никитин 
> написал:
>>
>> Hello.
>>
>> I try to install buster 1.51. It has been uploaded on hackage.
>>
>> During building there is an error.
>> Same error can been seen on hackage (look at build failre:
>> http://hackage.haskell.org/packages/archive/buster/2.51/logs/failure/ghc-6.10).
>>
>> How to fix it?
>>
>> Thanks
>>
>>
>>
>>
>> ___
>> 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] New OpenGL package: efficient way to convert datatypes?

2009-10-01 Thread Jeff Heard
Ah, but it takes care of my performance problems, so many thanks from
the lurker :-)

-- Jeff

On Wed, Sep 30, 2009 at 11:37 PM, wren ng thornton  wrote:
> wren ng thornton wrote:
>>>
>>> I guess one could make rules for that, but this tickets makes me wander
>>> if
>>> that really works:
>>> http://hackage.haskell.org/trac/ghc/ticket/1434
>>
>> The RealToFrac class solves Henning's performance complaint as well.
>
>
> Er, I misread his performance problems. The logfloat package doesn't offer
> any particular support for rounding to integral types.
>
> --
> Live well,
> ~wren
> ___
> 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] Just to let people know

2009-09-12 Thread Jeff Heard
I know, but I'm not the package maintainer...  I didn't mean it
couldn't be installed, just that it didn't compile out of the box

On Sat, Sep 12, 2009 at 6:19 AM, Don Stewart  wrote:
> jefferson.r.heard:
>> lhs2TeX does not compile with the latest version of base.  complaints
>> about Control.Exception abound
>
> Adding --constraint='base<4' helps.
> That's what the Arch Linux package uses:
>
>    http://aur.archlinux.org/packages.php?ID=12648
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Just to let people know

2009-09-11 Thread Jeff Heard
lhs2TeX does not compile with the latest version of base.  complaints
about Control.Exception abound
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] rotate image

2009-08-28 Thread Jeff Heard
Not really.   Best thing I can think to do is use the X11 library to
pull the pixels under your window then draw them as a surface on the
drawingarea, then draw your rotated image on top of that.  You have to
have a window, and Gtk windows do not have an alpha.  You'll want it
to be undecorated, too...

On Fri, Aug 28, 2009 at 6:38 PM, h. wrote:
>
> Hello,
>
> Nobody any idea?
>
>> I want to paint in some widget, but this will be in front of some
>> background, so the bg should be transparent.
>
> --
> best regards
> h.
> --
> View this message in context: 
> http://www.nabble.com/rotate-image-tp25122912p25198054.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> ___
> 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] Is logBase right?

2009-08-25 Thread Jeff Heard
I always thought that he who compares floating point numbers for
equality was acting in tangent of reason...

-- Jeff

On Sat, Aug 22, 2009 at 4:02 AM, Mark Wotton wrote:
> he who compares floating point numbers for equality is in a state of sin.
>
> mark
>
> On 22/08/2009, at 5:00 AM, Roberto wrote:
>
>> Hi,
>>
>> There is a mistake is logBase:
>>
>> $ ghci
>> GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help
>> Loading package ghc-prim ... linking ... done.
>> Loading package integer ... linking ... done.
>> Loading package base ... linking ... done.
>> Prelude> logBase 10 10
>> 1.0
>> Prelude> logBase 10 100
>> 2.0
>> Prelude> logBase 10 1000
>> 2.9996                  <--- rrgg!
>> Prelude> logBase 10 1
>> 4.0
>>
>>
>> My host is a Debian GNU/Linux 5.0.2 (lenny) with the following GHC
>> packages:
>>
>> ii  ghc6                                 6.10.4-1
>> ii  ghc6-doc                             6.10.4-1
>> ii  libghc6-mtl-dev                      1.1.0.2-7+b1
>> ii  libghc6-utf8-string-dev              0.3.5-1+b1
>> ii  libghc6-x11-dev                      1.4.5-6
>> rc  libghc6-x11-doc                      1.4.2-1
>> ii  libghc6-x11-xft-dev                  0.3-3+b3
>> ii  libghc6-xmonad-contrib-dev           0.8.1-3+b3
>> rc  libghc6-xmonad-contrib-doc           0.8-2
>> ii  libghc6-xmonad-dev                   0.8.1-5
>>
>> Regards!
>>
>>
>> ___
>> 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] Re: rotate image

2009-08-24 Thread Jeff Heard
ahh, you want to paint against the desktop, then, yes?  That requires
compositing, and I'm not sure there's a way to do that with Gtk
directly.  Probably easier with X and OpenGL.  Needs more of a Gnome
expert than me.

On Mon, Aug 24, 2009 at 6:34 PM, h wrote:
> Hello,
>
>> You could use Cairo.  Load the image to a surface, then rotate the surface 10
> degrees and paint it.
>
> The first steps aren’t problematic, but how can I paint it - in which widget -
> so that the background is transparent, with drawingArea it doesn't seem to
> work.
>
> --
> best regards
> H.
>
> ___
> 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] rotate image

2009-08-24 Thread Jeff Heard
You could use Cairo.  Load the image to a surface, then rotate the
surface 10 degrees and paint it.

Alternately, in Hieroglyph:

renderToPNG w h "image.png" $ rotate 10 image{ filename='whatever.png' }

On Mon, Aug 24, 2009 at 3:57 PM, h wrote:
> Hello,
>
> I already studied the references of gtk2hs for hours, as well as searched in
> the web, but didn't found any working solution.
>
> The problem is to load an image, a png with alpha channel, rotate it e.g. 10
> degree, and show it on the screen, basically as when it would be shown with
> imageNewFromFile with transparency.
>
> Thanks in advance for your help.
>
> --
> Best regards
> H.
>
>
> ___
> 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] Re: ANN: OpenCLRaw 1.0.1000

2009-08-18 Thread Jeff Heard
There was a missing include in the cabal file.  fixed...

On Mon, Aug 17, 2009 at 7:49 PM, Jeff Heard wrote:
> All, I've released a raw binding to the OpenCL platform on Hackage.
> The main differences between it and the C bindings are that constants
> have been replaced by newtypes for type safety reasons, void-essential
> functions that return a token errorcode return a Maybe ErrorCode, and
> functions that return a handle/ptr and return an error-code through an
> out-parameter return instead an Either ErrorCode a.  Modules are
> grouped roughly by the section in which they appear in the standard.
>
> I'm working on an OpenCL binding that is a little more "cooked" as
> well as a high-level OpenCL binding.
>
> OpenCL is a platform for single-host heterogenous, data-parallel
> computing that follows roughly the OpenGL and OpenAL conventions for
> how the library is architected.  It will be available by default in
> the next version of Apple's OS-X, and there are drivers for AMD
> Opteron/Athlons and nVidia CUDA-based graphics cards.
>
> The basic procedure behind running an OpenCL program is:
>
> 1. get a list of platforms
> 2. choose a device on the platform that fits  your needs
> 3. create a context for the platform and the device
> 4. compile a program and "kernels" written in OpenCL/C
> 5. create memory buffer objects.
> 6. execute kernels on the memory buffer objects.
> 7. rinse hands, repeat.
>
> Obviously this is not very functional, but we can't get there without
> a raw binding.   Data Parallel computing is somewhere Haskell is
> excelling; hopefully this will generate some interest in creating a
> DPH binding to OpenCL's C99-based language, OpenCL/C.
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: OpenCLRaw 1.0.1000

2009-08-17 Thread Jeff Heard
All, I've released a raw binding to the OpenCL platform on Hackage.
The main differences between it and the C bindings are that constants
have been replaced by newtypes for type safety reasons, void-essential
functions that return a token errorcode return a Maybe ErrorCode, and
functions that return a handle/ptr and return an error-code through an
out-parameter return instead an Either ErrorCode a.  Modules are
grouped roughly by the section in which they appear in the standard.

I'm working on an OpenCL binding that is a little more "cooked" as
well as a high-level OpenCL binding.

OpenCL is a platform for single-host heterogenous, data-parallel
computing that follows roughly the OpenGL and OpenAL conventions for
how the library is architected.  It will be available by default in
the next version of Apple's OS-X, and there are drivers for AMD
Opteron/Athlons and nVidia CUDA-based graphics cards.

The basic procedure behind running an OpenCL program is:

1. get a list of platforms
2. choose a device on the platform that fits  your needs
3. create a context for the platform and the device
4. compile a program and "kernels" written in OpenCL/C
5. create memory buffer objects.
6. execute kernels on the memory buffer objects.
7. rinse hands, repeat.

Obviously this is not very functional, but we can't get there without
a raw binding.   Data Parallel computing is somewhere Haskell is
excelling; hopefully this will generate some interest in creating a
DPH binding to OpenCL's C99-based language, OpenCL/C.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hugs faster and more reliable than GHC for large list monad 'do' block

2009-08-06 Thread Jeff Heard
Yes, the GHC compiler will work on older kernels and CentOS kernels if
you bootstrap it with 6.4

On Thu, Aug 6, 2009 at 4:51 PM, Jason Dagit wrote:
>
>
> On Thu, Aug 6, 2009 at 1:39 PM, Henning Thielemann
>  wrote:
>>
>> Today a student has shown me a program that consists of a large 'do' block
>> for the list monad. The program looks like
>>
>>   do x1 <- [0..3]
>>      x2 <- [0..2]
>>      ...
>>      x600 <- [0..5]
>>      guard (x1+x2+2*x3 >= 0)
>>      ...
>>      return (x1,x2,,x600)
>>
>> It was actually generated by another program. The results were:
>>
>>  GHC-6.4 was not able to compile that program at all, because it stopped
>> because of memory exhaustion.
>
> Did you try playing with optimization options?  I think someone just
> mentioned that compiling large amounts of static data in GHC is problematic
> and recommended something like -O0 to prevent GHC from analyzing it.  Of
> course, I wouldn't recommend having unoptimized code, but I'm curious how
> that changes the results here.
>
>
>>
>>  GHC-6.8.2 finished compilation after two minutes but the program aborted
>> quickly because of a corrupt thunk identifier.
>
> Oh that's icky.
>
>>
>>  GHC-6.10 not yet tested.
>>  Hugs-2006 executed the program without complaining and showed the first
>> result after a few seconds: (0,0,0,0,0,...,0).
>>
>> Eventually the program must run on a Linux cluster with a not up-to-date
>> Linux kernel, that is, I suspect newer GHC versions cannot be used due to
>> the 'timer_create' problem. (At least, the 'cabal' executable that I
>> generated with a GHC-6.8.2 had this problem when running on the cluster
>> which reminded me on the problems with GHC-6.8 itself running on older Linux
>> kernels.)
>
> I just googled this and found this:
> http://www.haskell.org/pipermail/glasgow-haskell-users/2008-March/014498.html
> That was linked from this discussion:
> http://www.nabble.com/ghc-6.8.2-and-timer_create-error-td16160635.html
>
> The second link seems to indicate that it's not a problem of antiquity but
> instead one related to what configure finds when building GHC for that
> system.  In other words, it should be possible to make a version of GHC
> locally that doesn't use timer_create and then your student should be good
> to go.
>
> Hope that helps,
> Jason
>
> ___
> 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] Looking to check on some capabilities of Data.Colour

2009-08-06 Thread Jeff Heard
Excellent.  That's what I wanted to know :-)

On Thu, Aug 6, 2009 at 4:01 PM,  wrote:
> On Thu, 6 Aug 2009, rocon...@theorem.ca wrote:
>
>> On Thu, 6 Aug 2009, Jeff Heard wrote:
>>
>>> I was wondering if Data.Colour supported Double-valued colour
>>> components > 1.0 or less than 0.  I'm looking to create an HDR image
>>> processing library, and Haskell has one of the most extensive and
>>> correct colour models around, thanks to Russell.  With 16bpcc or
>>> 32bpcc images, however, I need to be sure to be able to correctly
>>> calculate colour values that fall outside the usual [0.0,1.0] gamut.
>>> Does Data.Colour support this functionality?
>>
>> Data.Colour supports values outside the range [0,1] for most computations.
>
> To be slightly more techinical, I want add that Data.Colour.Colour is
> abstract and its interface cares nothing about [0,1].  Gammut issue only
> arise when converting the abstract data type to and from concrete
> coordinates, and which colours are outside [0,1]*[0,1]*[0,1] is coorinate
> system dependent.  Since Data.Colour.Colour is abstract and coordinate
> system indepenent, it cannot (or at least should not) care about such issues
> for oprations that deal only with abstract colours (operations such as
> blending, etc.)
>
>> Components are clamped when extracting to Bounded component types such as
>> Word8 (see toSRGBBounded).  There may also some issues with negaive values
>> when converting to non-linear coordinate systems via a transfer function.
>> This is an area I haven't thought to much about, so there could be a few
>> "bugs" lurking here.  If found they should be fixed, assuming "right"
>> behaviour can be found.
>>
>>>
>>> -- Jeff
>>> ___
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>
>>
>
> --
> Russell O'Connor                                      <http://r6.ca/>
> ``All talk about `theft,''' the general counsel of the American Graphophone
> Company wrote, ``is the merest claptrap, for there exists no property in
> ideas musical, literary or artistic, except as defined by statute.''
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Looking to check on some capabilities of Data.Colour

2009-08-06 Thread Jeff Heard
I was wondering if Data.Colour supported Double-valued colour
components > 1.0 or less than 0.  I'm looking to create an HDR image
processing library, and Haskell has one of the most extensive and
correct colour models around, thanks to Russell.  With 16bpcc or
32bpcc images, however, I need to be sure to be able to correctly
calculate colour values that fall outside the usual [0.0,1.0] gamut.
Does Data.Colour support this functionality?

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


Re: [Haskell-cafe] Why is there no Zippable class? Would this work?

2009-07-16 Thread Jeff Heard
Beautiful.  Can we have a version on hackage?

On Thu, Jul 16, 2009 at 5:56 PM, Job Vranish wrote:
> I was needing a way to zip generic data structures together today and was
> very annoyed to find that there is no Zippable class, or variant there of.
>
> So I made my own:
>
> class (Foldable f, Functor f) => Zippable f where
>   fmaps :: (Foldable g) => g (a -> b) -> f a -> f b
>   fmaps' :: [a -> b] -> f a -> f b -- to save a step on instance
> implementation
>   zipWith :: (a -> b -> c) -> f a -> f b -> f c
>   zip ::  f a -> f b -> f (a, b)
>   unzip :: f (a, b) -> (f a, f b)
>
>   fmaps fs a = fmaps' (toList fs) a
>   fmaps' fs a = fmaps fs a
>   zipWith f a b = fmaps (fmap f a) b
>   zip = zipWith (,)
>   unzip a = (fmap fst a, fmap snd a)
>
> instance Zippable [] where
>   fmaps' (fx:fs) (x:xs) = fx x : fmaps' fs xs
>   fmaps' _   _  = []
>
> --The fmaps function is also quite handy as a replacment for zipWith3,
> zipWith4, etc...
> --For example:
>
> x = [1, 3, 5, 7, 3]
> y = [6, 9, 3, 1, 4]
> z = [2, 4, 0, 8, 2]
> test = fmap (,,) x `fmaps` y `fmaps` z
> -- > [(1,6,2),(3,9,4),(5,3,0),(7,1,8),(3,4,2)]
>
> --you can also throw in a functor instance to remove the dependency on the
> Functor class, but it
> --  might not be worth it:
> instance (Zippable f) => Functor f where
>   fmap f a = fmaps (repeat f) a
>
>
> Is there any good reason that there isn't something like this in the
> standard libraries? Or, as far as I can tell, on hackage?
> If not, then maybe I'll stick it on hackage.
>
> - Job Vranish
>
>
>
> ___
> 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] Problem resizing widget contained in window

2009-07-14 Thread Jeff Heard
I created a window, like so:

Gtk.windowSetTitle win name
Gtk.widgetSetName win "Hieroglyph"
Gtk.onDestroy win (exitWith ExitSuccess)
Gtk.windowSetDefaultSize  win w h
Gtk.containerResizeChildren win

And an GLDrawingArea like so:

config ←  Gtk.glConfigNew [Gtk.GLModeRGBA, Gtk.GLModeMultiSample,
Gtk.GLModeDouble, Gtk.GLModeDepth, Gtk.GLModeAlpha]
area ←  Gtk.glDrawingAreaNew config
Gtk.onRealize area ◊ GL.drawBuffer $= GL.BackBuffers
Gtk.onExpose area (λ_ →  renderOnExpose bus ≫ return True)

and finally show it like this:

Gtk.containerAdd win area
Gtk.widgetShowAll win



Now, if someone resizes the window, the GLArea does not appear to
resize along with it.  Did I screw something up?

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


[Haskell-cafe] c2hs confusion with a simple function

2009-07-09 Thread Jeff Heard
The c2hs documentation at
http://www.cse.unsw.edu.au/~chak/haskell/c2hs/docu/implementing.html#id314947
 gives me an example to follow for this case:

{#fun notebook_query_tab_label_packing as ^
  `(NotebookClass nb, WidgetClass cld)' =>
  {notebook `nb',
   widget   `cld'   ,
   alloca-  `Bool' peekBool*,
   alloca-  `Bool' peekBool*,
   alloca-  `PackType' peekEnum*} -> `()'#}

so I took the original C binding:

   void SHPGetInfo(SHPHandle, int*, int*, double*, double*)

And wrote a c2hs binding:

{#fun SHPGetInfo as getInfo
{ fromSHPHandle `SHPHandle'
, alloca- `Int'
, alloca- `Int'
, alloca- `Double'
, alloca- `Double'
} -> `()' #}

The error I get:

Internal.chs:85:2:
Couldn't match expected type `Int'
   against inferred type `(Ptr b -> IO c) -> IO c'
  Expected type: IO (Int, Int, Double, Double)
  Inferred type: IO
   ((Ptr b -> IO c) -> IO c,
(Ptr b1 -> IO c1) -> IO c1,
(Ptr b2 -> IO c2) -> IO c2,
(Ptr b3 -> IO c3) -> IO c3)
In the expression:
  alloca $ \ a2' -> alloca $ \ a3' -> alloca $ \ a4' -> ...
In the expression:
let a1' = fromSHPHandle a1
in alloca $ \ a2' -> alloca $ \ a3' -> alloca $ ...

I've tried ending it with withCIntConv and withCFloatConv to no avail.
 The original c2hs file is attached.  I'm sure there are many more
problems, but this is the one I'm working on at the moemnt...

-- Jeff


Internal.chs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell on the iPhone

2009-06-23 Thread Jeff Heard
This is great news!  I'd love to be able to write our cellphone
automated vehicle location clients in Haskell.

-- Jeff

On Mon, Jun 22, 2009 at 6:38 PM, Don Stewart wrote:
> If you're doing it in Haskell, please feel free to keep plugging.
>
> A new market for Haskell apps is highly welcome.
>
> ryant5000:
>> Jason,
>>
>> iPwn is currently in pre-production for its first title, which will be an
>> action-RPG reminiscent of Diablo and Fallout.  I'll try to keep the shameless
>> plugging on Haskell-cafe to a minimum, but I make no promises :P  I will
>> definitely let people know when our website is put together in some useful 
>> way.
>>
>>
>> Ryan
>>
>> On Mon, Jun 22, 2009 at 18:34, Jason Dagit  wrote:
>>
>>
>>
>>     On Mon, Jun 22, 2009 at 3:30 PM, Ryan Trinkle  
>> wrote:
>>
>>         Dear Haskellers,
>>
>>         Recently, there's been a groundswell of activity in the Haskell
>>         community regarding the Haskell's use in developing iPhone games.  
>> The
>>         iPhone is a powerful, innovative platform (with a great monetization
>>         scheme, to boot), and it's not surprising that many of us would want 
>> to
>>         develop apps for it in our favorite language.
>>
>>         I am proud to announce today that my company, iPwn Studios Inc., is
>>         currently preparing to release an open source patch to GHC that 
>> allows
>>         it to output binaries for iPhone OS.  The patch will be released 
>> under
>>         a BSD license as soon as possible and hopefully integrated into the 
>> GHC
>>         main-line in the near future.  As the first (to my knowledge)
>>         Haskell-based game studio, iPwn Studios is committed to giving back 
>> to
>>         the Haskell community through open source - contributing to a rising
>>         tide that lifts us all.
>>
>>
>>     Hi Ryan,
>>
>>     This is great news!  Thanks!  Does iPwn have any up coming titles?  
>> Perhaps
>>     a blog where we could read about them so the "advertising" doesn't hit 
>> the
>>     list.
>>
>>
>>
>>
>>         I would like to take this opportunity to propose the creation of a
>>         haskell-iphone mailing list, so that all Haskellers working with the
>>         iPhone - whether for profit or for pleasure - can come together to 
>> make
>>         Haskell a force to be reckoned with in the burgeoning iPhone App
>>         marketplace.
>>
>>
>>     Sounds good to me.  Please post back here if it gets created.
>>
>>     Jason
>>
>>
>>
>
>> ___
>> 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


[Haskell-cafe] Re: ANNOUNCE: OpenGLRaw 1.0.0.0

2009-06-11 Thread Jeff Heard
And the one other thing is that it increases (to me) the at-a-glance
comprehensibility of the module.  If I'm reading over soemone else's
code and I want to get a feel for where s/he put things, the fully
qualified module structure and the fully qualified names in the import
statements make it easy to get a feel for the organizational structure
of the program.

That way, on first reading I don't have to go through the whole module
to figure out what was contained in Utils when I see the phrase

import Utils

or even

import qualified Utils

at the top of the module.

-- Jeff

On Thu, Jun 11, 2009 at 2:55 PM, Jeff Heard wrote:
> Oh, and I don't disagree with that at all.  I just just have an
> aesthetic preference for multiply qualified library names.  Chalk it
> up to the fact that my partner's a librarian, so I'm used to putting
> things in categories, subcategories, and sub-sub-categories :-)
>
> -- Jeff
>
> On Thu, Jun 11, 2009 at 2:44 PM, Henning
> Thielemann wrote:
>>
>> On Thu, 11 Jun 2009, Jeff Heard wrote:
>>
>>> case in point: Hieroglyph.  What's it do?  import Hieroglyph.  Is
>>> there any clue by my function names which ones belong to a library
>>> called Hieroglyph?  No.  However, import
>>> Graphics.Rendering.Hieroglyph, and I see a function somewhere in the
>>> code called "arc" or "plane" or "circle", and I know it probably goes
>>> with the rendering package.
>>
>> http://www.haskell.org/haskellwiki/Import_modules_properly
>>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: ANNOUNCE: OpenGLRaw 1.0.0.0

2009-06-11 Thread Jeff Heard
Oh, and I don't disagree with that at all.  I just just have an
aesthetic preference for multiply qualified library names.  Chalk it
up to the fact that my partner's a librarian, so I'm used to putting
things in categories, subcategories, and sub-sub-categories :-)

-- Jeff

On Thu, Jun 11, 2009 at 2:44 PM, Henning
Thielemann wrote:
>
> On Thu, 11 Jun 2009, Jeff Heard wrote:
>
>> case in point: Hieroglyph.  What's it do?  import Hieroglyph.  Is
>> there any clue by my function names which ones belong to a library
>> called Hieroglyph?  No.  However, import
>> Graphics.Rendering.Hieroglyph, and I see a function somewhere in the
>> code called "arc" or "plane" or "circle", and I know it probably goes
>> with the rendering package.
>
> http://www.haskell.org/haskellwiki/Import_modules_properly
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: OpenGLRaw 1.0.0.0

2009-06-11 Thread Jeff Heard
nVidia and ATI drivers both support GL 3.0 on Linux, although you're
right that open source drivers don't.  I for one welcome this package
with open arms, since I'm mostly trying to implement a layer over
OpenGL anyway with Hieroglyph.  This'll help with the next revision of
that.  As for the package naming scheme, I don't mind it at all --
there are several different Graphics.Rendering packages with different
backends and several Graphics.UI packages, so I think it's been fairly
established.

Perhaps there should be a Hackage Ontology project, though, or we
should ask a librarian to look at Hackage and think about the problem
and suggest a proposed standard for people to follow, then suggest to
new library releasers under what set of QNames they ought to release
their libraries under. This is more or less standard practice for
large working groups on languages like XML and Java, and although it
could be seen as a debatable practice to many, I prefer something
descriptive of function in my module names, since package names so
rarely are.

case in point: Hieroglyph.  What's it do?  import Hieroglyph.  Is
there any clue by my function names which ones belong to a library
called Hieroglyph?  No.  However, import
Graphics.Rendering.Hieroglyph, and I see a function somewhere in the
code called "arc" or "plane" or "circle", and I know it probably goes
with the rendering package.

On Thu, Jun 11, 2009 at 2:14 PM, Felipe Lessa wrote:
> On Thu, Jun 11, 2009 at 07:55:23PM +0200, Krzysztof Skrzętnicki wrote:
>> On my machine I get:
>>
>> $ glxinfo | grep -i version
>> server glx version string: 1.4
>> client glx version string: 1.4
>> GLX version: 1.3
>> OpenGL version string: 3.0.0 NVIDIA 180.51
>> OpenGL shading language version string: 1.30 NVIDIA via Cg compiler
>>
>> So it doesn't appear to be true.
>
> So, open source Linux drivers won't have OpenGL 3.0 or 3.1 for at
> least some months :).  I don't know the internals of the graphics
> subsystem, but AFAIK the open source drivers use Mesa to
> implement the OpenGL frontend, and the current version 7.5rc3
> doesn't support it yet.
>
> FWIW, I'm using the Intel driver, version 2.7.1.
>
> --
> Felipe.
> ___
> 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] Weird and entirely random problem...

2009-06-10 Thread Jeff Heard
That works, yes...  thanks!

On Wed, Jun 10, 2009 at 12:58 PM, Neil Brown wrote:
> Hi,
>
> I'm presuming the problem with your result is that the " in the times map, and not in the store map (you weren't clear on the exact
> problem).
>
> I took a look at the code, here's my thoughts on why this occurs.  If you
> start by putting something in the cache with key "foo", an entry is created
> in the times map, say: fromList [(0, "foo")].  If you then get the item from
> the cache, you add another item to the times map, giving you: fromList [(0,
> "foo"), (1, "foo")].  Another get operation, and you'll have fromList [(0,
> "foo"), (1, "foo"), (2, "foo")].  If you now call free on the cache, it
> finds the value associated with the minimum key: "foo".  But it only deletes
> the minimum key in the times map, leaving: fromList [(1, "foo"), (2,
> "foo")].  Thus you can have entries in the times map without them being in
> the store.  put would clear them out (perhaps this was the self-correction
> you saw), but get adds one each item, and free only clears one.  So you
> either need to fix get, or free.
>
> Does that help, or was your question something else entirely? :-)
>
> BTW, IntMap.fromList . filter (f . snd) . IntMap.toList is more concisely
> (and efficiently) written as: IntMap.filter f
>
> Thanks,
>
> Neil.
>
> Jeff Heard wrote:
>>
>> The code that causes it is here:
>>
>> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5731#a5731
>>
>> This is the strangest thing.  Occasionally, using nothing but gets and
>> puts and frees on a non-full Cache will result in this:
>>
>> Cache {
>>      store = fromList
>>        [("(\"icons/addBookmark.png\",False)",TextureObject {textureID =
>> 4})
>>        ,("(\"icons/addCircle.png\",False)",TextureObject {textureID = 1})
>>        ,("(\"icons/addContent.png\",False)",TextureObject {textureID = 2})
>>        ,("(\"icons/addElsewhereLink.png\",False)",TextureObject
>> {textureID = 3})]
>>    , times = fromList
>>        [(61314,"(\"294.0\",AlignLeft,Nothing,WrapWholeWords,False,0.0,0.0)")
>>
>>  ,(61316,"(\"icons/addBookmark.png\",False)"),(61318,"(\"icons/addCircle.png\",False)")
>>
>>  ,(61320,"(\"icons/addContent.png\",False)"),(61322,"(\"icons/addElsewhereLink.png\",False)")]
>>
>>    , now = 61323
>>    , maxsize = 1024768000
>>    , size = 4
>>    , decimation = 0
>> }
>>
>>
>> Sometimes the problem is self-correcting.  Sometimes it is most
>> certainly not.  But I don't understand how my code can possibly allow
>> for this.
>> ___
>> 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] Weird and entirely random problem...

2009-06-10 Thread Jeff Heard
The code that causes it is here:

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=5731#a5731

This is the strangest thing.  Occasionally, using nothing but gets and
puts and frees on a non-full Cache will result in this:

Cache {
  store = fromList
[("(\"icons/addBookmark.png\",False)",TextureObject {textureID = 4})
,("(\"icons/addCircle.png\",False)",TextureObject {textureID = 1})
,("(\"icons/addContent.png\",False)",TextureObject {textureID = 2})
,("(\"icons/addElsewhereLink.png\",False)",TextureObject
{textureID = 3})]
, times = fromList
[(61314,"(\"294.0\",AlignLeft,Nothing,WrapWholeWords,False,0.0,0.0)")

,(61316,"(\"icons/addBookmark.png\",False)"),(61318,"(\"icons/addCircle.png\",False)")

,(61320,"(\"icons/addContent.png\",False)"),(61322,"(\"icons/addElsewhereLink.png\",False)")]

, now = 61323
, maxsize = 1024768000
, size = 4
, decimation = 0
}


Sometimes the problem is self-correcting.  Sometimes it is most
certainly not.  But I don't understand how my code can possibly allow
for this.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Change value of a variable

2009-06-07 Thread Jeff Heard
Sounds like a fold to me. Try looking at the doc of either foldl/r/l'
or mapAccum depending on what you want..  Then write a function for
one iteration that returns the value from that iteration combined with
the value from the last iteration

-- Jeff

On Sun, Jun 7, 2009 at 3:44 PM, ptrash wrote:
>
> What i am exactly to do is this:
>
> I have a list of pupils (type Pupil = (Name, Grade)) where I store the name
> of the pupil and which grade he has. No I want to get the number (and
> average number) of each grade. Something like 10 Pupils have a A (23%), 2
> Pupils have a B ( 4 %) etc
> --
> View this message in context: 
> http://www.nabble.com/Change-value-of-a-variable-tp23913404p23914558.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> ___
> 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] ANN: Hieroglyph-2.21 and buster, buster-gtk, and buster-network-2.0

2009-05-18 Thread Jeff Heard
Tons of relevant changes.  Almost too many to count...

Buster:
- Fixed performance and bugs in buster,
- split out buster, buster-network, and buster-gtk to make it easier
to only build components of the system.
- Added new functions in buster for selection and debugging.
- Added behaviours in App.Behaviours.PrintEvents for printing only
based on Group / Source / Name
- Changed name to "ename" (for 'event name')
- Added Association Lists to the buster EData type (EAssoc, EAssocL)
- future now requires the bus to be passed as the first argument

Hieroglyph
- OpenGL-backended interactive buster is now functional and high
performance if not complete.
- Added "Dots" primitive for showing lots of points for things like scatterplots
- Got rid of creating Attributes objects in favor of modifying common
attributes with combinators; the combinators themselves have the same
name as the old attributes, but they are mostly undocumented otherwise
because I haven't had time yet.  They are found in
Graphics.Rendering.Hieroglyph.Visual
- Got rid of greater/less detail combinator
- Text now takes Text.PrettyPrint.Doc instead of String as the str,
accepts Pango markup language, and uses full Layout functionality from
Pango, including UTF-8 display.  Added Pango markup combinators for
Text.PrettyPrint.Docs, mark, bold, bigger, italic, strikethrough,
subscript, superscript, smaller, monospace, underline, and span.  See
Pango documentation for their effect.
- Points and Rects are now sensible instances of Num, Fractional, and Ord
- Large scenes are now faster overall
- Added object naming combinator to support object selection

I will have more deails and examples on the blog soon...

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


[Haskell-cafe] Odd error message from ghc --make

2009-05-04 Thread Jeff Heard
I was just running a test that has compiled before just fine, and now
I'm getting this rather odd message:

EventBusTest.hs:20:9:
Couldn't match expected type `Bus a'
   against inferred type `buster-1.1:App.EventBus.Bus
[buster-1.1:App.EventBus.EData a1]'
  Expected type: MVar (Bus a)
  Inferred type: MVar
   (buster-1.1:App.EventBus.Bus
[buster-1.1:App.EventBus.EData a1])
In the expression: mk
In the first argument of `bus', namely `[mk]'


Any ideas?  I mean, it looks like it type checks to me.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] haxr build failure from cabal

2009-04-22 Thread Jeff Heard
haxr will no longer compile from cabal because of the dependency
marked HTTP > 1.0.  The current version of the library requires HTTP <
4000.0.0 as it stands.  Can it be updated real quick in hackage?

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


Re: [Haskell-cafe] Comments from two weeks of using Leksah

2009-04-21 Thread Jeff Heard
I'm using it on Ubuntu Linux 8.10 and on Mac OS X 10.5.x

-- Jeff

On Tue, Apr 21, 2009 at 11:12 AM, Peter Verswyvelen  wrote:
> I've seen it on the Hackaton and was really impressed.
> Were you using it on Windows? I haven't tried it yet since I heard it has
> major problems on Windows.
> On Tue, Apr 21, 2009 at 5:06 PM, Jeff Heard 
> wrote:
>>
>> I've been using the latest and greatest version of leksah for the last
>> couple of weeks and I wanted to give a short report on the things I've
>> found.
>>
>> First of all, it's crashed only once, and the error was an actual
>> segfault, so I'm not sure what went wrong there.  All in all, I like
>> the eyecandy and have left it on for everything I do, but I've noticed
>> that arrows have an extra space after them, no matter which arrow.
>> Also, the candy for =<< and >>= is the same.
>>
>> Only one "missing feature" that I've noticed: regex find and replace.
>> I'd like very much to be able to find and replace using regexes, as
>> this is pretty much why I keep coming back to vi and emacs.
>>
>> I really really like the modules pane which gives me quick views into
>> the doc of everything that's installed and the signatures.  I wonder,
>> though, could it be limited to the packages made available by the
>> dependencies in configuring the current working package?  That way, it
>> would be easy to tell whether a dependency was missing.
>>
>> I wonder if there's a way to setup the preferences so that
>> autocomplete can be accelerator based (like Ctrl+Space) instead of
>> constantly on, because I've noticed that occasionally I'll hit enter
>> at the end of a line and have it autocorrect my last identifier
>> incorrectly.  It'd be kind of neat if the error lines from the
>> continuous background build showed up highlighted in the editor in
>> some way, like they do in oh say Eclipse, but that's just a nice
>> feature.
>>
>> Only other feature i'd like to see added is the ability to have
>> multiple packages open at once, allow them to depend on each other,
>> and handle configuring, building, and installing each of them be a
>> one-step process.
>>
>> That's about it.  For large projects, very neat and very useful!  I like
>> it.
>>
>> -- Jeff
>> ___
>> 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] Comments from two weeks of using Leksah

2009-04-21 Thread Jeff Heard
I've been using the latest and greatest version of leksah for the last
couple of weeks and I wanted to give a short report on the things I've
found.

First of all, it's crashed only once, and the error was an actual
segfault, so I'm not sure what went wrong there.  All in all, I like
the eyecandy and have left it on for everything I do, but I've noticed
that arrows have an extra space after them, no matter which arrow.
Also, the candy for =<< and >>= is the same.

Only one "missing feature" that I've noticed: regex find and replace.
I'd like very much to be able to find and replace using regexes, as
this is pretty much why I keep coming back to vi and emacs.

I really really like the modules pane which gives me quick views into
the doc of everything that's installed and the signatures.  I wonder,
though, could it be limited to the packages made available by the
dependencies in configuring the current working package?  That way, it
would be easy to tell whether a dependency was missing.

I wonder if there's a way to setup the preferences so that
autocomplete can be accelerator based (like Ctrl+Space) instead of
constantly on, because I've noticed that occasionally I'll hit enter
at the end of a line and have it autocorrect my last identifier
incorrectly.  It'd be kind of neat if the error lines from the
continuous background build showed up highlighted in the editor in
some way, like they do in oh say Eclipse, but that's just a nice
feature.

Only other feature i'd like to see added is the ability to have
multiple packages open at once, allow them to depend on each other,
and handle configuring, building, and installing each of them be a
one-step process.

That's about it.  For large projects, very neat and very useful!  I like it.

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


[Haskell-cafe] Configuring cabal dependencies at install-time

2009-04-06 Thread Jeff Heard
Is there a way to do something like autoconf and configure
dependencies at install time?  Building buster, I keep adding
dependencies and I'd like to keep that down to a minimum without the
annoyance of littering Hackage with dozens of packages.  For instance,
today I developed an HTTP behaviour and that of course requires
network and http, which were previously not required.  I'm about to
put together a haxr XML-RPC behaviour as well, and that of course
would add that much more to the dependency list.  HaXml, haxr, and
haxr-th most likely.

so... any way to do that short of making a bunch of separate packages
with one or two modules apiece?  Otherwise I'm thinking of breaking
things up into buster, buster-ui, buster-network, buster-console, and
buster-graphics to start and adding more as I continue along.

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


Re: [Haskell-cafe] GHC accepts libraries compiled with Visual Studio?

2009-04-06 Thread Jeff Heard
I've noticed this before.  I in fact have really only tried FTGL with
VC compiled lib files...

On Mon, Apr 6, 2009 at 5:34 PM, Peter Verswyvelen  wrote:
> To my surprise GHC seems to accept .lib files (produced by e.g. Visual
> Studio on Windows) directly; I don't need to convert these to .a files using
> e.g. reimp
> That's really cool. Is this by design or did I miss something? The manual
> does not seem to mention this.
>
>
>
> ___
> 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] Link errors in Gtk2Hs are more general than I thought.

2009-04-04 Thread Jeff Heard
I tried to get yi to run on my Mac earlier and I get the following errors:

dyld: lazy symbol binding failed: Symbol not found:
_cairo_quartz_font_face_create_for_atsu_font_id
  Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
  Expected in: /opt/local/lib/libcairo.2.dylib

dyld: Symbol not found: _cairo_quartz_font_face_create_for_atsu_font_id
  Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
  Expected in: /opt/local/lib/libcairo.2.dylib

Trace/BPT trap

The commands I used to install gtk2hs (which gave me no errors were)

$ sudo port selfupdate
$ sudo port install gtk2 cairo librsvg libglade2 gtksourceview2 gtkglext
$ sudo port install gtk-chtheme gtk2-clearlooks && sudo port -k
install ghc gtk2hs hs-cabal
$ cabal install yi

Running OS X 10.5.6 (Leopard) on a MacBook 2.4 gHz Core 2 Duo

-- Jeff

-- Forwarded message --
From: Jeff Heard 
Date: Sat, Apr 4, 2009 at 2:01 PM
Subject: Leksah+Gtk2Hs link error on Mac OS X Leopard
To: Haskell Cafe 


I tried installing leskah on OS X using the x11 version of gtk2hs
(because I use gtkglext a lot in my work, and need it, therefore the
quartz build won't work for me)  I get these errors.  Is this leksah
specific or is this a more general problem with gtk2hs?

Linking dist/build/leksah/leksah ...
ld warning: atom sorting error for
_ghczm6zi10zi1_LibFFI_Czuffizutype_closure_tbl and
_ghczm6zi10zi1_LibFFI_Czuffizucif_closure_tbl in
/opt/local/lib/ghc-6.10.1/ghc-6.10.1/libHSghc-6.10.1.a(LibFFI.o)
ld warning: atom sorting error for
_ghczm6zi10zi1_LibFFI_Czuffizutype_closure_tbl and
_ghczm6zi10zi1_LibFFI_Czuffizucif_closure_tbl in
/opt/local/lib/ghc-6.10.1/ghc-6.10.1/libHSghc-6.10.1.a(LibFFI.o)

$ ~/.cabal/bin/leksah

dyld: lazy symbol binding failed: Symbol not found:
_cairo_quartz_font_face_create_for_atsu_font_id
 Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
 Expected in: /opt/local/lib/libcairo.2.dylib

dyld: Symbol not found: _cairo_quartz_font_face_create_for_atsu_font_id
 Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
 Expected in: /opt/local/lib/libcairo.2.dylib

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


[Haskell-cafe] Leksah+Gtk2Hs link error on Mac OS X Leopard

2009-04-04 Thread Jeff Heard
I tried installing leskah on OS X using the x11 version of gtk2hs
(because I use gtkglext a lot in my work, and need it, therefore the
quartz build won't work for me)  I get these errors.  Is this leksah
specific or is this a more general problem with gtk2hs?

Linking dist/build/leksah/leksah ...
ld warning: atom sorting error for
_ghczm6zi10zi1_LibFFI_Czuffizutype_closure_tbl and
_ghczm6zi10zi1_LibFFI_Czuffizucif_closure_tbl in
/opt/local/lib/ghc-6.10.1/ghc-6.10.1/libHSghc-6.10.1.a(LibFFI.o)
ld warning: atom sorting error for
_ghczm6zi10zi1_LibFFI_Czuffizutype_closure_tbl and
_ghczm6zi10zi1_LibFFI_Czuffizucif_closure_tbl in
/opt/local/lib/ghc-6.10.1/ghc-6.10.1/libHSghc-6.10.1.a(LibFFI.o)

$ ~/.cabal/bin/leksah

dyld: lazy symbol binding failed: Symbol not found:
_cairo_quartz_font_face_create_for_atsu_font_id
  Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
  Expected in: /opt/local/lib/libcairo.2.dylib

dyld: Symbol not found: _cairo_quartz_font_face_create_for_atsu_font_id
  Referenced from: /opt/local/lib/libpangocairo-1.0.0.dylib
  Expected in: /opt/local/lib/libcairo.2.dylib

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


[Haskell-cafe] First time I've gotten gtk2hs to install from ports on Mac OS X from scratch

2009-04-04 Thread Jeff Heard
The instructions in the leksah manuals seem to work for doing a
straight-up ports install of gtk2hs.  I've never managed to get it to
install without compiling manually, but this worked

$ sudo port install gtk2 cairo librsvg libglade2 gtksourceview2
gtkglext gtk-chtheme gtk2-clearlooks
$ sudo port -k install ghc gtk2hs hs-cabal

Unfortunately leksah itself won't link...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How to get glyph outline from ttf font.

2009-04-04 Thread Jeff Heard
Yes, the FTGL library, but it uses FTGL on the backend and not
freetype directly.  You might be able to get the flyph shapes from
Pango...

On Sat, Apr 4, 2009 at 12:59 PM, Dmitry V'yal  wrote:
>        Greetings. I'm trying to render some glyphs from ttf font to svg
> image using gtk2hs cairo binding. Since I can find nothing appropriate in
> gtk2hs API,  I decided to draw outlines with bezier curves myself. But how
> to get them out of font? As far as I know, freetype library is capable of
> extracting outlines, but is there any haskell binding for it which supports
> this functionality?
>
>        Here [1] one such lib was mentioned, but it wasn't availible online
> that time. Have situation changed today?
>
> Thanks in advance
>
> [1]
> http://www.nabble.com/Re%3A-Rendering-TTF-fonts-in-Haskell-and-OpenGL-p15635659.html
> ___
> 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] A fair number of updates to Buster since the other day - 0.99.5

2009-04-03 Thread Jeff Heard
http://vis.renci.org/jeff/2009/04/03/major-updates-to-buster/

Added several new widgets and several new behaviours related to file
reading and writing, exceptions, and the system/program environment.

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


Re: [Haskell-cafe] Announcement: Beta of Leksah IDE available

2009-04-03 Thread Jeff Heard
Jurgen...  I have one more question, or rather request... I'm running
under Ubuntu, and I get inconsistencies with packages that I build and
install via Leksah not showing up when I configure other packages that
depend on them.  Then I notice that you're using runhaskell Setup.lhs
... to configure build and install.   I wonder if you could change all
that from "runhaskell Setup.lhs" to "cabal" wherever you run it?
That would make things a lot more consistent overall, and probably
jive better with the way most people install packages.

-- Jeff

On Thu, Apr 2, 2009 at 8:27 AM, jutaro  wrote:
>
> Hi Simon,
> you quite nicely describe what leksah is doing already. Try to find find the
> source code for all installed packages by locating cabal files, parse the
> module sources via the Ghc API (actually not so much the API), using info
> from cabal files for this (which is a dark art). It extracts comments and
> locations. It's quite an ad hoc solution. On my machine it's 97% successful,
> but its a notorious support theme, because it depends so much on the
> environment.
> Jürgen
>
>
> Simon Marlow-7 wrote:
>>
>> David Waern wrote:
>>> 2009/4/2 Duncan Coutts :
 On Wed, 2009-04-01 at 22:13 +0200, David Waern wrote:
> 2009/4/1 jutaro :
>> I guess you mean the dialog which should help leksah to find sources
>> for installed packages. It needs this so you can go to all the
>> definitions
>> in the base packages ... This is very handy if it works. Look to the
>> manual
>> for details.
> Maybe could add support to Cabal for installing sources? Should be
> very useful to have in general.
 http://hackage.haskell.org/trac/hackage/ticket/364
>>>
>>> Jutaru, perhaps a nice Hackathon project? :-)
>>
>> I think there's some design work to do there.  See the discussion on the
>> GHC ticket: http://hackage.haskell.org/trac/ghc/ticket/2630.
>>
>> In short: just keeping the source code around isn't enough.  You need some
>> metadata in order to make sense of the source code - for example, you
>> can't
>> feed the source code to the GHC API without knowing which additional flags
>> need to be passed, and those come from the .cabal file.  Also you probably
>> want to stash the results of the 'cabal configure' step so that you can
>> get
>> a view of the source code that is consistent with the version(s?) you
>> compiled.  We need to think about about backwards and
>> forwards-compatibility of whatever metadata format is used.
>>
>> And then you'll need Cabal APIs to extract the metadata.  So we need to
>> think about what APIs make sense, and the best way to do that is to think
>> about what tool(s) you want to write and use that to drive the API design.
>>
>> Perhaps all this is going a bit too far.  Maybe we want to just stash the
>> source code and accept that there are some things that you just can't do
>> with it.  However, I imagine that pretty soon people will want to feed the
>> source code into the GHC API, and at that point we have to tackle the
>> build
>> metadata issues.
>>
>> Cheers,
>>       Simon
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Announcement%3A-Beta-of-Leksah-IDE-available-tp22816032p22846713.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> ___
> 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: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
Alright, updated it to extract EData from the Event type and make it
separate.  Basically, now all type signatures

Event a
Widget a
Behaviour a

should read

Event [EData a]
Widget [EData a]
Behaviour [EData a]

for backward compatibility.

On Thu, Apr 2, 2009 at 11:53 AM, Jeff Heard  wrote:
> On Thu, Apr 2, 2009 at 11:22 AM, Jules Bean  wrote:
>>
>> Maybe I wasn't clear, and probably I'm being dense. I understand what you've
>> done - I looked at the type declarations before commenting - but I don't
>> understand why.
>>
>> Why is it useful to be able to use basic types without locking down 'a'?
>>
>> Why is it useful to have a value of type "Event FooBar" which, in apparent
>> defiance of the FooBar parameter, actually contains a value of type Double?
>>
>> Jules
>>
>
> I'm assuming everyone won't want to start from scratch in creating all
> their widgets and behaviours.  A bus contains only events of type 'a',
> therefore all widgets and behaviours on that bus must use events of
> type 'a'.  It is possible to run multiple buses at the same time in
> the same program, and even possible to have them communicate between
> each other (forkIO-ing the buses and attaching some arbitrary
> behaviour that takes events from bus0, translates their types and then
> puts them on bus1), and so that way you could use multiple types, but
> I don't see a problem with a user having to read the documentation and
> understand that an Event of type a contains data that is a variant
> including type a.  How is it useful?  Consider the following widgets:
>
> commandLineArgsWidget :: Widget a
> commandLineArgsWidget = getArgs >>=
>    \args -> produce' "Environment"
>                      "CommandLineArgsWidget"
>                      "argv"
>                      Persistent
>                      [EStringL args]
>
> environmentWidget :: Widget a
> environmentWidget b = getEnvironment >>=
>    mapM_ (\(k,v) -> produce' "Environment" "EnvironmentWidget" k
> Persistent [EString v] b)
>
> progNameWidget :: Widget a
> progNameWidget b = getProgName >>=
>    \v -> produce' "Environment" "ProgramNameWidget" "ProgramName"
> Persistent [EString v] b
>
> As the library stands right now, I can take these widgets and put them
> in a module and include them as part of the Buster library, and they
> can be used pretty arbitrarily.  I can see being more semantically
> pure and changing Event a to contain data of type a instead of data of
> type [EData a], in which case the type signatures would look like
> this:
>
> progNameWidget :: WIdget [EData a]
>
> and so forth to be compatible with Bus [EData a], but I think that in
> the end so many widgets will reuse the EData type that it's just as
> well to make it part of the Event rather than force the user to be
> explicit about it every time.  But if I'm generally disagreed with
> about this, I can change it -- I'm pretty neutral about it, to be
> honest.
>
> -- Jeff
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
On Thu, Apr 2, 2009 at 11:22 AM, Jules Bean  wrote:
>
> Maybe I wasn't clear, and probably I'm being dense. I understand what you've
> done - I looked at the type declarations before commenting - but I don't
> understand why.
>
> Why is it useful to be able to use basic types without locking down 'a'?
>
> Why is it useful to have a value of type "Event FooBar" which, in apparent
> defiance of the FooBar parameter, actually contains a value of type Double?
>
> Jules
>

I'm assuming everyone won't want to start from scratch in creating all
their widgets and behaviours.  A bus contains only events of type 'a',
therefore all widgets and behaviours on that bus must use events of
type 'a'.  It is possible to run multiple buses at the same time in
the same program, and even possible to have them communicate between
each other (forkIO-ing the buses and attaching some arbitrary
behaviour that takes events from bus0, translates their types and then
puts them on bus1), and so that way you could use multiple types, but
I don't see a problem with a user having to read the documentation and
understand that an Event of type a contains data that is a variant
including type a.  How is it useful?  Consider the following widgets:

commandLineArgsWidget :: Widget a
commandLineArgsWidget = getArgs >>=
\args -> produce' "Environment"
  "CommandLineArgsWidget"
  "argv"
  Persistent
  [EStringL args]

environmentWidget :: Widget a
environmentWidget b = getEnvironment >>=
mapM_ (\(k,v) -> produce' "Environment" "EnvironmentWidget" k
Persistent [EString v] b)

progNameWidget :: Widget a
progNameWidget b = getProgName >>=
\v -> produce' "Environment" "ProgramNameWidget" "ProgramName"
Persistent [EString v] b

As the library stands right now, I can take these widgets and put them
in a module and include them as part of the Buster library, and they
can be used pretty arbitrarily.  I can see being more semantically
pure and changing Event a to contain data of type a instead of data of
type [EData a], in which case the type signatures would look like
this:

progNameWidget :: WIdget [EData a]

and so forth to be compatible with Bus [EData a], but I think that in
the end so many widgets will reuse the EData type that it's just as
well to make it part of the Event rather than force the user to be
explicit about it every time.  But if I'm generally disagreed with
about this, I can change it -- I'm pretty neutral about it, to be
honest.

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


Re: [Haskell-cafe] ANN: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
It is parametrically polymorphic in a.  And no, it's an arbitrary
decision, BUT...  it allows me and other users to define generally
useful behaviours and widgets to package with the library using the
basic types without locking down 'a'.  The EventData type looks like
this:

data Event a { ..., edata :: EData a, ... }

data EData a = EChar Char
  | EString String
  | EStringL [String]
  | EByteString ByteString
  | EByteStringL [ByteString]
  | EInt Int
  | EIntL [Int]
  | EDouble Double
  | EDoubleL [Double]
  | EBool Bool
  | EBoolL [Bool]
  | EOther a
  | EOtherL [a]

Now, given that arbitrary decision, I'd be willing to modify Event so
that it is parametric on 'a' without EData and include EData as an
"example" binding for 'a' if the user chooses to use it.  However, I
foresee most behaviours and widgets that are "generally useful" to be
dependent on this type, which is why I made it a basic part of Event.

-- Jeff

On Thu, Apr 2, 2009 at 11:05 AM, Jules Bean  wrote:
> Jeff Heard wrote:
>>
>> A last but somewhat minor thing is that the Event type is fairly
>> general, allowing for multiple data to be attached to a single event
>> and this data to be of many of the standard types (Int, String,
>> Double, ByteString, etc) as well as a user-defined type.  Of course,
>> such an event type could be defined for other FRP frameworks as well.
>
> That sounds the opposite of general. That sounds specific. (Int, String,
> Double, ByteString as well as a user-defined type).
>
> Can you explain the reason for the EDouble, EString (etc.) alternatives as
> opposed to making the event simply (parametrically) polymorphic in "a" ?
>
> Jules
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
Check links...  god.  http://vis.renci.org/jeff/buster  (can you tell
I was up till 3am last night?)

On Thu, Apr 2, 2009 at 10:05 AM, Jeff Heard  wrote:
> Yes,sorry.  vis, not vs. http://vis.renci.org/buster
>
> It is a bit like grapefruit's circuits, but where Grapefruit circuits
> describe the flow of events from place to place, Buster never does.
> Events exist for all behaviours, to be selected by name, group, or
> source.  The other major difference is the |~| or "beside" operator,
> which describes concurrent application of behaviours.
>
> A last but somewhat minor thing is that the Event type is fairly
> general, allowing for multiple data to be attached to a single event
> and this data to be of many of the standard types (Int, String,
> Double, ByteString, etc) as well as a user-defined type.  Of course,
> such an event type could be defined for other FRP frameworks as well.
>
> -- Jeff
>
> On Thu, Apr 2, 2009 at 9:53 AM, minh thu  wrote:
>> It's vis instead of vs:
>> http://vis.renci.org/jeff/buster/
>>
>> 2009/4/2 Peter Verswyvelen :
>>> Sounds vaguely like Grapefruit's circuits, but I could be very wrong...
>>> The link you provided seems to be broken?
>>> On Thu, Apr 2, 2009 at 3:05 PM, Jeff Heard 
>>> wrote:
>>>>
>>>> Read more about it on its webpage: http://vs.renci.org/jeff/buster
>>>>
>>>> Yes, it’s to solve a particular problem.  And yes, this is a rough
>>>> draft of an explanation of how it works.  I’ve not even really
>>>> solidified the vocabulary yet, but I have this module which couches a
>>>> large, abstract, interactive (both with the user and the system),
>>>> multicomponent application in terms of a bus, inputs, behaviours, and
>>>> events.
>>>>
>>>>    * Time is continuous and infinite.
>>>>    * An event is a static, discrete item associated with a particular
>>>> time.
>>>>    * The bus is the discrete view of event in time at an instant.
>>>>    * A widget is an IO action that assigns events to a particular
>>>> time based only upon sampling the outside world (other events and
>>>> behaviours are irrelevant to it).  e.g. a Gtk Button is a widget, a
>>>> readable network socket is an widget, the mouse is an widget, the
>>>> keyboard is an widget, a multitouch gesture engine is a widget.
>>>>    * A behaviour is a continuous item — it exists for the entire
>>>> program and for all times — which maps events on the bus to other
>>>> events on the bus.  It is an IO action as well — where widgets only
>>>> sample the outside world and are in a sense read only, behaviours
>>>> encapsulate reading and writing.
>>>> ___
>>>> 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] ANN: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
Yes,sorry.  vis, not vs. http://vis.renci.org/buster

It is a bit like grapefruit's circuits, but where Grapefruit circuits
describe the flow of events from place to place, Buster never does.
Events exist for all behaviours, to be selected by name, group, or
source.  The other major difference is the |~| or "beside" operator,
which describes concurrent application of behaviours.

A last but somewhat minor thing is that the Event type is fairly
general, allowing for multiple data to be attached to a single event
and this data to be of many of the standard types (Int, String,
Double, ByteString, etc) as well as a user-defined type.  Of course,
such an event type could be defined for other FRP frameworks as well.

-- Jeff

On Thu, Apr 2, 2009 at 9:53 AM, minh thu  wrote:
> It's vis instead of vs:
> http://vis.renci.org/jeff/buster/
>
> 2009/4/2 Peter Verswyvelen :
>> Sounds vaguely like Grapefruit's circuits, but I could be very wrong...
>> The link you provided seems to be broken?
>> On Thu, Apr 2, 2009 at 3:05 PM, Jeff Heard 
>> wrote:
>>>
>>> Read more about it on its webpage: http://vs.renci.org/jeff/buster
>>>
>>> Yes, it’s to solve a particular problem.  And yes, this is a rough
>>> draft of an explanation of how it works.  I’ve not even really
>>> solidified the vocabulary yet, but I have this module which couches a
>>> large, abstract, interactive (both with the user and the system),
>>> multicomponent application in terms of a bus, inputs, behaviours, and
>>> events.
>>>
>>>    * Time is continuous and infinite.
>>>    * An event is a static, discrete item associated with a particular
>>> time.
>>>    * The bus is the discrete view of event in time at an instant.
>>>    * A widget is an IO action that assigns events to a particular
>>> time based only upon sampling the outside world (other events and
>>> behaviours are irrelevant to it).  e.g. a Gtk Button is a widget, a
>>> readable network socket is an widget, the mouse is an widget, the
>>> keyboard is an widget, a multitouch gesture engine is a widget.
>>>    * A behaviour is a continuous item — it exists for the entire
>>> program and for all times — which maps events on the bus to other
>>> events on the bus.  It is an IO action as well — where widgets only
>>> sample the outside world and are in a sense read only, behaviours
>>> encapsulate reading and writing.
>>> ___
>>> 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


[Haskell-cafe] ANN: Buster 0.99.1, a library for application orchestration that is not FRP

2009-04-02 Thread Jeff Heard
Read more about it on its webpage: http://vs.renci.org/jeff/buster

Yes, it’s to solve a particular problem.  And yes, this is a rough
draft of an explanation of how it works.  I’ve not even really
solidified the vocabulary yet, but I have this module which couches a
large, abstract, interactive (both with the user and the system),
multicomponent application in terms of a bus, inputs, behaviours, and
events.

* Time is continuous and infinite.
* An event is a static, discrete item associated with a particular time.
* The bus is the discrete view of event in time at an instant.
* A widget is an IO action that assigns events to a particular
time based only upon sampling the outside world (other events and
behaviours are irrelevant to it).  e.g. a Gtk Button is a widget, a
readable network socket is an widget, the mouse is an widget, the
keyboard is an widget, a multitouch gesture engine is a widget.
* A behaviour is a continuous item — it exists for the entire
program and for all times — which maps events on the bus to other
events on the bus.  It is an IO action as well — where widgets only
sample the outside world and are in a sense read only, behaviours
encapsulate reading and writing.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Announcement: Beta of Leksah IDE available

2009-04-01 Thread Jeff Heard
I have one problem so far (and one segfault), but I like the IDE a
lot.  When I create a new package inside one of my current source
directories, it adds all the modules in that directory to *both* the
exposed and additional unexposed modules list, resulting in a net zero
modules in the package.  Is this a known problem?  Am I missing
something? I can't see how to add or remove modules from either of
these lists.

-- Jeff

On Wed, Apr 1, 2009 at 1:47 PM, Neil Mitchell  wrote:
> Hi
>
> Just tried it out, a few notes:
>
> * Very easy install - if only gtk2hs could be installed with cabal it
> would have been perfect.
>
> * Select the package you have installed. I didn't have a clue what to
> do here. Do you mean where I keep my Haskell programs? Or where GHC
> installs them? Can't you figure it out - its a confusing dialog which
> looks redundant.
>
> * Turning off "To Candy" was an essential first step for me! I can
> perhaps see <- as candy, but replacing $ with diamond is just
> confusing.
>
> * I opened a .cabal file, and expected to see the files in the source
> in a Window somewhere. I didn't.
>
> * The UI feels a little clunky, this could be the Gtk feel of the app
> (which in time I'd get over), or the choice of UI (the left-pane is
> quite large). Anything you could do to simplify/streamline the UI
> would be great.
>
> All in all looks quite neat. This is definitely going somewhere, and
> looks like it will be quite good by the end.
>
> Thanks
>
> Neil
>
>
>
> On Wed, Apr 1, 2009 at 6:17 PM, jutaro  wrote:
>>
>> Thanks Achim,
>> maybe you are right with Plugins. In the moment I'm more focused on adding
>> additional features. But wish the day, that so many want to add features
>> that a plugin system will be essential, we have it.
>>
>> With the GUI arrangement like splitting etc. leksah is quite flexible, but
>> it doesn't support drag and drop, so maybe I'm the only one who knows how to
>> use it. Well our capacity is limited, and no high priority on drag and drop
>> and such thinks.
>>
>> Jürgen
>>
>>
>>
>> Achim Schneider wrote:
>>>
>>> J__rgen Nicklisch-Franken  wrote:
>>>
 So I please the members of the community to pause for a moment and try
 out Leksah with a benevolent attitude.

>>> I did (the previous version, tbh), and couldn't find anything to
>>> seriously bicker about... a few problems regarding metadata generation,
>>> but that was dealt with as soon as I RTFM'ed. Ah, yes, you shouldn't be
>>> able to close the toolbar by pressing on one of its buttons that
>>> incidentally looks just like the one to close a file.
>>>
>>> Completition already rocks, the interface is nicely configurable
>>> (although I resorted to editing config and session files instead of
>>> using gui commands[1]), project management worked out fine (after I
>>> figured out that I had to manually configure leksah to pass --user to
>>> cabal), all in all it's an impressive piece of code that radiates later
>>> uberness instead of lacking features. Last, but not least, it's _fast_,
>>> _way_ more zappy than eclipse. As far as basic IDE features are
>>> concerned, it's also complete.
>>>
>>>
>>> The one thing that keeps me from switching to it, right now, is the
>>> editor not being a vi. While gtksourceview might be, in theory,
>>> a usable editor, my muscle memory tells me otherwise. It'd be like
>>> switching to autoconf for C development instead of just copying over my
>>> beloved OMakefile.
>>>
>>>
>>> Providing refactoring support would make it irresistible... maybe it's
>>> time to add a plugin layer, so that things like vacuum or a wrapper
>>> around hp2ps can register themselves with leksah, without giving up
>>> their identity as stand-alone projects. Plugability is the one feature
>>> that made eclipse big, and it won't hurt leksah, either.
>>>
>>>
>>> [1] I utterly failed to figure out how to do stuff[2], seriously.
>>>     Eclipse has a really nice drag&drop interface with visual feedback
>>>     to rearrange stuff, but I'm not the kind of guy who drops a program
>>>     for lacking such bells&whistles.
>>> [2] "Stuff" being rearranging divisions such that it's first split
>>>     horizontally, the console/type view etc. taking up the bottom part
>>>     and the upper part being split vertically into source view/module
>>>     browser. I just can't stand wrapped lines on the console. Somehow,
>>>     I think it should be the default arrangement.
>>>
>>> --
>>> (c) this sig last receiving data processing entity. Inspect headers
>>> for copyright history. All rights reserved. Copying, hiring, renting,
>>> performance and/or quoting of this signature prohibited.
>>>
>>>
>>> ___
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/Announcement%3A-Beta-of-Leksah-IDE-available-tp22816032p22831401.html
>> Sent f

[Haskell-cafe] Re: Haxr doesn't compile from cabal (HTTP > 4000 breaks it)

2009-03-28 Thread Jeff Heard
haxr's also based on a fairly old version of HaXml.  I'm not sure what
the performance of the library is, other than it seems acceptable, but
moving to ByteStrings all the way through might do some good.

On Fri, Mar 27, 2009 at 9:13 PM, Henning Thielemann
 wrote:
>
> Most breakage caused by new HTTP package is due to the renaming from
> Response to Response_String and Request to Request_String. I think it was
> not a good idea to do that. There could have well be two types named
> Response from different modules, one with a type parameter and the other one
> without. Or the parametrized variant could have be named ResponseGeneric or
> so. That would have allowed packages to work both with version 3001 and
> 4000.
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
Don, good to know; I hadn't checked for packaging tools outside of
cabal in Hackage :)

2009/3/20 Don Stewart :
> dons:
>> Good to hear you're shipping graphical Haskell apps, Jefferson. Well done.
>>
>> We do have tools for packaging for various distros:
>>
>>     * Mac OSX:
>>     http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mkbndl
>>
>>     * Windows
>>     http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bamse
>>
>>     * Linux
>>     
>> http://hackage.haskell.org/packages/archive/pkg-list.html#cat:distribution
>>         * cabal-rpm
>>         * cabal2arch
>>         * cabalmdvrpm
>>         * hackport
>>         * hslackbuilder
>>
>
> And also for .deb bundles.
>
>    http://haskell.org/haskellwiki/Creating_Debian_packages_from_Cabal_package
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
As this continues to build, I guess the issue for me, and I'm willing
to help with it, is trying to figure out how to redistribute programs
written with gtk2hs.  on Windows, people can just install the gtk2hs
libraries via the installer -- although this does bork a little
because it assumes you have a haskell compiler on the machine.
Ignoring the errors, however, works.  I don't see a similar situation
on Mac OS.

If I wanted to package an application, which I often do, because
firefighters, police officers, and emergency managers (my research
currently targets these people, and we're actually beginning to really
deploy our apps) don't have the time nor inclination to compile
programs on their machines, I can basically just hope they're running
windows. It'd be nice if there was a binary "redistributable" on
windows that doesn't generate errors because of no haskell compiler
installed and a similar package on OS X that includes the X11 Gtk
binaries and precompiled Gtk2Hs binaries.

I guess I just don't know yet how to package things for OS X or find
everything I'd need to find to build a redistributable image in the
first place.  I haven't yet drunk the coolade on the whole Mac
development process, having sidestepped the normal process by being a
Haskell developer.  I'm sure they have standard procedures for finding
and packaging libraries.

-- Jeff

On Fri, Mar 20, 2009 at 3:06 PM, Ross Mellgren  wrote:
> Ah, true. Sorry, my mistake -- I forgot that wasn't supported with the
> framework version.
>
> -Ross
>
> On Mar 20, 2009, at 2:56 PM, Jeff Heard wrote:
>
>> That one doesn't work with OpenGL, however and won't in the forseeable
>> future.    Incidentally, just now doing a ports install gtk2hs gives
>> me the following error on my brand new MacBook:
>>
>> $ sudo port install gtk2hs
>>
>> ... stuff happens normally ... then:
>>
>> opt/local/bin/ghc +RTS -RTS -c tools/hierarchyGen/TypeGen.hs -o
>> tools/hierarchyGen/TypeGen.o -O -itools/hierarchyGen -package-conf
>> package.conf.inplace -hide-all-packages -package base
>> package.conf.inplace: openBinaryFile: does not exist (No such file or
>> directory)
>> /opt/local/bin/ghc +RTS -RTS -c tools/callbackGen/HookGenerator.hs -o
>> tools/callbackGen/HookGenerator.o -O -I. -itools/callbackGen
>> -package-conf package.conf.inplace -hide-all-packages -package base
>> package.conf.inplace: openBinaryFile: does not exist (No such file or
>> directory)
>> rm -rf glib/System/Glib.o glib/System/Glib_split/; mkdir -p
>> glib/System/Glib_split
>> /opt/local/bin/ghc +RTS -RTS -split-objs -c glib/System/Glib.hs -o
>> glib/System/Glib.o -O -fffi -iglib -package-conf package.conf.inplace
>> -hide-all-packages -ignore-package glib -package base -package-name
>> glib-0.9.13 '-#include' -I/opt/local/include/glib-2.0
>> -I/opt/local/lib/glib-2.0/include -I/opt/local/include
>>
>> on the commandline:
>>   Warning: -fffi is deprecated: use -XForeignFunctionInterface or
>> pragma {-# LANGUAGE ForeignFunctionInterface#-} instead
>> package.conf.inplace: openBinaryFile: does not exist (No such file or
>> directory)
>> make[1]: *** [glib/System/Glib.o] Error 1
>> make: *** [all] Error 2
>>
>>
>> On Fri, Mar 20, 2009 at 2:27 PM, Ross Mellgren 
>> wrote:
>>>
>>> While there is not a .dmg for Gtk2Hs, you can use a .dmg installed GHC
>>> with
>>> a .dmg installed Gtk, and then build gtk2hs straight on top of that,
>>> without
>>> having to deal with the dual-GHC macports mess..
>>>
>>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework
>>>
>>> -Ross
>>>
>>> On Mar 20, 2009, at 2:10 PM, Jeff Heard wrote:
>>>
>>>> cabal-install works for me.  The one thing that would be REALLY REALLY
>>>> nice (and I'm cc-ing Duncan on this) is a .dmg for Gtk2Hs on Mac OS X.
>>>> There exists a ports build for it, but it won't use the GHC that is
>>>> installed via .dmg to build it - it insists instead on installing ghc
>>>> again via ports, which I find both odd and undesirable.  It really
>>>> comes down to the fact that gtk2hs is the only thing in the
>>>> haskellverse that requires ports to get compiled in an intuitive way.
>>>>
>>>> On Fri, Mar 20, 2009 at 1:51 PM, Don Stewart  wrote:
>>>>>
>>>>> tom.davie:
>>>>>>
>>>>>> On 20 Mar 2009, at 18:46, Don Stewart wrote:
>>>>>>
>>>>>>> tom.davie:
>>>>>>

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
Ah wait...  I can't read.  section 4.1.2 explains the macports
installation.  I'll try that.

On Fri, Mar 20, 2009 at 2:56 PM, Jeff Heard  wrote:
> That one doesn't work with OpenGL, however and won't in the forseeable
> future.    Incidentally, just now doing a ports install gtk2hs gives
> me the following error on my brand new MacBook:
>
> $ sudo port install gtk2hs
>
> ... stuff happens normally ... then:
>
> opt/local/bin/ghc +RTS -RTS -c tools/hierarchyGen/TypeGen.hs -o
> tools/hierarchyGen/TypeGen.o -O -itools/hierarchyGen -package-conf
> package.conf.inplace -hide-all-packages -package base
> package.conf.inplace: openBinaryFile: does not exist (No such file or 
> directory)
> /opt/local/bin/ghc +RTS -RTS -c tools/callbackGen/HookGenerator.hs -o
> tools/callbackGen/HookGenerator.o -O -I. -itools/callbackGen
> -package-conf package.conf.inplace -hide-all-packages -package base
> package.conf.inplace: openBinaryFile: does not exist (No such file or 
> directory)
> rm -rf glib/System/Glib.o glib/System/Glib_split/; mkdir -p
> glib/System/Glib_split
> /opt/local/bin/ghc +RTS -RTS -split-objs -c glib/System/Glib.hs -o
> glib/System/Glib.o -O -fffi -iglib -package-conf package.conf.inplace
> -hide-all-packages -ignore-package glib -package base -package-name
> glib-0.9.13 '-#include' -I/opt/local/include/glib-2.0
> -I/opt/local/lib/glib-2.0/include -I/opt/local/include
>
> on the commandline:
>    Warning: -fffi is deprecated: use -XForeignFunctionInterface or
> pragma {-# LANGUAGE ForeignFunctionInterface#-} instead
> package.conf.inplace: openBinaryFile: does not exist (No such file or 
> directory)
> make[1]: *** [glib/System/Glib.o] Error 1
> make: *** [all] Error 2
>
>
> On Fri, Mar 20, 2009 at 2:27 PM, Ross Mellgren  wrote:
>> While there is not a .dmg for Gtk2Hs, you can use a .dmg installed GHC with
>> a .dmg installed Gtk, and then build gtk2hs straight on top of that, without
>> having to deal with the dual-GHC macports mess..
>>
>> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework
>>
>> -Ross
>>
>> On Mar 20, 2009, at 2:10 PM, Jeff Heard wrote:
>>
>>> cabal-install works for me.  The one thing that would be REALLY REALLY
>>> nice (and I'm cc-ing Duncan on this) is a .dmg for Gtk2Hs on Mac OS X.
>>> There exists a ports build for it, but it won't use the GHC that is
>>> installed via .dmg to build it - it insists instead on installing ghc
>>> again via ports, which I find both odd and undesirable.  It really
>>> comes down to the fact that gtk2hs is the only thing in the
>>> haskellverse that requires ports to get compiled in an intuitive way.
>>>
>>> On Fri, Mar 20, 2009 at 1:51 PM, Don Stewart  wrote:
>>>>
>>>> tom.davie:
>>>>>
>>>>> On 20 Mar 2009, at 18:46, Don Stewart wrote:
>>>>>
>>>>>> tom.davie:
>>>>>>>
>>>>>>> On 20 Mar 2009, at 18:08, Don Stewart wrote:
>>>>>>>
>>>>>>>> tom.davie:
>>>>>>>>>
>>>>>>>>> Other than chose the graphics card carefully, an iMac will do you
>>>>>>>>> very well.
>>>>>>>>>
>>>>>>>>> Hope that helps.
>>>>>>>>
>>>>>>>> This is very useful.
>>>>>>>>
>>>>>>>> Could the Mac users add information (and screenshots?) to the OSX
>>>>>>>> wiki
>>>>>>>> page,
>>>>>>>>
>>>>>>>>  http://haskell.org/haskellwiki/OSX
>>>>>>>
>>>>>>> I'm not really sure there's much to add.  It mostly just works™.
>>>>>>>
>>>>>>> Is there something that can be extracted from this discussion to add
>>>>>>> to
>>>>>>> it?
>>>>>>
>>>>>> Imagine you're new to Haskell, or the Mac. What do you need to know to
>>>>>> get started developing new Haskell software? Is that information on
>>>>>> the
>>>>>> page?
>>>>>
>>>>> Thankfully, yes, all you need to know are either (a) go to haskell.org
>>>>> and download it, or (b) download macports, and port install ghc... Now
>>>>> you've got a Haskell environment like any other.
>>>>>
>>>>> I guess I could add a chunk of text about good editors, but I'm not sure
>>>>> if that's suitable, is it?
>>>>
>>>> Yes, anything that is relevant to the development experience on this
>>>> platform. Remember: it is more than just getting ghc. How do they get
>>>> hold of new libraries and apps? Is cabal-install available?
>>>> ___
>>>> 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] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
That one doesn't work with OpenGL, however and won't in the forseeable
future.Incidentally, just now doing a ports install gtk2hs gives
me the following error on my brand new MacBook:

$ sudo port install gtk2hs

... stuff happens normally ... then:

opt/local/bin/ghc +RTS -RTS -c tools/hierarchyGen/TypeGen.hs -o
tools/hierarchyGen/TypeGen.o -O -itools/hierarchyGen -package-conf
package.conf.inplace -hide-all-packages -package base
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
/opt/local/bin/ghc +RTS -RTS -c tools/callbackGen/HookGenerator.hs -o
tools/callbackGen/HookGenerator.o -O -I. -itools/callbackGen
-package-conf package.conf.inplace -hide-all-packages -package base
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
rm -rf glib/System/Glib.o glib/System/Glib_split/; mkdir -p
glib/System/Glib_split
/opt/local/bin/ghc +RTS -RTS -split-objs -c glib/System/Glib.hs -o
glib/System/Glib.o -O -fffi -iglib -package-conf package.conf.inplace
-hide-all-packages -ignore-package glib -package base -package-name
glib-0.9.13 '-#include' -I/opt/local/include/glib-2.0
-I/opt/local/lib/glib-2.0/include -I/opt/local/include

on the commandline:
Warning: -fffi is deprecated: use -XForeignFunctionInterface or
pragma {-# LANGUAGE ForeignFunctionInterface#-} instead
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
make[1]: *** [glib/System/Glib.o] Error 1
make: *** [all] Error 2


On Fri, Mar 20, 2009 at 2:27 PM, Ross Mellgren  wrote:
> While there is not a .dmg for Gtk2Hs, you can use a .dmg installed GHC with
> a .dmg installed Gtk, and then build gtk2hs straight on top of that, without
> having to deal with the dual-GHC macports mess..
>
> http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework
>
> -Ross
>
> On Mar 20, 2009, at 2:10 PM, Jeff Heard wrote:
>
>> cabal-install works for me.  The one thing that would be REALLY REALLY
>> nice (and I'm cc-ing Duncan on this) is a .dmg for Gtk2Hs on Mac OS X.
>> There exists a ports build for it, but it won't use the GHC that is
>> installed via .dmg to build it - it insists instead on installing ghc
>> again via ports, which I find both odd and undesirable.  It really
>> comes down to the fact that gtk2hs is the only thing in the
>> haskellverse that requires ports to get compiled in an intuitive way.
>>
>> On Fri, Mar 20, 2009 at 1:51 PM, Don Stewart  wrote:
>>>
>>> tom.davie:
>>>>
>>>> On 20 Mar 2009, at 18:46, Don Stewart wrote:
>>>>
>>>>> tom.davie:
>>>>>>
>>>>>> On 20 Mar 2009, at 18:08, Don Stewart wrote:
>>>>>>
>>>>>>> tom.davie:
>>>>>>>>
>>>>>>>> Other than chose the graphics card carefully, an iMac will do you
>>>>>>>> very well.
>>>>>>>>
>>>>>>>> Hope that helps.
>>>>>>>
>>>>>>> This is very useful.
>>>>>>>
>>>>>>> Could the Mac users add information (and screenshots?) to the OSX
>>>>>>> wiki
>>>>>>> page,
>>>>>>>
>>>>>>>  http://haskell.org/haskellwiki/OSX
>>>>>>
>>>>>> I'm not really sure there's much to add.  It mostly just works™.
>>>>>>
>>>>>> Is there something that can be extracted from this discussion to add
>>>>>> to
>>>>>> it?
>>>>>
>>>>> Imagine you're new to Haskell, or the Mac. What do you need to know to
>>>>> get started developing new Haskell software? Is that information on
>>>>> the
>>>>> page?
>>>>
>>>> Thankfully, yes, all you need to know are either (a) go to haskell.org
>>>> and download it, or (b) download macports, and port install ghc... Now
>>>> you've got a Haskell environment like any other.
>>>>
>>>> I guess I could add a chunk of text about good editors, but I'm not sure
>>>> if that's suitable, is it?
>>>
>>> Yes, anything that is relevant to the development experience on this
>>> platform. Remember: it is more than just getting ghc. How do they get
>>> hold of new libraries and apps? Is cabal-install available?
>>> ___
>>> 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] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
cabal-install works for me.  The one thing that would be REALLY REALLY
nice (and I'm cc-ing Duncan on this) is a .dmg for Gtk2Hs on Mac OS X.
 There exists a ports build for it, but it won't use the GHC that is
installed via .dmg to build it - it insists instead on installing ghc
again via ports, which I find both odd and undesirable.  It really
comes down to the fact that gtk2hs is the only thing in the
haskellverse that requires ports to get compiled in an intuitive way.

On Fri, Mar 20, 2009 at 1:51 PM, Don Stewart  wrote:
> tom.davie:
>>
>> On 20 Mar 2009, at 18:46, Don Stewart wrote:
>>
>>> tom.davie:

 On 20 Mar 2009, at 18:08, Don Stewart wrote:

> tom.davie:
>>
>> Other than chose the graphics card carefully, an iMac will do you
>> very well.
>>
>> Hope that helps.
>
> This is very useful.
>
> Could the Mac users add information (and screenshots?) to the OSX
> wiki
> page,
>
>   http://haskell.org/haskellwiki/OSX

 I'm not really sure there's much to add.  It mostly just works™.

 Is there something that can be extracted from this discussion to add
 to
 it?
>>>
>>> Imagine you're new to Haskell, or the Mac. What do you need to know to
>>> get started developing new Haskell software? Is that information on
>>> the
>>> page?
>>
>> Thankfully, yes, all you need to know are either (a) go to haskell.org
>> and download it, or (b) download macports, and port install ghc... Now
>> you've got a Haskell environment like any other.
>>
>> I guess I could add a chunk of text about good editors, but I'm not sure
>> if that's suitable, is it?
>
> Yes, anything that is relevant to the development experience on this
> platform. Remember: it is more than just getting ghc. How do they get
> hold of new libraries and apps? Is cabal-install available?
> ___
> 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] Ease of Haskell development on OS X?

2009-03-20 Thread Jeff Heard
Critiano, despite that thread, yes, there is decent support for
Haskell on Mac OS X.  The main problem is that the ports system to
install Gtk2Hs isn't terribly great, as in it mostly doesn't work, but
if you're willing to get Gtk2Hs compiled on your own, then after that,
I've found it to be nearly the same. I'm an OpenGL developer myself.
I develop and cross-port all my appilcations to the Mac, because I use
a Mac at home.  I don't know about PowerPC, but if you're getting a
new Mac, it should be fine.

So... if you're using GLUT or GLFW as your OpenGL windowing system
backend, you should have no trouble at all.  If you're using Gtk2Hs,
just be aware that it'll take some manual tweaking, but that it can be
done.

-- Jeff

On Fri, Mar 20, 2009 at 12:00 PM, Cristiano Paris
 wrote:
> 2009/3/20 Mark Spezzano :
>> Hi,
>>
>> I’ve been thinking of changing over to an iMac from my crappy old PC running
>> Windows Vista.
>>
>> Question: Does the iMac have good support for Haskell development?
>>
>> Question: What environment setups do people commonly use (e.g. Eclipse Xcode
>> etc)?
>>
>> Question: Are there any caveats I should be aware of before changing systems
>> (i.e. unpleasant surprises).
>>
>> I want to be able to use the machine for Haskell OpenGL programming.
>
> Take a look at this (rather long) thread on Haskell-cafè:
>
> http://www.haskell.org/pipermail/haskell-cafe/2009-February/056545.html
>
> Cristiano
> ___
> 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] Text bug in Hieroglyph 1.2

2009-03-19 Thread Jeff Heard
Bug fixed.  Package uploaded to Hackage.

2009/3/19 Danny Chan :
> Since I haven't found out how to report bugs for this package, I am posting
> this here.
>
> Changing the color of Text elements in a Hieroglyph image like this:
>
> text {attributes = plain {strokeRGBA = opaque blue}}
>
> does not work correctly. Instead, the color used for the text is the one of
> the previously drawn element. With the little knowledge I have about cairo,
> it seems that the bug is in the renderPrimitive function in Cairo.hs where
> the order of Cairo.setSourceRGBA and Cairo.showText is wrong. Something like
> this seems to work:
>
> renderPrimitive _ s0 (Text str (Point ox oy) state) = do
>     applyAttributeDelta s0 state
>     Cairo.moveTo ox oy
>     let (sr,sg,sb,sa) = colourToTuple . strokeRGBA $ state
>     when (outlined state) $
>     Cairo.setSourceRGBA sr sg sb sa
>     Cairo.showText str
>     when (clipped state) $ Cairo.clip
>     return state
>
> By the way, for the complete newbie that I am, is there a standard way to
> report bugs for a package from Hackage?
>
> Danny
>
>
> ___
> 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] Text bug in Hieroglyph 1.2

2009-03-19 Thread Jeff Heard
Danny, I'll fix this today and repost and add a maintainer email
address in the cabal package while I'm at it.  Thanks!

2009/3/19 Danny Chan :
> Since I haven't found out how to report bugs for this package, I am posting
> this here.
>
> Changing the color of Text elements in a Hieroglyph image like this:
>
> text {attributes = plain {strokeRGBA = opaque blue}}
>
> does not work correctly. Instead, the color used for the text is the one of
> the previously drawn element. With the little knowledge I have about cairo,
> it seems that the bug is in the renderPrimitive function in Cairo.hs where
> the order of Cairo.setSourceRGBA and Cairo.showText is wrong. Something like
> this seems to work:
>
> renderPrimitive _ s0 (Text str (Point ox oy) state) = do
>     applyAttributeDelta s0 state
>     Cairo.moveTo ox oy
>     let (sr,sg,sb,sa) = colourToTuple . strokeRGBA $ state
>     when (outlined state) $
>     Cairo.setSourceRGBA sr sg sb sa
>     Cairo.showText str
>     when (clipped state) $ Cairo.clip
>     return state
>
> By the way, for the complete newbie that I am, is there a standard way to
> report bugs for a package from Hackage?
>
> Danny
>
>
> ___
> 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] Text bug in Hieroglyph 1.2

2009-03-19 Thread Jeff Heard
No?  Well, that's a bug in and of itself.

On Thu, Mar 19, 2009 at 9:50 AM, Brent Yorgey  wrote:
> On Thu, Mar 19, 2009 at 08:58:08AM +, Danny Chan wrote:
>>
>> By the way, for the complete newbie that I am, is there a standard way to 
>> report bugs for a package from Hackage?
>
> Most packages on Hackage have a 'Maintainer' field providing an email
> address to which you can send bug reports.  Although I see that in
> this particular case, Jeff Heard did not list an email address in the
> Maintainer field for Hieroglyph.
>
> -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] Visualising the Hierarchical Namespace

2009-03-16 Thread Jeff Heard
That's why I just asked on IRC for them :-) Also wrote most of a
Hieroglyph script last night to replace the graph of daily uploads on
Hackage.  Will send it out tonight or tomorrow.

On Mon, Mar 16, 2009 at 11:17 AM, Don Stewart  wrote:
> My secret hope is that Jeff will take the .dot files and doing
> something very cool with them
>
> jefferson.r.heard:
>> Very impressive looking, Don.
>>
>> -- Jeff
>>
>> On Mon, Mar 16, 2009 at 11:14 AM, Don Stewart  wrote:
>> > Oh, barely any time (maybe 30-60 seconds). It's "just" a 10k node graph 
>> > with a 50k edges. :)
>> >
>> > vanenkj:
>> >> How long did the haskell universe graphs take to render?
>> >>
>> >> On Mon, Mar 16, 2009 at 11:05 AM, Don Stewart  wrote:
>> >>
>> >>     I've just finished a post (and quick tool) for graphing the complete
>> >>     module namespace of Haskell, taken from the core libraries and all of
>> >>     Hackage.
>> >>
>> >>     It's quite large:
>> >>
>> >>        
>> >> http://donsbot.wordpress.com/2009/03/16/visualising-the-haskell-universe
>> >>     /
>> >>     ___
>> >>     Haskell-Cafe mailing list
>> >>     Haskell-Cafe@haskell.org
>> >>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> /jve
>> > ___
>> > 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] Visualising the Hierarchical Namespace

2009-03-16 Thread Jeff Heard
Very impressive looking, Don.

-- Jeff

On Mon, Mar 16, 2009 at 11:14 AM, Don Stewart  wrote:
> Oh, barely any time (maybe 30-60 seconds). It's "just" a 10k node graph with 
> a 50k edges. :)
>
> vanenkj:
>> How long did the haskell universe graphs take to render?
>>
>> On Mon, Mar 16, 2009 at 11:05 AM, Don Stewart  wrote:
>>
>>     I've just finished a post (and quick tool) for graphing the complete
>>     module namespace of Haskell, taken from the core libraries and all of
>>     Hackage.
>>
>>     It's quite large:
>>
>>        
>> http://donsbot.wordpress.com/2009/03/16/visualising-the-haskell-universe
>>     /
>>     ___
>>     Haskell-Cafe mailing list
>>     Haskell-Cafe@haskell.org
>>     http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>>
>>
>> --
>> /jve
> ___
> 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] Abuse of the monad [was: monadic logo]

2009-03-12 Thread Jeff Heard
Oh, I know it's not specific to parsec, it just seems like parsec's
used enough and well understood enough that it would make a good
tutorial.

On Thu, Mar 12, 2009 at 11:36 AM, Martijn van Steenbergen
 wrote:
> Jeff Heard wrote:
>>
>> Come to think of it, I've never seen an applicative tutorial of
>> Parsec, only a monadic one.  Does such a beast exist
>
> Here's something that comes close:
>
> http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-044.pdf
>
> It's not specific to Parsec; instead, a parser type is defined on the fly,
> based on Philip Wadler's list of successes. The applicative and monadic
> approaches are clearly separated.
>
> Martijn.
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Abuse of the monad [was: monadic logo]

2009-03-12 Thread Jeff Heard
Come to think of it, I've never seen an applicative tutorial of
Parsec, only a monadic one.  Does such a beast exist, and if so, maybe
we could merge the two together, work the same example in both, and
thus help the programmer make the shift from monadic to applicative,
from order of parsing to describing the grammar.

-- Jeff

2009/3/12 Conal Elliott :
> Thank you Bob!  I'll throw in another 2 cents:
>
> Yes, *one* aspect of Haskell is that it's a power tool for imperative
> programming -- a clever way to keep plugging away at the old sequential von
> Neumann paradigm.  C.
>
> I'd rather we strongly encourage Haskell-newbies toward shifting out of the
> imperative paradigm to thinking and programming *functionally*.  It's a big
> shift, to make, and imperative-Haskell is a relatively easy substitute.
>
>    - Conal
>
> On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie  wrote:
>>
>> On 12 Mar 2009, at 15:16, Andrew Wagner wrote:
>>
>>> Can you expand on this a bit? I'm curious why you think this.
>>
>> For two reasons:
>>
>> Firstly, I often find that people use the Monadic interface when one of
>> the less powerful ones is both powerful enough and more convenient, parsec
>> is a wonderful example of this.  When the applicative instance is used
>> instead of the monadic one, programs rapidly become more readable, because
>> they stop describing the order in which things should be parsed, and start
>> describing the grammar of the language being parsed instead.
>>
>> Secondly, It seems relatively common now for beginners to be told about
>> the IO monad, and start writing imperative code in it, and thinking that
>> this is what Haskell programming is.  I have no problem with people writing
>> imperative code in Haskell, it's an excellent imperative language.  However,
>> beginners seeing this, and picking it up is usually counter productive –
>> they never learn how to write things in a functional way, and miss out on
>> most of the benefits of doing so.
>>
>> Hope that clarifies what I meant :)
>>
>> Bob___
>> 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


[Haskell-cafe] Haxr doesn't compile from cabal (HTTP > 4000 breaks it)

2009-03-12 Thread Jeff Heard
The haxr cabal library dependencies seem to be off.  I wonder, since
haxr would benefit highly from the HTTP 4k series of performance
improvements, is it trivial to make it compatible with the latest
library?

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


[Haskell-cafe] New version of Hieroglyph released: Hieroglyph 1.1 is on hackage

2009-02-24 Thread Jeff Heard
For those of you who don't read Reddit:

Changes are minor right now.  The main thing is that I'm now using
Russell O'Connor's excellent Data.Colour library.  The only other
changes were to make H. compile with Gtk2Hs 0.10.x and to make it a
bit easier to integrate Gtk2Hs guis with Hieroglyph and vice versa.
Enjoy!

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


Re: [Haskell-cafe] Showing >100% CPU usage of parallel code

2009-02-21 Thread Jeff Heard
Jim, I'm actually not sure that time will report greater than 100% cpu
on ubuntu hardy. (really not sure, and don't have it available right
this moment to check).  I would however try making a computation that
will take a little longer and use the system monitor or /proc to look
at your CPU usage rather than time.  I've had good luck with GHC 6.8
using > 100% cpu, so I assume 6.10 will work much better.

On Sat, Feb 21, 2009 at 10:32 AM, Bulat Ziganshin
 wrote:
> Hello Jim,
>
> Saturday, February 21, 2009, 6:17:54 PM, you wrote:
>
>> main = a `par` b `par` c `pseq` print (a + b + c)
>
> two things:
> 1) that are grouping order? may be,
> a `par` (b `par` (c `pseq` print (a + b + c))) ?
>
> 2) i recommend you to use 2 *same* computations.
> otherwise, it's easily possible that one of them needs much more time
> that the rest
>
>
>> where
>> a = ack 3 10
>> b = fac 42
>> c = fib 34
>
>> fac 0 = 1
>> fac n = n * fac (n-1)
>
>> ack 0 n = n+1
>> ack m 0 = ack (m-1) 1
>> ack m n = ack (m-1) (ack m (n-1))
>
>> fib 0 = 0
>> fib 1 = 1
>> fib n = fib (n-1) + fib (n-2)
>> 
>
>> Thanks,
>
>> Jim
>
>
>
>
>
> --
> Best regards,
>  Bulatmailto:bulat.zigans...@gmail.com
>
> ___
> 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] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-18 Thread Jeff Heard
When he gives you the code, could you let me know?  I would really
love to bind Open Scene Graph, but it's entirely C++ and that makes
for a lot more difficult coding to say the least.

On Wed, Feb 18, 2009 at 4:17 AM, Wolfgang Jeltsch
 wrote:
> Am Dienstag, 17. Februar 2009 19:36 schrieben Sie:
>> > If you have problems with Gtk2Hs on Windows, it might be better to write
>> > a Win32-based backend for Grapefruit instead of a wxWidgets-based one.
>> > What do you think about that?
>>
>> Win32-based backend would make more sense as it is one less layer to deal
>> with. But how? Same thing with Mac.
>
> A student of mine wrote a fully automatic binding generator for C++ libraries
> which also supports Qt extensions (signals and slots). (However, this guy
> still has to give me the code. :-/ ) One could do a similar thing for
> generating Win32 and Cocoa bindings. Then one could write Grapefruit UI
> backends based on these bindings.
>
> Best wishes,
> Wolfgang
> ___
> 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] Re: [Haskell] ANNOUNCE: first Grapefruit release

2009-02-16 Thread Jeff Heard
I would actually quite like to integrate Hieroglyph with Grapefruit,
which would give you your Cairo support and give me a sensible way to
implement events outside of my really rather broken model.

On Mon, Feb 16, 2009 at 10:04 AM, Wolfgang Jeltsch
 wrote:
> Am Montag, 16. Februar 2009 15:13 schrieben Sie:
>> So I have an application that I am developing. The UI module includes
>> the following:
>>
>> import Graphics.UI.Gtk
>> import Graphics.Rendering.Cairo
>> import Graphics.Rendering.Cairo.SVG
>> import Graphics.UI.Gtk.Gdk.EventM
>>
>> Can you tell from that list if i am likely to be able to rewrite it to
>> use Grapefruit?
>
> No, this won't work at the moment. As I already said, Grapefruit's widget
> support is very restricted at the moment. (And if I say "very" I really mean
> it.) So Grapefruit is worlds apart from what the catch-all Graphics.UI.Gtk
> import provides. And there is no graphics support at the moment, so there is
> nothing equivalent to the Cairo interface. Coming up with a sensible
> purely-functional, toolkit-independent, reactive graphics interface will also
> need some design work.
>
> Until now, I concentrated on getting Grapefruit's core well. This includes a
> scalable FRP implementation, a record system (since you don't want to provide
> an input signal for every attribute of every single widget in practice) and
> support for writing/extending Grapefruit UI backends without writing lots of
> boilerplate code. Providing a wide variety of ready-to-use widgets, graphics
> primitives, etc. is future work which, hopefully, I can delegate largely to
> interested third parties. ;-)
>
> Best wishes,
> Wolfgang
> ___
> 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] Re: [Gtk2hs-users] Gtk2HS 0.10.0 Released

2009-02-10 Thread Jeff Heard
Wonderful!  Who maintains the mac-ports port of it?  I'm itching to
get hieroglyph working on the Mac.

On Tue, Feb 10, 2009 at 11:40 PM, Peter Gavin  wrote:
> Hi everyone,
>
> Oh, dear... it seems I've forgotten how to spell "cafe", and sent this
> message to haskell-c...@haskell.org the first time around.  I resent it
> to all the lists again (just to make sure everyone interested receives
> it), so I apologize for any duplicated messages you might have received.
>  In any case...
>
> I'd like to release the announcement of Gtk2HS 0.10.0.  A lot of new
> stuff has gone into this release, including:
>
> - Support for GHC 6.10
> - Bindings to GIO and GtkSourceView-2.0
> - Full switch to the new model-view implementation using a Haskell model
> - Support for many more model-based widgets such as IconView and an
> updated binding for ComboBox
> - Full Drag-and-Drop support
> - Better support for Attributes in Pango
> - Replaced Event for EventM monad, thereby improving efficiency and
> convenience
> - Functions for interaction between Cairo and Pixbuf drawing
> - Lots of bug fixes, code cleanups, and portability improvements
>
> With this release, the bindings to GnomeVFS and GtkSourceView-1.0 have
> been deprecated.  The TreeList modules have been deprecated from the
> Gtk+ bindings.
>
> Source and Win32 binaries are available at:
>
>
> https://sourceforge.net/project/showfiles.php?group_id=49207package_id=42440&release_id=659598
>
> Thanks to everyone who submitted bug fixes and features this time around!
>
> Thanks,
> Peter Gavin
> Gtk2HS Release Manager
>
>
> --
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> ___
> Gtk2hs-users mailing list
> gtk2hs-us...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Elegant & powerful replacement for CSS

2009-02-03 Thread Jeff Heard
Bret's argument, though, only applies to Information Software.
Which...  hey, if you want to go with describing fundamentally
different approaches to GUIs based on the classifications he uses in
his arguments, I think that's a better place to start than trying to
figure out how to make a new denotationally-semantic GUI toolkit that
works for everyone everywhere.

On Tue, Feb 3, 2009 at 4:48 PM, Malcolm Wallace
 wrote:
> Jeff Heard wrote:
>
>> Similarly, I've been wondering what's at the core of a GUI?  It seems
>> in recent years that more people have been moving towards web-based
>> applications, and away from traditional GUIs, so the meaning of them
>> may be changing.  The old question seemed to be Page vs.
>> Control-Board, but that seems like implementation, when the real
>> essence of a GUI is taking in common kinds of user input and
>> displaying output in a sensible way.
>
> I would go with Bret Victor's argument (http://worrydream.com/MagicInk/)
> that the concept of user interface as primarily _interaction_ is misguided.
>  What GUIs are really about is visual _presentation_ of information.  The
> semantic questions are about what it means graphically to compose
> information sources.  We spend more time reading, viewing, and absorbing
> that information, than rearranging it, or adding to it.
>
> Interaction changes the sources, or the way they compose, but is (or should
> be) fundamentally an infrequent activity.  The better the visual
> presentation, the less you need to interact with it.
>
> Regards,
>Malcolm
>
> ___
> 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] Elegant & powerful replacement for CSS

2009-02-03 Thread Jeff Heard
Similarly, I've been wondering what's at the core of a GUI?  It seems
in recent years that more people have been moving towards web-based
applications, and away from traditional GUIs, so the meaning of them
may be changing.  The old question seemed to be Page vs.
Control-Board, but that seems like implementation, when the real
essence of a GUI is taking in common kinds of user input and
displaying output in a sensible way.  Similarly, there are more ways
to interact with a computer than ever before, from simple keyboard up
through multitouch interfaces like the iPhone.  It would be cool to me
to see a semantic model that captures this.

2009/2/3 Conal Elliott :
> [Spin-off from the haskell-cafe discussion on functional/denotational GUI
> toolkits]
>
> I've been wondering for a while now what a well-designed alternative to CSS
> could be, where well-designed would mean consistent, composable, orthogonal,
> functional, based on an elegantly compelling semantic model (denotational).
>
>- Conal
>
>
> ___
> 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] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-02 Thread Jeff Heard
That's my thought.

On Mon, Feb 2, 2009 at 7:23 AM, Achim Schneider  wrote:
> Stephen Tetley  wrote:
>
>> Also, Shiva-VG - http://sourceforge.net/projects/shivavg - the
>> implementation of OpenVG that the Haskell binding works with supports
>> OpenVG 1.0.1, so it doesn't handle text at all.
>>
> You know, if the Haskell bindings are compositable enough, it shouldn't
> be a problem to simply load bezier shapes from freetype into other
> libraries.
>
> --
> (c) this sig last receiving data processing entity. Inspect headers
> for copyright history. All rights reserved. Copying, hiring, renting,
> performance and/or quoting of this signature prohibited.
>
>
> ___
> 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] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-01 Thread Jeff Heard
I will happily check it on Linux.  I'm only vaguely familiar with
OpenVG... In theory it's a good API, and would support exactly what
I'd need for a backend to Hieroglyph that isn't Cairo based, but we'd
still need a good image API and probably to bind to Pango to get text
and layout support.

For Image APIs, by the way, I suggest that someone, maybe me, but
someone, look at the VIPS toolkit, as it's probably already the most
Haskell-like toolkit, as it's lazy and concurrent all the way down
past the C layer and supports fully composable operators.  The authors
haven't formalized it as far as functional programming goes, but it
was definitely in the back of their brains when they were coming up
with it.  The other advantage is that the V stands for Very Large.
VIPS can handle images of unlimited size.

-- Jeff

On Sun, Feb 1, 2009 at 7:32 PM, Stephen Tetley  wrote:
> Hello
>
> I've written a Haskell binding to the Shiva-VG OpenVG implementation.
>
> Hopefully it should appear on Hackage in the next couple of days - but
> for the moment it is available here:
>
>
> http://slackwise.org/spt/files/OpenVG-0.1.tar.gz
>
> I've tested it on MacOSX leopard and Windows with MinGW / MSys, if
> anyone could check it on Linux that would be handy.
> Thanks.
>
>
> Best regards
>
> Stephen
> ___
> 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] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-01 Thread Jeff Heard
Oh, and by functional, I mean that it isn't a complete re-wrapping of
the library, not that you have IO creeping in all over the place.
Pardon my unclearness.

On Sun, Feb 1, 2009 at 6:10 PM, Jeff Heard  wrote:
> Everyone, I'll be releasing Hieroglyph this week.  Right now I'm unit
> testing and I've been out of town this past weekend without much
> opportunity to work on it.  It's not yet a complete functional
> re-working of Cairo -- for instance, right now patterns aren't
> supported, and Pango layouts aren't either -- but it should become so.
>  I'll also be forking Hieroglyph to develop a complete,
> pure-functional 2D graphics toolkit.
>
> -- Jeff
>
> 2009/1/31 Peter Verswyvelen :
>> Hi Conal,
>> Do you have any links to this interesting work of Jefferson Heard? Blogs or
>> something? I failed to Google it, I mainly found his OpenGL TrueType
>> bindings on Hackage and his
>> beautiful http://bluheron.europa.renci.org/docs/BeautifulCode.pdf
>> Regarding semantics, modern GPUs are able to render 2D graphics (e.g. filled
>> or stroked curves) as real functions / relations; you don't need fine
>> tessellation anymore since these computational monsters have become so fast
>> that per pixel inside / outside testing are feasible now. It's basically a
>> simple form of real-time ray-tracing :)  A quick search revealed another
>> paper using these
>> techniques http://alice.loria.fr/publications/papers/2005/VTM/vtm.pdf
>> Cheers,
>> Peter
>> 2009/1/31 Conal Elliott 
>>>
>>> Hi Antony,
>>>
>>>>
>>>> Hopefully some enterprising Haskell hacker will wrap Cairo in a nice
>>>> purely functional API.
>>>
>>> Jefferson Heard is working on such a thing, called Hieroglyph.  Lately
>>> I've been helping him simplify the design and shift it toward a clear,
>>> composable semantic basis, i.e. "genuinely functional" (as in the Fruit
>>> paper), meaning that it can be understood & reasoned about in precise terms
>>> via model that is much simpler than IO.
>>>
>>> In the process, I realized more clearly that the *very goal* of making a
>>> purely functional wrapper around an imperative library leads to muddled
>>> thinking.  It's easy to hide the IO without really eliminating it from the
>>> semantics, especially if the goal is defined in terms of an IO-based
>>> library.  Much harder, and I think much more rewarding, is to design
>>> semantically, from the ground up, and then figure out how to implement the
>>> elegant semantics with the odds & ends at hand (like Cairo, OpenGL, GPU
>>> architectures, ...).
>>>
>>> Regards,
>>>
>>> - Conal
>>>
>>> On Fri, Jan 30, 2009 at 1:56 PM, Antony Courtney
>>>  wrote:
>>>>
>>>> On Fri, Jan 30, 2009 at 4:25 PM, Bryan O'Sullivan 
>>>> wrote:
>>>> > On Fri, Jan 30, 2009 at 1:11 PM, Antony Courtney
>>>> > 
>>>> > wrote:
>>>> >>
>>>> >> A 2-D vector graphics library such as Java2D ( or Quartz on OS/X or
>>>> >> GDI+ on Windows ) supports things like computing tight bounding
>>>> >> rectangles for arbitrary shapes, hit testing for determining whether a
>>>> >> point is inside or outside a shape and constructive area geometry for
>>>> >> shape compositing and clipping without dropping down to a raster
>>>> >> representation.
>>>> >
>>>> > These are the kinds of capabilities provided by Cairo, which is very
>>>> > pleasant to use (PDF-style imaging model) and quite portable. There are
>>>> > already Cairo bindings provided by gtk2hs, too.
>>>> >
>>>>
>>>> Hi Bryan,
>>>>
>>>> Nice to hear from you!  Been a while...
>>>>
>>>> Just had a quick look and it does indeed appear that Cairo now
>>>> supports some of the features I mention above (bounds calculations and
>>>> hit testing).  Cairo has clearly come a long way from when I was last
>>>> working on Fruit and Haven in 2003/2004;  back then it looked like it
>>>> only provided a way to render or rasterize vector graphics on to
>>>> bitmap surfaces and not much else.
>>>>
>>>> It's not clear to me if the Cairo API in its current form supports
>>>> vector-level clipping or constructive area geometry, and it looks like
>>>

Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-01 Thread Jeff Heard
Thanks, Peter, for the paper link...  I'll look at this, as it's
exactly what it sounds like I want for the future of Hieroglyph...

2009/1/31 Peter Verswyvelen :
> Hi Conal,
> Do you have any links to this interesting work of Jefferson Heard? Blogs or
> something? I failed to Google it, I mainly found his OpenGL TrueType
> bindings on Hackage and his
> beautiful http://bluheron.europa.renci.org/docs/BeautifulCode.pdf
> Regarding semantics, modern GPUs are able to render 2D graphics (e.g. filled
> or stroked curves) as real functions / relations; you don't need fine
> tessellation anymore since these computational monsters have become so fast
> that per pixel inside / outside testing are feasible now. It's basically a
> simple form of real-time ray-tracing :)  A quick search revealed another
> paper using these
> techniques http://alice.loria.fr/publications/papers/2005/VTM/vtm.pdf
> Cheers,
> Peter
> 2009/1/31 Conal Elliott 
>>
>> Hi Antony,
>>
>>>
>>> Hopefully some enterprising Haskell hacker will wrap Cairo in a nice
>>> purely functional API.
>>
>> Jefferson Heard is working on such a thing, called Hieroglyph.  Lately
>> I've been helping him simplify the design and shift it toward a clear,
>> composable semantic basis, i.e. "genuinely functional" (as in the Fruit
>> paper), meaning that it can be understood & reasoned about in precise terms
>> via model that is much simpler than IO.
>>
>> In the process, I realized more clearly that the *very goal* of making a
>> purely functional wrapper around an imperative library leads to muddled
>> thinking.  It's easy to hide the IO without really eliminating it from the
>> semantics, especially if the goal is defined in terms of an IO-based
>> library.  Much harder, and I think much more rewarding, is to design
>> semantically, from the ground up, and then figure out how to implement the
>> elegant semantics with the odds & ends at hand (like Cairo, OpenGL, GPU
>> architectures, ...).
>>
>> Regards,
>>
>> - Conal
>>
>> On Fri, Jan 30, 2009 at 1:56 PM, Antony Courtney
>>  wrote:
>>>
>>> On Fri, Jan 30, 2009 at 4:25 PM, Bryan O'Sullivan 
>>> wrote:
>>> > On Fri, Jan 30, 2009 at 1:11 PM, Antony Courtney
>>> > 
>>> > wrote:
>>> >>
>>> >> A 2-D vector graphics library such as Java2D ( or Quartz on OS/X or
>>> >> GDI+ on Windows ) supports things like computing tight bounding
>>> >> rectangles for arbitrary shapes, hit testing for determining whether a
>>> >> point is inside or outside a shape and constructive area geometry for
>>> >> shape compositing and clipping without dropping down to a raster
>>> >> representation.
>>> >
>>> > These are the kinds of capabilities provided by Cairo, which is very
>>> > pleasant to use (PDF-style imaging model) and quite portable. There are
>>> > already Cairo bindings provided by gtk2hs, too.
>>> >
>>>
>>> Hi Bryan,
>>>
>>> Nice to hear from you!  Been a while...
>>>
>>> Just had a quick look and it does indeed appear that Cairo now
>>> supports some of the features I mention above (bounds calculations and
>>> hit testing).  Cairo has clearly come a long way from when I was last
>>> working on Fruit and Haven in 2003/2004;  back then it looked like it
>>> only provided a way to render or rasterize vector graphics on to
>>> bitmap surfaces and not much else.
>>>
>>> It's not clear to me if the Cairo API in its current form supports
>>> vector-level clipping or constructive area geometry, and it looks like
>>> the API is still pretty render-centric (e.g. is it possible to obtain
>>> the vector representation of rendering text in a particular font?).
>>> That might make it challenging to use Cairo for something like the
>>> Haven API, but maybe one can live without that level of generality.
>>>
>>> In any case: delighted to see progress on this front!  Hopefully some
>>> enterprising Haskell hacker will wrap Cairo in a nice purely
>>> functional API.
>>>
>>>-Antony
>>> ___
>>> 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
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Why binding to existing widget toolkits doesn't make any sense

2009-02-01 Thread Jeff Heard
Everyone, I'll be releasing Hieroglyph this week.  Right now I'm unit
testing and I've been out of town this past weekend without much
opportunity to work on it.  It's not yet a complete functional
re-working of Cairo -- for instance, right now patterns aren't
supported, and Pango layouts aren't either -- but it should become so.
 I'll also be forking Hieroglyph to develop a complete,
pure-functional 2D graphics toolkit.

-- Jeff

2009/1/31 Peter Verswyvelen :
> Hi Conal,
> Do you have any links to this interesting work of Jefferson Heard? Blogs or
> something? I failed to Google it, I mainly found his OpenGL TrueType
> bindings on Hackage and his
> beautiful http://bluheron.europa.renci.org/docs/BeautifulCode.pdf
> Regarding semantics, modern GPUs are able to render 2D graphics (e.g. filled
> or stroked curves) as real functions / relations; you don't need fine
> tessellation anymore since these computational monsters have become so fast
> that per pixel inside / outside testing are feasible now. It's basically a
> simple form of real-time ray-tracing :)  A quick search revealed another
> paper using these
> techniques http://alice.loria.fr/publications/papers/2005/VTM/vtm.pdf
> Cheers,
> Peter
> 2009/1/31 Conal Elliott 
>>
>> Hi Antony,
>>
>>>
>>> Hopefully some enterprising Haskell hacker will wrap Cairo in a nice
>>> purely functional API.
>>
>> Jefferson Heard is working on such a thing, called Hieroglyph.  Lately
>> I've been helping him simplify the design and shift it toward a clear,
>> composable semantic basis, i.e. "genuinely functional" (as in the Fruit
>> paper), meaning that it can be understood & reasoned about in precise terms
>> via model that is much simpler than IO.
>>
>> In the process, I realized more clearly that the *very goal* of making a
>> purely functional wrapper around an imperative library leads to muddled
>> thinking.  It's easy to hide the IO without really eliminating it from the
>> semantics, especially if the goal is defined in terms of an IO-based
>> library.  Much harder, and I think much more rewarding, is to design
>> semantically, from the ground up, and then figure out how to implement the
>> elegant semantics with the odds & ends at hand (like Cairo, OpenGL, GPU
>> architectures, ...).
>>
>> Regards,
>>
>> - Conal
>>
>> On Fri, Jan 30, 2009 at 1:56 PM, Antony Courtney
>>  wrote:
>>>
>>> On Fri, Jan 30, 2009 at 4:25 PM, Bryan O'Sullivan 
>>> wrote:
>>> > On Fri, Jan 30, 2009 at 1:11 PM, Antony Courtney
>>> > 
>>> > wrote:
>>> >>
>>> >> A 2-D vector graphics library such as Java2D ( or Quartz on OS/X or
>>> >> GDI+ on Windows ) supports things like computing tight bounding
>>> >> rectangles for arbitrary shapes, hit testing for determining whether a
>>> >> point is inside or outside a shape and constructive area geometry for
>>> >> shape compositing and clipping without dropping down to a raster
>>> >> representation.
>>> >
>>> > These are the kinds of capabilities provided by Cairo, which is very
>>> > pleasant to use (PDF-style imaging model) and quite portable. There are
>>> > already Cairo bindings provided by gtk2hs, too.
>>> >
>>>
>>> Hi Bryan,
>>>
>>> Nice to hear from you!  Been a while...
>>>
>>> Just had a quick look and it does indeed appear that Cairo now
>>> supports some of the features I mention above (bounds calculations and
>>> hit testing).  Cairo has clearly come a long way from when I was last
>>> working on Fruit and Haven in 2003/2004;  back then it looked like it
>>> only provided a way to render or rasterize vector graphics on to
>>> bitmap surfaces and not much else.
>>>
>>> It's not clear to me if the Cairo API in its current form supports
>>> vector-level clipping or constructive area geometry, and it looks like
>>> the API is still pretty render-centric (e.g. is it possible to obtain
>>> the vector representation of rendering text in a particular font?).
>>> That might make it challenging to use Cairo for something like the
>>> Haven API, but maybe one can live without that level of generality.
>>>
>>> In any case: delighted to see progress on this front!  Hopefully some
>>> enterprising Haskell hacker will wrap Cairo in a nice purely
>>> functional API.
>>>
>>>-Antony
>>> ___
>>> 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
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: data-spacepart - space partitioning data structure[s] (initial release)

2009-01-27 Thread Jeff Heard
I'll be releasing an R-Tree fairly soon...  not sure whether it'll fit
into this package or not, but we might conisder merging.

On Tue, Jan 27, 2009 at 10:52 PM, Artyom Shalkhakov
 wrote:
> Hello,
>
> 2009/1/27 Corey O'Connor :
>> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-spacepart
>>
>> The goal of this package is to be a collection of space partitioning
>> data structures. Currently, however, there is only a simple quadtree
>> implementation.
>
> Are you going to experiment with kd-trees, octrees and other spatial
> acceleration data structures? Is it for raytracing or for collision
> detection, or
> maybe for 3d graphics on consumer hardware?
>
> Cheers,
> Artyom Shalkhakov.
> ___
> 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] Employment

2009-01-19 Thread Jeff Heard
Haskell's all I use at work, although no-one requires it.  I know that
Ravi Nanavati's company uses Haskell pretty exclusively, and there's
also Galois and a couple of financial houses.  I was pretty impressed
with the professional turnout for ICFP 2008.

-- Jeff

On Mon, Jan 19, 2009 at 2:34 PM, Andrew Coppin
 wrote:
> Is it possible to earn money using Haskell? Does anybody here actually do
> this?
>
> Inquiring minds want to know... ;-)
>
> ___
> 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] OS X build failure of Gtk2Hs from MacPorts

2009-01-17 Thread Jeff Heard
That would probably be the problem, then, yes.  I'm still using GHC
6.8.3 in most of my code, but MacPorts doesn't respect the existing
installation of GHC 6.8.3 that I installed via the DMG package on
http://haskell.org/ghc

On Sat, Jan 17, 2009 at 5:56 PM, Yitzchak Gale  wrote:
> Jeff,
>
> I'm not sure if this is causing the problem you're referring to,
> but MacPorts is at GHC 6.10 while Gtk2Hs doesn't support
> that yet.
>
> Regards,
> Yitz
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] New blog on Haskell and Haskell in Visualization

2009-01-17 Thread Jeff Heard
Just started up a blog on my own random lumberings through Haskell and
the visualizations I've produced in Haskell.  Have plenty of content
on backlog, so I should be updating regularly.  That's about all!

http://vis.renci.org/jeff/

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


[Haskell-cafe] OS X build failure of Gtk2Hs from MacPorts

2009-01-17 Thread Jeff Heard
/opt/local/bin/ghc +RTS -RTS -c tools/hierarchyGen/TypeGen.hs -o
tools/hierarchyGen/TypeGen.o -O -itools/hierarchyGen -package-conf
package.conf.inplace -hide-all-packages -package base
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
/opt/local/bin/ghc +RTS -RTS -c tools/callbackGen/HookGenerator.hs -o
tools/callbackGen/HookGenerator.o -O -I. -itools/callbackGen
-package-conf package.conf.inplace -hide-all-packages -package base
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
rm -rf glib/System/Glib.o glib/System/Glib_split/; mkdir -p
glib/System/Glib_split
/opt/local/bin/ghc +RTS -RTS -split-objs -c glib/System/Glib.hs -o
glib/System/Glib.o -O -fffi -iglib -package-conf package.conf.inplace
-hide-all-packages -ignore-package glib -package base -package-name
glib-0.9.13 '-#include' -I/opt/local/include/glib-2.0
-I/opt/local/lib/glib-2.0/include -I/opt/local/include

on the commandline:
Warning: -fffi is deprecated: use -XForeignFunctionInterface or
pragma {-# LANGUAGE ForeignFunctionInterface#-} instead
package.conf.inplace: openBinaryFile: does not exist (No such file or directory)
make[1]: *** [glib/System/Glib.o] Error 1
make: *** [all] Error 2
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-16 Thread Jeff Heard
Yes, please do.  At some point soon, I will do and release a feature
and performance benchmark on HTTP-3xxx, -4xxx, -lazy (if you release
it), and cURL, that way people can use what's best for their
application.

On Fri, Jan 16, 2009 at 12:29 PM, Don Stewart  wrote:
> lemming:
>>
>> On Thu, 15 Jan 2009, Sigbjorn Finne wrote:
>>
>> >I guess it's time to publish more widely the availability of a
>> >modernization of the venerable and trusted HTTP package, which I've been
>> >working on off&on for a while.
>>
>>  I was always afraid that a fork may happen during I work on HTTP in order
>> to get it more lazy. That's why I started discussion on web-devel mailing
>> list, but got only limited response. I also notified Bjorn, that my
>> changes need still a little time and that I'm worried about darcs
>> conflicts. Seems that we now run into a perfect conflict. I don't like to
>> throw away the work that I have done the last weeks.
>>
>> My version is at
>>   http://code.haskell.org/~thielema/http/
>
> There's absolutely no need to throw away work. Hackage is a broad
> church, release it as http-lazy, at the very least.
>
> -- Don
> ___
> 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: HTTPbis / HTTP-4000.x package available

2009-01-16 Thread Jeff Heard
Just as a reported speedup, downloading a 5MB file from my own local
machine (via http) went from 1.05 secs to 0.053 secs.  Yes, it's
really an order of magnitude better.  Performance now is on par or
slightly better than cURL (however to get more protocols than HTTP,
you'll still need the ubiquitous cURL library)

On Fri, Jan 16, 2009 at 1:36 AM, Sigbjorn Finne
 wrote:
> Hi,
>
> I guess it's time to publish more widely the availability of a modernization
> of
> the venerable and trusted HTTP package, which I've been working on
> off&on for a while.
>
> Bunch of changes, but the headline new feature of this new version
> is the parameterization of the representation of payloads in both HTTP
> requests and responses. Two new representations are supported, strict and
> lazy
> ByteStrings. Some people have reported quietly pleasing speedups as a result
> of this change. (If they want to report numbers, please do..)
>
> Another change/fix in this release is the _alleged_ fix to the long-standing
> bug
> in the use of  absolute URIs vs absolute paths in requests (for non-proxied
> and
> proxied use.) Give it a go..
>
> Notice that the HTTP-4000.x version will require you to make some
> modifications to your existing HTTP-using code -- I've tried to keep the API
> backwards compatible minimal despite the change in functionality and
> underlying types. If you do not want to deal with this right away, please
> introduce a <4000 dependency on the HTTP package in your .cabal files.
>
> I've also taken on the maintainership of the package, with the highly
> esteemed
> Bjorn Bingert no longer having the usual abundance of cycles to look after
> it (hope I'm not misrepresenting facts here, Bjorn!) However, I've yet to
> gain access to  www.haskell.org and update http://www.haskell.org/http,
> so for now you may pick up a new version the lib via
>
>  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP
>
> GIT repo for HTTP-4000  / HTTPbis is here
>
>   git://code.galois.com/HTTPbis.git
>
> enjoy
> --sigbjorn
>
> ___
> 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] Defining methods generically for a class

2009-01-08 Thread Jeff Heard
That's probably the best thing to do, yes.  The purpose of doing so
was for Data.List.delete, but I see now there's a Data.List.deleteBy,
so I can use the regionEquals function as my equality predicate.

On Thu, Jan 8, 2009 at 12:26 PM, Martijn van Steenbergen
 wrote:
> Hi Jeff,
>
> Jeff Heard wrote:
>>
>> instance Region a => Eq a where
>>  regiona == regionb = all $ zipWith (==)  (bounds regiona) (bounds
>> regionb)
>
> If you want to be Haskell98 compliant, why not define regionEquals :: Region
> a => a -> a -> Bool as above and use that everywhere instead of (==)?
>
> If you insist on using the overloaded (==), then in Haskell98 you will need
> to define individual Eq instances for all your custom region types. However,
> you can simply define (==) = regionEquals for all those types.
>
> Hope this helps,
>
> Martijn.
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Fwd: [Haskell-cafe] Defining methods generically for a class

2009-01-08 Thread Jeff Heard
-- Forwarded message --
From: Jeff Heard 
Date: Thu, Jan 8, 2009 at 12:26 PM
Subject: Re: [Haskell-cafe] Defining methods generically for a class
To: Cristiano Paris 


Not really...  I'm not testing if each of the items a are equal, but
rather that in the context of them being a Region, they are equal.As
long "dim" (which is in the class) can be defined, then equality is
defined over all types Region.

On Thu, Jan 8, 2009 at 12:16 PM, Cristiano Paris  wrote:
> On Thu, Jan 8, 2009 at 6:04 PM, Jeff Heard  
> wrote:
>> ...
>> How do I declare all Regions to be Eqs without putting it in the class
>> body (since I define a function over all Regions that is independent
>> of datatype that is an instance of Region)?
>
> Would this be a solution?
>
> class Eq a => Region a where
>  ...
>
> Cristiano
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Defining methods generically for a class

2009-01-08 Thread Jeff Heard
I have the following class:

class Region a where
numDimensions :: a -> Int
dim :: Int -> a -> (Double,Double)
merge :: a -> a -> a

and several ancillary methods defined, the most importance of which is:

bounds :: Region a => a -> [(Double,Double)]
bounds r = take (numDimensions r) . map dim . iterate (+1) $ 0

Let's say that I want all Regions to also be of class Eq, where

regiona == regionb = all $ zipWith (==)  (bounds regiona) (bounds regionb)

How do I declare all Regions to be Eqs without putting it in the class
body (since I define a function over all Regions that is independent
of datatype that is an instance of Region)?  Is it merely:

instance Region a => Eq a where
  regiona == regionb = all $ zipWith (==)  (bounds regiona) (bounds regionb)

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


Re: [Haskell-cafe] Template Haskell question

2009-01-07 Thread Jeff Heard
It doesn't typecheck, no, but it also doesn't check out in scope.  It
complains in

[FunD 'mousePosition [| mousePositionf |] ...

that mousePositionf isn't in scope.

What I believe I need to do is use mkName "mousePositionf", but how do
I bind the record getter "mousePositionf" that is defined by the code
in the function named  "additions" to mousePosition -- a.k.a. how do I
write that template?  Is it a ConE?  And how do I encode

a{ mousePositionf = b }

in template haskell without using the [| |] syntax, so that I can use mkName?

-- Jeff

On Tue, Jan 6, 2009 at 6:23 PM, Eelco Lempsink  wrote:
> On 6 jan 2009, at 18:08, Jeff Heard wrote:
>>
>> Alright...  I *think* I'm nearly there, but I can't figure out how to
>> derive a class instance using record accessors and updaters...  Can
>> anyone help?  There are [| XXXf |] instances at the end of the module
>> and they all need replaced, but I can't figure out what to replace
>> them with.
>
> ...
>>
>> -- usage: $(deriveUIState ''MyTypeWithUIState)
>> {-
>> - Derive an instance of UIState from some type that has had UIState
>> fields added to it.
>> -}
>> deriveUIState tp = do
>>   return [InstanceD []
>> (appUIState $ appType tp [])
>> [FunD 'mousePosition  [| mousePositionf |]
>
> ...
>>
>>,FunD 'setMousePosition[| \b a -> a{
>> mousePositionf=b } |]
>
> ...
>
> Quick guess: this doesn't typecheck?
>
> FunD :: Name -> [Clause] -> Dec
>
> while [| ... |] will return something of type ExpQ (which is the same as Q
> Exp).
>
> You're indeed nearly there, but if you use the quotation brackets you need
> to write monadic code (for the Q monad) and use functions like clause and
> funD.  The tutorials on the wiki (you've probably seen them,
> http://www.haskell.org/haskellwiki/Template_Haskell) or pretty good and you
> could also look at packages at hackage for inspiration/examples, e.g.
> http://hackage.haskell.org/packages/archive/haxr-th/3000.0.0/doc/html/src/Network-XmlRpc-THDeriveXmlRpcType.html
>
> --
> Regards,
>
> Eelco Lempsink
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Template Haskell question

2009-01-06 Thread Jeff Heard
Alright...  I *think* I'm nearly there, but I can't figure out how to
derive a class instance using record accessors and updaters...  Can
anyone help?  There are [| XXXf |] instances at the end of the module
and they all need replaced, but I can't figure out what to replace
them with.  The basic idea of the module is that you define your
record type, Q, and that record type contains all the state you're
interested in.  The Hieroglyph system has other basic state, and the
idea is that you use

$(additions "QWithState" ''Q)
$(deriveUIState ''QWithState)

to create your final UIState instance.

-- -

{-# LANGUAGE TemplateHaskell #-}
module Graphics.Rendering.Hieroglyph.TH where

import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Graphics.Rendering.Hieroglyph.UIState
import Graphics.Rendering.Hieroglyph.Primitives
import Graphics.UI.Gtk.Types (Widget)
import Control.Monad

{- output of $( fmap (LitE . StringL . show) [| reify ''BasicUIState |] )
TyConI
(DataD []
   Graphics.Rendering.Hieroglyph.BasicUIState.BasicUIState
   []
   [RecC Graphics.Rendering.Hieroglyph.BasicUIState.BasicUIState

[(Graphics.Rendering.Hieroglyph.BasicUIState.mousePosition,NotStrict,ConT
Graphics.Rendering.Hieroglyph.Primitives.Point)

,(Graphics.Rendering.Hieroglyph.BasicUIState.mouseLeftButtonDown,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.mouseRightButtonDown,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.mouseMiddleButtonDown,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.mouseWheel,NotStrict,ConT
GHC.Base.Int)

,(Graphics.Rendering.Hieroglyph.BasicUIState.keyCtrl,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.keyShift,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.keyAlt,NotStrict,ConT
GHC.Base.Bool)

,(Graphics.Rendering.Hieroglyph.BasicUIState.key,NotStrict,ConT
Graphics.Rendering.Hieroglyph.UIState.Key)

,(Graphics.Rendering.Hieroglyph.BasicUIState.drawing,NotStrict,AppT
(ConT Data.Maybe.Maybe) (ConT Graphics.UI.Gtk.Types.Widget))

,(Graphics.Rendering.Hieroglyph.BasicUIState.sizeX,NotStrict,ConT
GHC.Float.Double)

,(Graphics.Rendering.Hieroglyph.BasicUIState.sizeY,NotStrict,ConT
GHC.Float.Double)

,(Graphics.Rendering.Hieroglyph.BasicUIState.imageCache,NotStrict,AppT
(ConT Data.Maybe.Maybe) (ConT
Graphics.Rendering.Hieroglyph.UIState.ImageCache))]] [])
-}

-- usage: $(additions "MyTypeName" OldTypeName)
{-
 - Add fields to a record type for handling basic UI state for
Hieroglyph.  Gives you mouse buttons, etcetera
-}
additions newtypenamestr nm = do
TyConI (DataD _ _ _ [RecC _ fielddefs]) <- reify nm
let newtypename = mkName newtypenamestr
return $
(DataD []
   newtypename
   []
   [RecC newtypename
 [(mkName "mousePositionf",NotStrict,ConT ''Point)
 ,(mkName "mouseLeftButtonDownf",NotStrict,ConT ''Bool)
 ,(mkName "mouseRightButtonDownf",NotStrict,ConT ''Bool)
 ,(mkName "mouseMiddleButtonDownf",NotStrict,ConT ''Bool)
 ,(mkName "mouseWheelf",NotStrict,ConT ''Int)
 ,(mkName "keyCtrlf",NotStrict,ConT ''Bool)
 ,(mkName "keyShiftf",NotStrict,ConT ''Bool)
 ,(mkName "keyAltf",NotStrict,ConT ''Bool)
 ,(mkName "keyf",NotStrict,ConT ''Key)
 ,(mkName "drawingf",NotStrict,AppT (ConT ''Maybe)
(ConT ''Widget))
 ,(mkName "sizeXf",NotStrict,ConT ''Double)
 ,(mkName "sizeYf",NotStrict,ConT ''Double)
 ,(mkName "imageCachef",NotStrict,AppT (ConT ''Maybe)
(ConT ''ImageCache))] ++ fielddefs] [])

-- | Apply a Binary type constructor to given type: "t" -> "Binary t"
appUIState :: Type -> Type
appUIState t  =  AppT (ConT ''UIState) t

-- | Generate from list of type names result of types application:
-- appType T [a,b] -> "T a b"
appType :: Name -> [Name] -> Type
--appType t []  = ConT t -- T
--appType t [t1]= AppT (ConT t) (VarT t1)-- T a
--appType t [t1,t2] = AppT (AppT (ConT t) (VarT t1)) (VarT t2)   -- T
a b == (T a) b
appType t ts  =  foldl (\a e -> AppT a (VarT e)) (ConT t) ts --
general definition

-- | Generate `n` unique variables and return them in form of patterns
and expressions
genNames :: Int -> Q ([PatQ],[ExpQ])
genNames n = do
  ids <- replicateM n (newName "x")
  return (map varP ids, map varE ids)

-- usage: $(deriveUIState ''MyTypeWithUIState)
{-
 - Derive an instance of UIState from some type that has had UIState
fields added to it.
 -}
deriveUIState tp = do
return [InstanceD []
  (appUIState $ appType tp [])
  [FunD 'mousePosition  [| mousePositionf |]
  ,FunD 'mouseLeftButtonDown[|
mouseLeftButtonDownf |]
   

Re: [Haskell-cafe] Don't make 'show*' functions

2008-12-26 Thread Jeff Heard
I don't think that making Show a type class was a mistake.  I think
that we have long since overloaded the meaning of Show and made it
ambiguous.  There are multiple distinct reasons people use Show, and
this gets confusing.  It would be good if we as a community tried to
nail down these different meanings that people tend to attach to Show
and fork out new type classes that each encompass those meanings.
Text is useful and often ignored as a means of debugging, inspecting,
logging, and serializing.

Off the top of my head, I would say that the traditional meaning of
Show could be changed to Serial, where serial encompasses both Read
and Show -- possibly we could find a more efficient read function,
several have been proposed.  Then a separate class could be made for
HumanReadable (or Loggable) where the point would bet that we write
something that can be read by humans without conforming to a
particular grammar that Haskell could read back in.

-- Jeff

On Fri, Dec 26, 2008 at 1:31 PM, Jonathan Cast
 wrote:
> On Fri, 2008-12-26 at 11:51 +, Thomas DuBuisson wrote:
>> Hello cafe,
>> This is just a small thought, but its been bugging me.  We have these
>> things called type classes for a reason (I like to think).
>
> Type classes were invented for two reasons:
>
> 1) To imitate mathematical convention.  Addition, in full, is written as
>
>  x +_{A} y
>
> where A is a mathematical structure supplying addition.  However, the
> convention is that the subscript may be omitted `when no ambiguity may
> arise'.  Programming languages (generally) take this and run with it,
> allowing
>
>  x + y
>
> to mean (depending on the language) pretty much anything.  Type classes
> are an ingenious step back toward the mathematical convention, where the
> operation + must come from some complete structure.
>
> 2) To allow conversion from structured data into strings to be treated
> as a single operation.  Most languages support this in some form, but I
> am increasingly failing to see why.  There are usually several different
> ways in which a given piece of structured data can meaningfully be
> `shown'; in languages which try to do the right thing when given
>
>  print "string", 'c', (2 + 2), [true, false, :maybe]
>
> you *still* end up defining (multiple!) special-purpose output or
> conversion-to-string functions so you can print the same data in
> multiple ways.  I think making Show a type class was a mistake.
>
> jcc
>
>
> ___
> 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] ANN: Hieroglyph 0.85

2008-12-25 Thread Jeff Heard
I have changed the name of Thingie to Hieroglyph and added support for
displaying images on the Cairo canvas.  I'm still working on using
template haskell to derive the basic UIState class, but I don't
understand template haskell all that well, so it's taking some time.
Hopefully I can get some examples of the library up over the christmas
holiday.

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


[Haskell-cafe] Renaming a package on Hackage

2008-12-24 Thread Jeff Heard
How does one go about renaming a package on Hackage?  I finally
figured out a name for Thingie, and I'd like to change the package
name to reflect that, so that future versions look to the new package
and not the old one.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Control.Monad.IfElse 0.85

2008-12-24 Thread Jeff Heard
Updated Control.Monad.IfElse to include Wren Thornton's
Control.Monad.Extras, unlessM, ncond (unless-else chaining), ncondM,
and more binary conditional operators.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Control.Monad.IfElse

2008-12-22 Thread Jeff Heard
Provides useful anaphoric and monadic versions of if-else and when, as
well as infix operators for the actions to allow things like this:

-- Allow the clause to be in m a
whenM (Gtk.widgetIsFocus win) $ do
  this
  that

-- anaphoric if.  If the condition is nonempty, pass the conditional
value to the "then" clause, otherwise do an action that requires no
parameter.
aif (lookup name list)
  (\file -> Right `liftM` hGetLine file)
  (do f <- openFile name
   l <- hGetLine file
   return $ Right (f,l))

-- infix version of Control.Monad.When
(x>5) >>? putStrLn x

-- infix version of anaphoric when
lookup name list >>=? \value -> putStrLn value

-- infix version of anaphoric whenM
Gtk.widgetIntersect win rect >>=>>? \intersectingRectangle' ->
Gtk.invalidate intersectingRectangle'
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Beginner's TH question

2008-12-20 Thread Jeff Heard
Two things...  can I add fields to records using Template Haskell, like:

data T = T { $fields, myfield :: Field, ... }

I assume the answer there is no, and then what's wrong with this?  I get:

Illegal instance declaration for `UIState t'
(All instance types must be of the form (T a1 ... an)
 where a1 ... an are type *variables*,
 and each type variable appears at most once in the instance head.
 Use -XFlexibleInstances if you want to disable this.)
In the instance declaration for `UIState t'
In the expression:
[d|
instance UIState t where
{ setSizeY v a = setSizeY v . uist $ a
  setSizeX v a = setSizeX v . uist $ a
  setDrawing v a = setDrawing v . uist $ a
  setKey v a = setKey v . uist $ a
   } |]
In the definition of `deriveUIState':
deriveUIState uist t
= [d|
  instance UIState t where
  { setSizeY v a = setSizeY v . uist $ a
setSizeX v a = setSizeX v . uist $ a
setDrawing v a = setDrawing v . uist $ a
 } |]

in this module:

-# LANGUAGE TemplateHaskell #-}
module Graphics.Rendering.Thingie.TH where

import Language.Haskell.TH
import Graphics.Rendering.Thingie.UIState
import qualified Graphics.Rendering.Thingie.BasicUIState as S


deriveUIState uist t =
  [d| instance UIState t where
mousePosition a = S.mousePosition . uist $ a
mouseLeftButtonDown a = S.mouseLeftButtonDown . uist $ a
mouseRightButtonDown a = S.mouseRightButtonDown . uist $ a
mouseMiddleButtonDown a = S.mouseMiddleButtonDown . uist $ a
mouseLeftButtonClicked a = S.mouseLeftButtonClicked . uist $ a
mouseRightButtonClicked a = S.mouseRightButtonClicked . uist $ a
mouseMiddleButtonClicked a = S.mouseMiddleButtonClicked . uist $ a
mouseWheel a = S.mouseWheel . uist $ a
keyCtrl a = S.keyCtrl . uist $ a
keyShift a = S.keyShift . uist $ a
keyAlt a = S.keyAlt . uist $ a
key a = S.key . uist $ a
drawing a = S.drawing . uist $ a
sizeX a = S.sizeX . uist $ a
sizeY a = S.sizeY . uist $ a
setMousePosition v a = setMousePosition v . uist $ a
setMouseLeftButtonDown v a = setMouseLeftButtonDown v . uist $ a
setMouseRightButtonDown v a = setMouseRightButtonDown v . uist $ a
setMouseMiddleButtonDown v a = setMouseMiddleButtonDown v . uist $ a
setMouseLeftButtonClicked v a = setMouseLeftButtonClicked
v . uist $ a
setMouseRightButtonClicked v a =
setMouseRightButtonClicked v . uist $ a
setMouseMiddleButtonClicked v a =
setMouseMiddleButtonClicked v . uist $ a
setMouseWheel v a = setMouseWheel v . uist $ a
setKeyCtrl v a = setKeyCtrl v . uist $ a
setKeyShift v a = setKeyShift v . uist $ a
setKeyAlt v a = setKeyAlt v . uist $ a
setKey v a = setKey v . uist $ a
setDrawing v a = setDrawing v . uist $ a
setSizeX v a = setSizeX v . uist $ a
setSizeY v a = setSizeY v . uist $ a
   |]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: ANN: Thingie-0.80

2008-12-18 Thread Jeff Heard
Make that version 0.81 -- added in a module that exports all the other
modules except BasicUIState.

On Thu, Dec 18, 2008 at 5:12 PM, Jeff Heard  wrote:
> I need a better name for this, but I have software, so I shall release
> it with a dumb name.  Thingie has just been uploaded to hackage.  It
> is a library for creating 2D visualizations in a purely functional
> manner.  It supports static visualizations and animation, and like
> most vis libraries, can probably do games as well as simple viz
> graphics.  The backend uses Cairo for rendering, but I'm looking to
> port it to OpenGL/GLUT for systems where Gtk/Cairo is hard to get
> working (i.e. OS/X).  The idea is that you create a graph of objects
> or function that return objects and the library renders them for you
> in 2D.
>
> Right now, there's one thing I would like to add to the system above
> all other things:  The interactive system has the concept of a tracked
> program state that is threaded through the graph.  This state is
> defined by a UIState class, and any state (which is a record object)
> must be an instance of UIState and provide the system with a certain
> number of getters and setters for basic bits of state.  I would like
> to use Template Haskell to help create/derive these structures.  Does
> anyone on the list want to help with that?
>
> Here are two examples.  Each draws a smiley face, and the interactive
> one tracks your mouse with a little red ball.
> First the non-interactive:
>
> module Main where
>
> import Graphics.Rendering.Thingie.Primitives
> import Graphics.Rendering.Thingie.Cairo
> import qualified Graphics.Rendering.Cairo as Cairo
>
> smiley = Context [FillRGBA 0 0 0 0, Operator Cairo.OperatorClear] $
> Group [Draw rectangleFilled{ topleft=Point2D 0 0,
> width=200, height=200 }
>   ,Context [FillRGBA 1 1 0 1, OutlineRGBA 0 0 0
> 1, Translate 100 100, Operator Cairo.OperatorOver] $
>Group [Draw arc{ radius=100, filled=True }
>  ,Context [FillRGBA 0 0 0 1] $
>   Group [Draw arc{
> center=Point2D (-33) (-33), radius=10, filled=True }
> ,Draw arc{
> center=Point2D   33  (-33), radius=10, filled=True }
> ,Draw arc{
> angle1=degrees 30, angle2=degrees 150, radius=70 }]]]
>
> main = renderObjectToPNG "smiley.png" 200 200 smiley
>
>
> -
>
> Now the interactive:
>
>
> import Graphics.Rendering.Thingie.Interactive
> import Graphics.Rendering.Thingie.BasicUIState
> import Graphics.Rendering.Thingie.Cairo
> import Graphics.Rendering.Thingie.Primitives
>
> import qualified Graphics.Rendering.Cairo as Cairo
>
> smiley = Context [FillRGBA 0 0 0 0, Operator Cairo.OperatorClear] $
> Group [Draw rectangleFilled{ topleft=Point2D 0 0,
> width=200, height=200 }
>   ,Context [FillRGBA 1 1 0 1, OutlineRGBA 0 0 0
> 1, Translate 100 100, Operator Cairo.OperatorOver] $
>Group [Draw arc{ radius=100, filled=True }
>  ,Context [FillRGBA 0 0 0 1] $
>   Group [Draw arc{
> center=Point2D (-33) (-33), radius=10, filled=True }
> ,Draw arc{
> center=Point2D   33  (-33), radius=10, filled=True }
> ,Draw arc{
> angle1=degrees 30, angle2=degrees 150, radius=70 }]]]
>
> undercursor uistate = Context [FillRGBA 1 0 0 1] $
>  Draw arcFilled{ center=mousePosition
> uistate, radius=5 }
>
> scene = [StaticElement smiley (Rect2D 0 0 0 0)
>,UnboundedElement undercursor]
>
> main = simpleMotionSensitiveGui defaultBasicUIState scene "smiley face"
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Thingie-0.80

2008-12-18 Thread Jeff Heard
I need a better name for this, but I have software, so I shall release
it with a dumb name.  Thingie has just been uploaded to hackage.  It
is a library for creating 2D visualizations in a purely functional
manner.  It supports static visualizations and animation, and like
most vis libraries, can probably do games as well as simple viz
graphics.  The backend uses Cairo for rendering, but I'm looking to
port it to OpenGL/GLUT for systems where Gtk/Cairo is hard to get
working (i.e. OS/X).  The idea is that you create a graph of objects
or function that return objects and the library renders them for you
in 2D.

Right now, there's one thing I would like to add to the system above
all other things:  The interactive system has the concept of a tracked
program state that is threaded through the graph.  This state is
defined by a UIState class, and any state (which is a record object)
must be an instance of UIState and provide the system with a certain
number of getters and setters for basic bits of state.  I would like
to use Template Haskell to help create/derive these structures.  Does
anyone on the list want to help with that?

Here are two examples.  Each draws a smiley face, and the interactive
one tracks your mouse with a little red ball.
First the non-interactive:

module Main where

import Graphics.Rendering.Thingie.Primitives
import Graphics.Rendering.Thingie.Cairo
import qualified Graphics.Rendering.Cairo as Cairo

smiley = Context [FillRGBA 0 0 0 0, Operator Cairo.OperatorClear] $
 Group [Draw rectangleFilled{ topleft=Point2D 0 0,
width=200, height=200 }
   ,Context [FillRGBA 1 1 0 1, OutlineRGBA 0 0 0
1, Translate 100 100, Operator Cairo.OperatorOver] $
Group [Draw arc{ radius=100, filled=True }
  ,Context [FillRGBA 0 0 0 1] $
   Group [Draw arc{
center=Point2D (-33) (-33), radius=10, filled=True }
 ,Draw arc{
center=Point2D   33  (-33), radius=10, filled=True }
 ,Draw arc{
angle1=degrees 30, angle2=degrees 150, radius=70 }]]]

main = renderObjectToPNG "smiley.png" 200 200 smiley


-

Now the interactive:


import Graphics.Rendering.Thingie.Interactive
import Graphics.Rendering.Thingie.BasicUIState
import Graphics.Rendering.Thingie.Cairo
import Graphics.Rendering.Thingie.Primitives

import qualified Graphics.Rendering.Cairo as Cairo

smiley = Context [FillRGBA 0 0 0 0, Operator Cairo.OperatorClear] $
 Group [Draw rectangleFilled{ topleft=Point2D 0 0,
width=200, height=200 }
   ,Context [FillRGBA 1 1 0 1, OutlineRGBA 0 0 0
1, Translate 100 100, Operator Cairo.OperatorOver] $
Group [Draw arc{ radius=100, filled=True }
  ,Context [FillRGBA 0 0 0 1] $
   Group [Draw arc{
center=Point2D (-33) (-33), radius=10, filled=True }
 ,Draw arc{
center=Point2D   33  (-33), radius=10, filled=True }
 ,Draw arc{
angle1=degrees 30, angle2=degrees 150, radius=70 }]]]

undercursor uistate = Context [FillRGBA 1 0 0 1] $
  Draw arcFilled{ center=mousePosition
uistate, radius=5 }

scene = [StaticElement smiley (Rect2D 0 0 0 0)
,UnboundedElement undercursor]

main = simpleMotionSensitiveGui defaultBasicUIState scene "smiley face"
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ghc on CentOS 5 ?

2008-12-12 Thread Jeff Heard
I had luck building the latest GHC from source using the ghc 6.6
binary build to bootstrap.  The 6.8+ binary builds run into a timer
issue, at least on 64 bit CentOS that causes them to bork out during
the configure script.

2008/12/12 Steve Lihn :
> I recently got a CentOS server, but noticed that ghc rpm is not available
> from CentOS yum. After investigation, I found ghc is in Fedora repository,
> but does not make its way to EPEL, which yum on CentOS can use.
> (http://download.fedora.redhat.com/pub/epel/5/x86_64/)
>
> Is there any plan to get it to EPEL? Or is there any missing piece
> preventing it?
> Thanks, Steve
>
>
>
> ___
> 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] Re: Haskell project proposals reddit

2008-12-10 Thread Jeff Heard
I'm working on this now.  R-Tree, not Oct-tree, but it'll be there
soon.  Also working on GDAL/OGR bindings.

On Wed, Dec 10, 2008 at 4:26 AM, Neal Alexander <[EMAIL PROTECTED]> wrote:
> Don Stewart wrote:
>>
>> I'd like to echo Jason's remarks earlier.
>>
>>http://www.reddit.com/r/haskell_proposals/
>>
>> We've tried for a couple of years now to efficiently track 'wanted
>> libraries' for the community, but never with much success.
>>
>> In particular, two approaches have been tried:
>>
>>* a wiki page
>>* the 200{6,7,8} summer of code trac
>>
>> neither proved workable long term, likely because no one knew about
>> them, they're harder to contribute to and other factors.
>>
>> Now I know there's a lot of spare Haskell capacity in this community.
>> 3000 mailing list readers, but only 70 new libraries a week being
>> uploaded to Hackage --- that's not how we take over the world!
>>
>> So this is your chance to contribute:
>>
>>* propose new libraries, and explain why you'd want them
>>* vote on things you'd like to see
>>* pick up tasks that sound interesting
>>
>> Let's try to make this work!
>>
>> -- Don
>
> A library for spatial data structures would be nice (Octree etc).
>
>
> ___
> 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] Dr Dobbs: Time to get good at functional programming

2008-12-07 Thread Jeff Heard
Seen on Slashdot:

http://www.ddj.com/development-tools/212201710;jsessionid=3MQLTTYJRPL3CQSNDLRSKH0CJUNN2JVN
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] library to process zip files

2008-12-03 Thread Jeff Heard
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/zip-archive

On Wed, Dec 3, 2008 at 5:59 PM, Yuriy <[EMAIL PROTECTED]> wrote:
> On Thu, Dec 04, 2008 at 11:56:10AM +1300, Yuriy wrote:
> Hi,
>
> Is there any haskell library to work with ZIP file format?
>
> Thanks,
> Yuriy
> ___
> 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] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-23 Thread Jeff Heard
Duncan, what kind of help do you need on the Haskell Platform install?
 I have access to VMs running windows XP and Vista.

On Sun, Nov 23, 2008 at 8:12 AM, Duncan Coutts
<[EMAIL PROTECTED]> wrote:
> On Sun, 2008-11-23 at 08:00 -0500, Paul L wrote:
>> On 11/23/08, Duncan Coutts <[EMAIL PROTECTED]> wrote:
>> >> 2. It still wouldn't work for the OpenGL package on Windows, because
>> >> the configure scripts require a Unix-style built environment
>> >> (MinGW/MinSys or Cygwin).
>> >
>> > Yes, building it requires mingw/msys, but with it cabal install opengl
>> > really does work (I've tried it).
>>
>> Sure, I don't doubt it. The real trouble is the extra dependency to
>> MinGW/MinSys.
>> I'm reluctant to tell my users to go installing them just for the sake
>> of compiling HOpenGL.
>
> Sure, we're currently in an intermediate situation where the ghc release
> is smaller but we've not had the first platform release yet.
>
> We're only suggesting cabal install opengl on windows for developers,
> not for your users.
>
>> On a side note, since GHC installation for Windows contains a version
>> of gcc, I wonder how hard it would be to replace the autoconf
>> compilation of HOPenGL with just cabal. Then we'll get rid of the
>> MinGW/MinSys depedency all together. Isn't it the purpose of cabal to
>> replace non-portable build systems (for Haskell at least)?
>
> That may well be possible and wherever it is possible we should do it.
> The MinGW dependency is certainly a pain. Consider this an invitation
> for anyone to go take a look at the configure scripts for these packages
> and see how easy they'd be to replace with pure Haskell in the Setup.hs.
>
> Duncan
>
> ___
> 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] Re: [Haskell] GHC 6.10 and OpenGL

2008-11-22 Thread Jeff Heard
I'm not sure..  can MSVC compiled libraries be intermixed with mingwin
libraries?  I see Conal has advised installing mingwin as part of his
GLUT packaging.

-- Jeff


On Sat, Nov 22, 2008 at 7:06 PM, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:
>>$ cabal install OpenGL
>
> HOpenGL installs easily with cabal-install, but most HOpenGL examples
> and tutorials also use GLUT, which is not so painless on Windows.
> Luckily Conal Elliot just recently posted detailed instructions of how
> to do it:
>
> http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/
>
> -Greg
>
>
>
> On Sat, Nov 22, 2008 at 12:34 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
>> ninegua:
>>> Hi everyone,
>>>
>>> It's sad to see the OpenGL binding being dropped from GHC binary
>>> installers starting from 6.10. Though this issue has been brought up
>>> and discussed before, I'm sure a lot of people who based their work on
>>> OpenGL would share the same sympathy.
>>
>>$ cabal install OpenGL
>>
>>> I'm not here to argue whether this decision by GHC dev team is right
>>> or wrong, but what's really causing the pain is that the OpenGL
>>> binding doesn't have its own binary installer for Windows, and
>>> compilation from source on this platform is non-trivial. I wouldn't
>>> recommend doing it for ordinary users.
>>
>>> So my question is, are we going to see a binary installer for OpenGL
>>> binding provided separately from either HOpenGL site, or Hackage? Or
>>> even the GHC installation page?
>>
>> This would be a job for the Windows distribution team to sort out.
>> Each other distro addresses the native packaging problem by developing
>> packages, and what is needed for a similar team for Windows, to provide
>> Windows packages.
>>
>> -- Don
>> ___
>> 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


[Haskell-cafe] Re: Problem with GTK on OS X -- installed from source

2008-11-20 Thread Jeff Heard
Here we go again.  App finally linked, but then I get this error:

jeff-heards-macbook:IlluminateGL jeff$ ./Illuminate
dyld: lazy symbol binding failed: Symbol not found: _glXQueryExtension
  Referenced from: /opt/local/lib/libgdkglext-x11-1.0.0.dylib
  Expected in: flat namespace

dyld: Symbol not found: _glXQueryExtension
  Referenced from: /opt/local/lib/libgdkglext-x11-1.0.0.dylib
  Expected in: flat namespace

Trace/BPT trap

I rebuilt gtk2hs to make sure, with --enable-opengl, and I stlll get
the error.  Any ideas?

On Thu, Nov 20, 2008 at 2:18 PM, Jeff Heard <[EMAIL PROTECTED]> wrote:
> Building my app with gtk2hs, I get the following error when I try to
> compile a file that uses Template Haskell (I'm not using TH to do
> anythign with GTK, but it loads the package anyway)
>
> Loading package gtk-0.9.13 ... : can't load .so/.DLL
> for: gthread-2.0 (dlopen(libgthread-2.0.dylib, 10): image not found)
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Problem with GTK on OS X -- installed from source

2008-11-20 Thread Jeff Heard
Building my app with gtk2hs, I get the following error when I try to
compile a file that uses Template Haskell (I'm not using TH to do
anythign with GTK, but it loads the package anyway)

Loading package gtk-0.9.13 ... : can't load .so/.DLL
for: gthread-2.0 (dlopen(libgthread-2.0.dylib, 10): image not found)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


  1   2   >