Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Ketil Malde
"Galchin, Vasili" <[EMAIL PROTECTED]> writes: > ok guys .. what is this "phantom type" concept? Is it a type theory thing or > just Haskell type concept? Here's another example. Say you want to use bytestrings with different encodings. You obviously don't want to concatenate a string representi

Re: [Haskell-cafe] Data Types a la Carte - automatic injections (help!)

2008-07-28 Thread Nicolas Frisby
I have accomplished this in two ways. Either drop the reflexive rule and introduce a void sentinel type or use TypeEq (... you said everything was fair game!) to explicitly specify the preference for the reflexive case over the inductive case. An advantage of TypeEq is that you can avoid overlappin

Re: [Haskell-cafe] Data Types a la Carte - automatic injections (help!)

2008-07-28 Thread Brandon S. Allbery KF8NH
On 2008 Jul 28, at 23:23, Kenn Knowles wrote: What confuses me is that IncoherentInstances is on, but it is still rejected by GHC 6.8.3 seemingly for being incoherent. I haven't tried it with any other version. Am I missing something? Any suggestions or pointers? Er? Looks to me like it w

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL familyof libraries fromextralibs

2008-07-28 Thread scodil
I'll chime in with a "me too". I use Haskell and OpenGL for prototyping scientific visualization software, 3D models and such. Not that I think it couldn't be used for production software, its just that I just don't produce much :) The library really is fantastic. I don't think it gets enough fan

[Haskell-cafe] Data Types a la Carte - automatic injections (help!)

2008-07-28 Thread Kenn Knowles
I have a question about Data Types a la Carte (http://www.cs.nott.ac.uk/~wss/Publications/DataTypesALaCarte.pdf) and more generally hacking smart coproduct injections into Haskell (all extensions are fair game). > {-# LANGUAGE > MultiParamTypeClasses,TypeOperators,UndecidableInstances,IncoherentI

[Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-28 Thread Benjamin L . Russell
On Mon, 28 Jul 2008 11:52:43 -0700, "Tim Chevalier" <[EMAIL PROTECTED]> wrote: >I've only read the beginning, but I recommend _Conceptual Mathematics_ >by Lawvere and Schanuel for a *very* gentle introduction (seriously, >you could probably teach category theory to ten-year-olds out of this >book.

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Austin Seipp
Excerpts from Galchin, Vasili's message of Mon Jul 28 21:14:56 -0500 2008: > ok guys .. what is this "phantom type" concept? Is it a type theory thing or > just Haskell type concept? > > Vasili Phantom types are more of an idiom than anything else; they are types with no real concrete representat

Re: [Haskell-cafe] ANN: RandomDotOrg-0.1

2008-07-28 Thread Don Stewart
mad.one: > Hi, > > I've just uploaded a package to hackage which is an interface to the > random.org random number generator. > > For those who don't know, random.org provides random data through the > use of atmospheric noise rather than a PRNG that would typically be > invoked if you were to us

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Galchin, Vasili
ok guys .. what is this "phantom type" concept? Is it a type theory thing or just Haskell type concept? Vasili On Mon, Jul 28, 2008 at 8:53 PM, Bryan Donlan <[EMAIL PROTECTED]> wrote: > On Mon, Jul 28, 2008 at 08:48:23PM -0500, Galchin, Vasili wrote: > > what does a datatype with no constructors

[Haskell-cafe] ANN: RandomDotOrg-0.1

2008-07-28 Thread Austin Seipp
Hi, I've just uploaded a package to hackage which is an interface to the random.org random number generator. For those who don't know, random.org provides random data through the use of atmospheric noise rather than a PRNG that would typically be invoked if you were to use the System.Random modul

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Bryan Donlan
On Mon, Jul 28, 2008 at 08:48:23PM -0500, Galchin, Vasili wrote: > what does a datatype with no constructors mean? > > E.g. > > data RSAStruct > data EVP_PKEY > data EVP_CIPHER > data EVP_CIPHER_CTX > data EVP_MD_CTX > data EVP_MD > data BIGNUM It's simply a datatype that can never have a value

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Galchin, Vasili
what does a datatype with no constructors mean? E.g. data RSAStruct data EVP_PKEY data EVP_CIPHER data EVP_CIPHER_CTX data EVP_MD_CTX data EVP_MD data BIGNUM On Mon, Jul 28, 2008 at 8:01 PM, Felipe Lessa <[EMAIL PROTECTED]>wrote: > 2008/7/28 Galchin, Vasili <[EMAIL PROTECTED]>: > >> and we're

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Galchin, Vasili
Thanks, Felipe. On Mon, Jul 28, 2008 at 8:01 PM, Felipe Lessa <[EMAIL PROTECTED]>wrote: > 2008/7/28 Galchin, Vasili <[EMAIL PROTECTED]>: > >> and we're suggesting instead: > >> > >> newtype AIOCB = AIOCB (ForeignPtr AIOCB) > > > > ^^^ I am somewhat new to Haskell. Not a total newbie! But

[Haskell-cafe] Using fundeps to resolve polymorphic types to concrete types

2008-07-28 Thread Bryan Donlan
Hi, Is there any theoretical reason that functional dependencies can't be used to resolve a polymorphic type to a concrete type? For example: > -- compile with -fglasgow-exts > > class DeriveType a b | a -> b > > data A = A > data B = B > > instance DeriveType A B > > simpleNarrow :: DeriveT

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Felipe Lessa
2008/7/28 Galchin, Vasili <[EMAIL PROTECTED]>: >> and we're suggesting instead: >> >> newtype AIOCB = AIOCB (ForeignPtr AIOCB) > > ^^^ I am somewhat new to Haskell. Not a total newbie! But what exactly > does the above mean? Are the three references of "AIOCB" in different > namespaces? The

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Galchin, Vasili
> So at the moment you're using using Storable and a Haskell record, say: > > data AIOCB = AIOCB { >... > } > > and we're suggesting instead: > > newtype AIOCB = AIOCB (ForeignPtr AIOCB) ^^^ I am somewhat new to Haskell. Not a total newbie! But what exactly does the above mean? Are the

Re: [Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-28 Thread Luke Palmer
On Mon, Jul 28, 2008 at 5:04 AM, Benjamin L. Russell <[EMAIL PROTECTED]> wrote: > Category Theory Lecture Notes for ESSLLI > Michael Barr, Department of Mathematics and Statistics, McGill > University > Charles Wells, Department of Mathematics, Case Western Reserve > University > http://www.math.up

Re: [Haskell-cafe] Cabal and Strings and CPP

2008-07-28 Thread Duncan Coutts
On Mon, 2008-07-28 at 15:02 -0700, Philip Weaver wrote: > However, passing the same CPP definition via cabal does not work. > >runhaskell Setup.hs build --ghc-options=-DFOO="\"hello world\"" > >runhaskell Setup.hs build --ghc-options=-DFOO='"hello world"' > > With either of these comma

[Haskell-cafe] Cabal and Strings and CPP

2008-07-28 Thread Philip Weaver
Hello all, I'm trying to use CPP-defined strings in a Haskell module, like this: main :: IO () main = putStrLn FOO This of course will not work: ghc -DFOO="hello world" --make Main.hs -o test You'll get this error message: ./Main.hs:6:16: Not in scope: `hello' ./Main.hs:6:22: N

[Haskell-cafe] Re: [Haskell] Re: ANN: Hayoo! beta 0.2

2008-07-28 Thread Neil Mitchell
Hi >> Any suggestions and feedback is highly welcomed. > > Well, it is currently not in a usable state: the page randomly inserts funny > characters into the text input field. (I'm using Konqueror) It also deletes characters in some cases in the text input field using Opera. Still very impressiv

Re: [Haskell-cafe] Best book/tutorial on category theory and its applications

2008-07-28 Thread Dan Piponi
fero asked: > Hi, > I would like to buy some booke on category theory and its applications. Can > you recommend me the best? I got a lot out of Basic Category Theory for Computer Scientists by Benjamin C. Pierce. Short and with examples biased towards CS. No monads but it covers the essentials wi

Re: [Haskell-cafe] Best book/tutorial on category theory and its applications

2008-07-28 Thread Tim Chevalier
I've only read the beginning, but I recommend _Conceptual Mathematics_ by Lawvere and Schanuel for a *very* gentle introduction (seriously, you could probably teach category theory to ten-year-olds out of this book.) Nothing about applications there, though. Cheers, Tim -- Tim Chevalier * http:/

Re: [Haskell-cafe] Libevent FFI problems

2008-07-28 Thread Adam Langley
On Sat, Jul 26, 2008 at 4:34 AM, Levi Greenspan <[EMAIL PROTECTED]> wrote: > client: internal error: awaitEvent: descriptor out of range >(GHC version 6.8.3 for i386_unknown_linux) >Please report this as a GHC bug: > http://www.haskell.org/ghc/reportabug > Aborted > > This is caused by havi

[Haskell-cafe] ANN: Mueval 0.3.1, 0.4, 0.4.5, 0.4.6, 0.5

2008-07-28 Thread Gwern Branwen
Hi everyone. So there've been a number of releases of Mueval lately. I figured I'd tell you about them. WHERE As always, you can 'cabal install mueval', or get it from Hackage , or get it from the new Darcs repository

Re: [Haskell-cafe] Literate program implementing text editor

2008-07-28 Thread Niels Aan de Brugh
Duncan Coutts wrote: On Wed, 2008-07-23 at 21:05 +0100, Eric wrote: Hi all, I wanted to embark on a Haskell program that implements a simple text editor. Before doing so, however, I thought that I should ask: Does anyone know of a literate Haskell program already in existence that does th

Re: [Haskell-cafe] Re: [HOpenGL] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-28 Thread Jefferson Heard
Right. Just got back from being on travel, but the bug was that genNames hangs and fails to return on WinXP 32 when trying to return display list objects. It turns out that you can pretend that display lists are already allocated with most video cards, so it's not a big deal, but it was a serious

Re: [Haskell-cafe] Control.Concurrent.forkIO versus Control.Parallel.par

2008-07-28 Thread Mario Blazevic
Sterling Clover wrote: I think a better way to look at it is that Haskell has two separate mechanisms for different *notions* of concurrency -- forkIO for actual concurrent computation which needs explicit threads and communication (and within that, either semaphore-based communication with MVa

Re: [Haskell-cafe] Re: ANN: Yi 0.4.1

2008-07-28 Thread Duncan Coutts
On Mon, 2008-07-28 at 07:39 +, Jean-Philippe Bernardy wrote: > Niklas Broberg gmail.com> writes: > > > > > > The gtk frontend should not suffer from this: > > > > > > yi -fgtk > > > > C:\Documents and Settings\Niklas Broberg>yi -fgtk > > yi: exception :: System.Glib.GError.GError > > I'm

Re: [Haskell-cafe] Cabal files on Windows

2008-07-28 Thread Duncan Coutts
On Sun, 2008-07-27 at 21:01 -0500, John Lato wrote: > On Sun, Jul 27, 2008 at 3:25 PM, Duncan Coutts > > Use Haskell String syntax for paths that contain spaces: > > > > include-dirs: "C:\\Program Files\\program\\include" > > Hi Duncan, > > Thanks, this worked (mostly). Although I had to chan

Re: [Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-28 Thread frantisek kocun
Thanks Benjamin, especially for http://haskell.org/haskellwiki/Category_theory#See_also and I found there Haskell wiki. I will take a look at the books as well. Fero On Mon, Jul 28, 2008 at 2:14 PM, Benjamin L. Russell <[EMAIL PROTECTED] > wrote: > On Mon, 28 Jul 2008 20:04:17 +0900, Benjamin L.

[Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-28 Thread Benjamin L . Russell
On Mon, 28 Jul 2008 20:04:17 +0900, Benjamin L.Russell <[EMAIL PROTECTED]> wrote: >>What do you think about "Categories and Computer Science (Cambridge Computer >>Science Texts)" at >>http://www.amazon.com/Categories-Computer-Science-Cambridge-Texts/dp/0521422264/ref=si3_rdr_bb_product >>? > >I h

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-28 Thread Ian Lynagh
On Fri, Jul 25, 2008 at 01:47:25PM -0400, Jefferson Heard wrote: > > Is there a list of outstanding bugs somewhere? A few of these are OpenGL/GLUT/OpenAL/ALUT bugs: http://hackage.haskell.org/trac/ghc/query?status=new&status=assigned&status=reopened&component=libraries+%28other%29&order=priority

[Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-28 Thread Benjamin L . Russell
On Mon, 28 Jul 2008 01:41:50 -0700 (PDT), fero <[EMAIL PROTECTED]> wrote: > >Hi, >I would like to buy some booke on category theory and its applications. Can >you recommend me the best? Recently, I had to study some category theory in order to prepare for a local category theory study group meet

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Galchin, Vasili
Brandon, Your reading on my code is quite correct. So you are suggesting that the Haskell aiocb contain a ForeignPtr to actual aiocb that is passed the C functions. In this scenario, whose responsibility to allocate the "chunk" of memory for the aiocb? Vasili On Mon, Jul 28, 2008 at 2:04 A

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-28 Thread Malcolm Wallace
> FYI: Haskell's OpenGL binding has just been dropped from GHC's > extralibs, which means that it will no longer be kept in sync with GHC > development, at least not by GHC HQ. > > GHC HQ has its hands full and -generally speaking - extralibs are to > be replaced by H(L)P, the Haskell (Library) Pl

[Haskell-cafe] [Haskell Beginner] Compiling wxhaskell fails for me

2008-07-28 Thread Daniel Kahlenberg
Hi, I try to build the current wxhaskell stuff from the darcs repository on the sh provided by msys with mingw32 (`uname -a' : MINGW32_NT-5.1 ... 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys), but it fails with the message `wx/graphics.h' isn't found, when it comes to build the wxc part. On the wx

[Haskell-cafe] Best book/tutorial on category theory and its applications

2008-07-28 Thread fero
Hi, I would like to buy some booke on category theory and its applications. Can you recommend me the best? Here is what I like: 1. Easy to understatnd, concise book. I like e.g. "Gentle introduction to Haskell" it was quite good with a little of text. There are bigger tutorials in number of page

[Haskell-cafe] Re: ANN: Yi 0.4.1

2008-07-28 Thread Jean-Philippe Bernardy
stefan kersten k-hornz.de> writes: > any ideas what's going wrong? is it finally time to upgrade my ghc > installation? Yep; I think this is fixed in later GHCs. -- JP ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mai

[Haskell-cafe] Re: ANN: Yi 0.4.1

2008-07-28 Thread Jean-Philippe Bernardy
Niklas Broberg gmail.com> writes: > > > The gtk frontend should not suffer from this: > > > > yi -fgtk > > C:\Documents and Settings\Niklas Broberg>yi -fgtk > yi: exception :: System.Glib.GError.GError I'm out of ideas. Maybe you could ask Krasimir Angelov, which did the win32 port. > ps. If

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Brandon S. Allbery KF8NH
On 2008 Jul 28, at 2:41, Galchin, Vasili wrote: So based on what you are saying I kind of need a Haskell AIO "imperative"/monadic function that basically returns a handle that is associated with this AIOCB chunk-of-memory This handle gets passed around during an AIO I/O session??

Re: [Haskell-cafe] carry "state" around ....

2008-07-28 Thread Brandon S. Allbery KF8NH
On 2008 Jul 28, at 2:36, Galchin, Vasili wrote: Hi Brandon, So even if I go to ForeignPtr is a problem? And/Or is this a "by reference" vs "by value" issue? As I read your code, you're allocating a C object, poking the Haskell fields into it, and passing it on, then peeking the va