[Haskell-cafe] [Off-topic]Functional parsing theory

2010-10-06 Thread Maurí­cio CA
Hi, all, I've been working in a tool that reads a grammar with associated actions and act on input based on that grammar. I would like to rewrite it in a functional style, but I've not been able to find a theory that would handle any possible grammar with cyclicity and empty productions, and flex

[Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-23 Thread Maurí­cio CA
Sure, Huffman was actually my first tought. But I couldn't think of a pratical display for the result of Huffman encoding that could be easily followed by a human looking at the screen. Since it's an optimal code, letters would not be grouped in alphabetical order. There is a compromise. There i

[Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA
bitspeak is a small proof of concept application that allows writing text using only two commands (yes/no, 1/2, top/down etc.). There is a parallel between data compression algorithms and this sort of task, expressing a sentence in the minimal number of bits via compression also minimized the nu

[Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA
bitspeak is a small proof of concept application that allows writing text using only two commands (yes/no, 1/2, top/down etc.). Looks cool! Did you forget any dependencies tho? I get the following error: Oops... Three modules ended up missing in .cabal file. Just uploaded 0.0.2 to hackage, it

[Haskell-cafe] ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA
Hi, all, bitspeak is a small proof of concept application that allows writing text using only two commands (yes/no, 1/2, top/down etc.). It is intended to show how people with disabilities similar to Stephen Hawking's (i.e., good cognitive hability, but very few movements) can write text. http

[Haskell-cafe] Embedded funcional programming?

2010-04-17 Thread Maurí­cio CA
Hi, all, I've beeing working with some people who do programming for wireless devices. 100% of their code uses C, and I would like to show them nice things they could do with funcional programming (not necessarily Haskell. I believe, say, Standard ML could be also very nice.) I'm new to this, so

[Haskell-cafe] Re: GPL answers from the SFLC (WAS: Re: ANN: hakyll-0.1)

2010-03-05 Thread Maurí­cio CA
> To my knowledge, the LGPL only allows *linking* with non-(L)GPL > software. But GHC doesn't just link but performs massive > cross-module inlining. So in my opinion, LGPL is not a solution, > too. Use BSD3! But that massive cross-module inlining happens at your computer, where the rights allowe

[Haskell-cafe] Re: Using Haskell's FFI to send ancillary data over Unix domain sockets

2010-03-05 Thread Maurí­cio CA
> For me, this presents a few problems. I don't know where to get > the SCM_CREDENTIALS constant, I have no idea what flags to use > (does the Network module help with that?), I don't know how to > get from a list of file descriptors or a tuple to a Ptr, and > perhaps most importantly, I have no i

[Haskell-cafe] Re: do we need types?

2010-02-26 Thread Maurí­cio CA
A type class is a relation between types. Yes, but not officially, just de facto: http://hackage.haskell.org/trac/haskell-prime/ticket/90 Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/

[Haskell-cafe] Hackage download statistis

2010-02-11 Thread Maurí­cio CA
Hi, all, Some time ago a download statistic of hackage was made available, and analysed in a few ways. Googling for it still find that at a Galois web page. I though that, since the tools to get that were there, this would be output once in a while, but it seems it hasn't been done since then.

[Haskell-cafe] Re: Using Cabal during development

2010-02-11 Thread Maurí­cio CA
> Eventually, I think using cabal during development may be > convenient. The only drawback is that you have to specify each > dependency and -- above all -- every module each time you add > one. When writing bindings-posix, bindings-glib etc., which have lots of modules, I used a shell script to

[Haskell-cafe] Re: GUI programming

2010-02-04 Thread Maurí­cio CA
> The problem is that the GUI code has become very ugly and I'm > tempted to rewrite it totally. I've been looking forward to the > FRP stuff, but I've never seen a single definition of the term. > Conal Eliot's "denotational programming" is too general to be > definition. I want to try Grapefruit

[Haskell-cafe] Re: C functional programming techniques?

2010-01-30 Thread Maurí­cio CA
>> Sorry if this looks weird, but do you know of experiences with >> functional programming, or "type programming", with C? > I would use a higher level language to emit valid C. Basically, > use a strongly typed macro language. "All" you will have to > prove is that your emitter produces type sa

[Haskell-cafe] C functional programming techniques?

2010-01-29 Thread Maurí­cio CA
Hi, all, Sorry if this looks weird, but do you know of experiences with functional programming, or "type programming", with C? Using macro tricks or just good specifications? I know this is not absurd to a small extent. I've heard of proof tool certificated C code on the net (although I don't un

[Haskell-cafe] Re: ANN: bindings-DSL 1.0.4 (Category: FFI)

2010-01-28 Thread Maurí­cio CA
>> Here is my attempt. I added #callconv macro, that accepts >> a calling convention parameter. The lines below are now >> equivalent. > Builds fine here and looks reasonably fine. Okay. Package uploaded, documentation updated. Best, Maurício ___ Ha

[Haskell-cafe] Re: ANN: bindings-DSL 1.0.4 (Category: FFI)

2010-01-28 Thread Maurí­cio CA
>> http://hackage.haskell.org/package/bindings-DSL >> http://bitbucket.org/mauricio/bindings-dsl > The only thing I've missed for now is a #ccall equivalence > for "stdcall" functions, I hacked one up myself and called it > #stdcall, but it would be nice to have in the package proper if > pos

[Haskell-cafe] ANN: bindings-DSL 1.0.4 (Category: FFI)

2010-01-22 Thread Maurí­cio CA
Hi, bindings-DSL is a mature and well documented preprocessor domain specific language you can use to generate bindings to a C API. It's based on functionality provided by hsc2hs. These are links to Hackage page and documentation: http://hackage.haskell.org/package/bindings-DSL http://bitbuc

[Haskell-cafe] Re: changelogs for packages on Hackage

2009-12-16 Thread Maurí­cio CA
Some packages have a changelog file in them that we could display, though most don't. Debian policy requires changelogs of standard format. Most packages use a well known version control system (darcs, mercurial etc.). Cabal also has fields helping identifying where in vcs history are each ve

[Haskell-cafe] Re: consulting and contracting

2009-12-15 Thread Maurí­cio CA
>> I was wondering how many haskell consultants and contractors >> (ie. freelance programmers) there are and how much demand there >> is for their work. > > I've done three Haskell contracts last year and this year, all > in the financial industry in the New York area. Two of them were > for the s

[Haskell-cafe] Re: Checking dependencies from C packages in cabal

2009-12-09 Thread Maurí­cio CA
> Until you get the perfect answer you may want to have a look at > the cabal definitions of > > zlib digest OpenGLRaw GLUT readline GLFW wxcore terminfo > berkeleydb BerkeleyDB hubris pcre-light HDBC-mysql HDBC-sqlite3 > HDBC-odbc HDBC-postgresql I do know them. But they just include needed .h a

[Haskell-cafe] Checking dependencies from C packages in cabal

2009-12-09 Thread Maurí­cio CA
Hi, all, When pkg-config info is not available for a library (when I could use pkgconfig-depends), what should I use to check if needed libraries are installed and to give the compiler all needed info about include files and library location? Also, is it possible to do that without configure and

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-07 Thread Maurí­cio CA
> To reply to an earlier point of Andrew's (I can't find the quote > now, sorry), one of the biggest difficulties developers face > on Windows is the lack of common install locations/practices. > Windows software is usually distributed as a binary, which may > or may not include header files. Thes

[Haskell-cafe] Re: Do you need Windows USB in Haskell?

2009-12-07 Thread Maurí­cio CA
> I don't need usb and I can't say I'm a windows user, but I'd > be glad to test it since I have it on a virtual machine. In my > case, installation fails on "bindings-common". bindings-common fails on windows due to an old version of C library with GHC's windows version of gcc. Current version o

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-06 Thread Maurí­cio CA
> I guess there's a difference in culture here. > > On Unix, it is usual to distribute programs as source, and build > from source. I see more than a cultural issue here. Suppose you write bindings to somelib-1.0.2, and release it with somelib-1.0.2. Then, somelib-1.0.3 is released to solve a se

[Haskell-cafe] Re: Binding to C in Windows (was: Low Level Audio - Writing bytes to the sound card?)

2009-12-05 Thread Maurí­cio CA
> Unfortunately, I've yet to find a single Haskell package that > binds to C which will actually compile on Windows. :-( Do you know how can we check dependencies to C libraries in Windows? Is pkg-config available? What about packages with no pkg-config configuration? Thanks, Maurício _

[Haskell-cafe] Do you need Windows USB in Haskell?

2009-12-05 Thread Maurí­cio CA
Hi, I keep this direct binding to libusb-1.0.x: http://hackage.haskell.org/package/bindings-libusb on top of which Bas maintains a nice USB library: http://hackage.haskell.org/package/usb Work has been done to support libusb-1.0.x in Windows. So, as long as my bindings-libusb works proper

[Haskell-cafe] Re: I miss OO

2009-11-25 Thread Maurí­cio CA
> Python: > note1.time() > cursor1.time() > staff1.time() > > (...) > > So I'm thinking of moving to a scheme in Haskell using modules, > most types being defined in their own modules, and doing > qualified imports. Generic names like 'time' can be defined in > each module w/o clashing. > > (..

[Haskell-cafe] Re: Haskell Weekly News: Issue 140 - November 22, 2009

2009-11-24 Thread Maurí­cio CA
> Incidentally, I've always wondered about the politically correct > way of referring to this programming language (and related > implementation in the above-mentioned type system) in academic > circles; Is this a question of politically correctness? Since there's no discrimination or prejudice i

[Haskell-cafe] Re: How does cabal determine version ranges in the dependencies?

2009-11-23 Thread Maurí­cio CA
If it doesn't break dependencies, it won't be called http 4001, it will be called 4000.0.9 :) Check: http://www.haskell.org/haskellwiki/Package_versioning_policy I see. Thanks for the link. I wasn't aware of the versioning policy. Just to clarify though, wouldn't the next higher major version

[Haskell-cafe] Re: Idea for a very simple GUI llibrary

2009-11-23 Thread Maurí­cio CA
Thinking of a parallel with Java for a second, is there a GUI library out there that's structured like Java Swing? Meaning, there is a GUI library that has a small platform-specific GUI foundation (e.g. a per platform implementation of the core AWT functionality) and the rest of the functionali

[Haskell-cafe] Re: How does cabal determine version ranges in the dependencies?

2009-11-23 Thread Maurí­cio CA
> I recently started porting cabal-install to Freebsd. When > I looked at its dependencies on hackage, I noticed HTTP > (>=4000.0.2 && <4001). However the latest HTTP version on > hackage is 4000.0.8. That struck me as kinda odd. How can cabal > tell that it won't be compatible with HTTP version 4

[Haskell-cafe] Re: Idea for a very simple GUI llibrary

2009-11-23 Thread Maurí­cio CA
> Nice idea. I will try it if you write runGUI :-) Sure, just let me know :) If this is to be done, I think it's better that the person writing the Haskell code do not write runGUI, so the implementation details wouln't discourage ideas that make life easier for users. > This is an imperative s

[Haskell-cafe] Idea for a very simple GUI llibrary

2009-11-22 Thread Maurí­cio CA
Hi, Here is a sketch for a library with these properties: -> Easy to test. All Haskell code can be tested in a text terminal. Also, testing code that uses the library can also be done without using a GUI. -> Extremely easy to document and use. -> Not even close to Gtk2hs power, but enough for

[Haskell-cafe] Re: ANN: bindings-SDL 1.0.2, the domain specific language for FFI description

2009-11-19 Thread Maurí­cio CA
> I had two structs, one of which used the other as a field type. > I was using the generated identifier of the first as the type > for the second, so it had the form c'STRUCT_NAME. So the field > macro looked like this: > > #field foo , c'STRUCT_NAME > > It did not like this, complaining about

[Haskell-cafe] Re: ANN: bindings-SDL 1.0.2, the domain specific language for FFI description

2009-11-19 Thread Maurí­cio CA
> I did not notice when this was released, but I saw it on Hackage > yesterday and, with it, wrote some of the easiest bindings to a > fairly complex C API I've written in a while. This package is > excellent! Thank you for sharing it. Thanks. My hope is that it saves as much time from users as t

[Haskell-cafe] ANN: bindings-SDL 1.0.2, the domain specific language for FFI description

2009-11-16 Thread Maurí­cio CA
Hi, This package is to be used with hsc2hs. (hsc2hs is called automatically if you use Cabal.) It's a self-contained set of macros used to create a Haskell wrap for a C interface. They follow the idea that it's better to have a C-like wrap code first and then write Haskell-like code on top of tha

[Haskell-cafe] How much time until dependencies are rebuilt in hackage?

2009-11-14 Thread Maurí­cio CA
Suppose package B depends on A. If a new version of A is uploaded to hackage, how much later package B will be rebuilt (either to show a problem with the new version or to solve a problem with a previous version of A)? Thanks, Maurício ___ Haskell-Cafe

[Haskell-cafe] Re: Weird dependency failure log

2009-11-13 Thread Maurí­cio CA
>> > Header files are associated with a library. >> > If there is no library then nothing gets >> > registered. This is by design. >> > If it's not a library, nothing can depend on >> > it. >> But please tell me then where my package fits. > I'm not sure I understand the question. Can you

[Haskell-cafe] Re: Weird dependency failure log

2009-11-13 Thread Maurí­cio CA
>>> This is a package with no library and no executables. That's >>> not supposed to work. >> Why shouldn't this be supposed to work? It does install needed >> files (two include files for hsc2hs), and they do stand for >> themselves to justify a package of its own. > Header files are associated

[Haskell-cafe] Re: Could someone teach me why we use Data.Monoid?

2009-11-13 Thread Maurí­cio CA
I have looked the concept of monoid and something related, but still, I do not know why we use it? I don't know if it's a good example, but it's simple. This package I wrote uses reverse polish notation to write gtk2hs layout windows. http://hackage.haskell.org/package/gtk2hs-rpn Since the t

[Haskell-cafe] Re: Weird dependency failure log

2009-11-13 Thread Maurí­cio CA
There's one thing special about bindings-DSL. It's a package with a set of macros for hsc2hs, and contains no Haskell code. Maybe this revealed some hidden error in package dependency checking. This is a package with no library and no executables. That's not supposed to work. It contains hsc2h

[Haskell-cafe] Weird dependency failure log

2009-11-12 Thread Maurí­cio CA
Hi, all, Hackage shows a log failure for 'bindings-gsl': Configuring bindings-gsl-0.1.1... cabal-setup: At least the following dependencies are missing: bindings-DSL ==1.0.* But here is, at version 1.0.1, no building problems: http://hackage.haskell.org/package/bindings-DSL T

[Haskell-cafe] Sending patches to ghc related repositories

2009-11-10 Thread Maurí­cio CA
Hi, all, I just tried to send a patch to a ghc tool. I see in hackage that the maintainer e-mail is 'cvs-fpto...@haskell.org' (package is hsc2hs). I tried sending darcs patch to this e-mail, but it's refused as it's not on that server allowed e-mails table. The patch isn't really important, just

[Haskell-cafe] Re: Nice addition to Foreign: castAny

2009-11-07 Thread Maurí­cio CA
castAny :: (Storable a, Storable b) => a -> b castAny = unsafePerformIO . genericCast where genericCast :: (Storable a, Storable b) => a -> IO b genericCast v = return undefined >>= \r -> allocaBytes (max (sizeOf v) (sizeOf r)) $ \p -> poke p v >> if False then return r els

[Haskell-cafe] Re: Marshalling arrays without flakiness? (poke example)

2009-10-29 Thread Maurí­cio CA
>> I would like to know whether there is a good way to marshal the >> following structure to C without using pointer arithmetic done >> by a programmer (as opposed to a tool). Here is an example with poke. It's completely useless, except for demonstration :) You have a global variable in C that r

[Haskell-cafe] Re: Marshalling arrays without flakiness?

2009-10-29 Thread Maurí­cio CA
I would like to know whether there is a good way to marshal the following structure to C without using pointer arithmetic done by a programmer (as opposed to a tool). typedef struct{ double a[10]; double b[10]; double b[10]; } foo; With my my 'bindings-common' package it's done like

[Haskell-cafe] C headers in cabal dependencies

2009-10-28 Thread Maurí­cio CA
Hi, I've been using 'install-includes' in a package. I sometimes make small changes to those include files, and I've seen that cabal doesn't consider then dependencies, i.e., doesn't rebuild .hsc files depending on then. I'm not sure if this is an error, as parsing hsc2hs input may not be cabal

[Haskell-cafe] Nice addition to Foreign: castAny

2009-10-26 Thread Maurí­cio CA
This could be beside castPtr, castCharToCChar etc. castAny :: (Storable a, Storable b) => a -> b castAny = unsafePerformIO . genericCast where genericCast :: (Storable a, Storable b) => a -> IO b genericCast v = return undefined >>= \r -> allocaBytes (max (sizeOf v) (sizeOf

[Haskell-cafe] Re: Word128, Word256

2009-10-26 Thread Maurí­cio CA
To have it defined is one thing. To actually implement i128 and i256 is quite another thing. Are you willing to actually do all of the work necessary to implement the unboxed i128 code? Dream away! John Meacham also told me that even if I get there, it wouldn't do what I want (use it to suppo

[Haskell-cafe] Re: CComplex in jhc (was: Word128, Word256)

2009-10-25 Thread Maurí­cio CA
>>> Something like 'CComplex CDouble' has been proposed before... >> 2) Since all (few) answers were favorable, should I ask for a >> ticket to be created? How? > Well, before trying to get it standardized, you need to get it > implemented and tested by at least one compiler to explore the > des

[Haskell-cafe] Re: A 3 line program --> Reid, Don, Daniel

2009-10-24 Thread Maurí­cio CA
Philippos, Doesn't the line below means everything to be interpreted will be considered as latin1? \usepackage[latin1]{inputenc} Unicode as UTF-8 won't fit here. I would sugest transfering the problem to latex. Why not to print 'fa\c cade' instead of 'façade'? It's 7 bits and will never fail

[Haskell-cafe] Re: Word128, Word256

2009-10-24 Thread Maurí­cio CA
Something like 'CComplex CDouble' has been proposed before... I know, I started most of the discussions :) The wiki says before asking for a ticket I should try to talk about it in the mailing list. My attempts never got much attention, but all replies gave favorable answers. Last week, though,

[Haskell-cafe] Word128, Word256

2009-10-22 Thread Maurí­cio CA
Hi, Do you think we could have the range of sizes for Int* and Word* expanded to allow also 128 and 256 bits sizes? My reason is that I have a long standing issue trying to bind to C numerical libraries using complex numbers, as those are usually structs passed by value. See this from GNU GSL:

[Haskell-cafe] Re: pretty printing with comments

2009-10-20 Thread Maurí­cio CA
�typeURL= String Maybe the difference is the missing space between "type" and "URL". Ah, of course, I see it now, thanks! It ocurred to me that you could catch these kind of errors faster if haskell-src-exts included a basic program to pretty print a Haskell module that we could use out of

[Haskell-cafe] Re: ANN: Reverse Dependencies in Hackage (demo)

2009-10-15 Thread Maurí­cio CA
> You can sort the tables of reverse dependencies by clicking on > the column headers. I wouldn't have thought about clicking in the columns headers. Maybe you could show the order arrow already in the beggining, before any clicks, this would give a hint. > - Rev. deps overview for all packages;

[Haskell-cafe] Re: [Haskell] ANNOUNCE: usb-0.1

2009-10-01 Thread Maurí­cio CA
>>> At least the following packages suffer from this problem: >>> bindings-common bindings-libusb bindings-posix > Most .tar files contain entries for the directories that > precede the entries for the files. This is only by convention > however. It looks like this tar file has an entry for > "sr

[Haskell-cafe] Re: Doing people's homework?

2009-09-29 Thread Maurí­cio CA
If you do a student's homework, you are cheating that student out of an education. Personally, I tend to find "exercises" without access to the answers a poor way to learn. You'll learn more from a well crafted example than you ever will by struggling at something yourself. In these lines, t

[Haskell-cafe] Re: Doing people's homework?

2009-09-28 Thread Maurí­cio CA
> I'm not really hip to the culture here so this is just an > observation, but some of the recent questions posted to this > list (and beginn...@haskell.org) look a lot like someone's > homework. Well, if homework "looks like" homework, the teacher is guilty of cheating. Best, Maurício

[Haskell-cafe] Re: help with FFI

2009-09-17 Thread Maurí­cio CA
typedef struct { int *a; int *b; /*lots of stuff ... */ int *z; } foo; int create_foo(foo *f,FILE *file,int x,int y); int use_foo(foo *f,int w); int destroy_foo(foo *f); newtype Foo = Foo () foreign import ccall "static foo.h create_foo" c_create_foo :: Ptr (Foo) -> Ptr (CFile) -> CInt -> CInt

[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-14 Thread Maurí­cio CA
Yes. It works this way. Tested in debian and old fedora Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. Debian maintainer was willing to add pkg-config to l

[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-14 Thread Maurí­cio CA
>> Unless you think that extra-libraries is a good long term >> solution, I'll still investigate on how to add pkg-config >> generation to configuration scripts and try to send a sugestion >> with a patch to maintainers of libraries wrapped in bindings-*. > It is not practical to use pkg-config f

[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-11 Thread Maurí­cio CA
> The C library prints error messages to stderr. (...) > Attached is the patch to the C levmar library. Thanks for the file. > The license issue is indeed a problem. Either your (linked + > distributed) code must be GPL or you must acquire a different > (commercial) license from the author of t

[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation

2009-09-10 Thread Maurí­cio CA
> Our binding consists of three packages: > > * http://hackage.haskell.org/package/bindings-levmar-0.1 Which were the changes you needed to do to the library code? I believe this is going to cause you two problems: maintenance (as you can't always be sure the patched version didn't introduce a bu

[Haskell-cafe] Re: ForeignFunPtr

2009-09-06 Thread Maurí­cio CA
Isn't freeHaskellFunPtr a required finalization procedure? Maurício the purpose of ForeignPtr is to attach a finalization procedure to the object behind the pointer. for example, you can have close called aimplicitly whenever the garbage collector finds you don't need a file handle any more.

[Haskell-cafe] ForeignFunPtr

2009-09-05 Thread Maurí­cio CA
Hi, We have ForeignPtr. Why isn't there a corresponding ForeignFunPtr? Thanks, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Linking problem with GHCi

2009-08-24 Thread Maurí­cio CA
With a specific package (bindings-common, with the latest version in hackage) if I ask GHCi to read it I get: ghc-6.8.2: /home/mauricio/lib/bindings-common-0.2.5/ghc-6.8.2/HSbindings-common-0.2.5.o: unknown symbol `atexit' If I build a library or executable cabal package depending on it, I ha

[Haskell-cafe] Linking problem with GHCi

2009-08-24 Thread Maurí­cio CA
With a specific package (bindings-common, with the latest version in hackage) if I ask GHCi to read it I get: ghc-6.8.2: /home/mauricio/lib/bindings-common-0.2.5/ghc-6.8.2/HSbindings-common-0.2.5.o: unknown symbol `atexit' If I build a library or executable cabal package depending on it, I hav

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Maurí­cio CA
When I was using C and Python, I used to think of most applications in an simulation way. I think it's right to say that programs are simulations. But now I have to change my mind in Haskell, I have to think in a data-flow way, that is: data in, processing using function composition, data out.

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Maurí­cio CA
...) But for simulation kind-of problems, in which I think OO really fits the best, what's the haskell way to structure such problems? I once thought maybe I can use the State monad to simulate objects. But it's really hard for me to implement, because I think State monad is used to simulate a g

[Haskell-cafe] Re: ANN: OpenCLRaw 1.0.1000

2009-08-17 Thread Maurí­cio CA
> 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, (...) If you think there's something I could change in the package below to make it usefull for this

[Haskell-cafe] Re: Blank definition list in haddock

2009-08-16 Thread Maurí­cio CA
I read in haddock documentation that we write definition lists like this: [...] Did I used those definitons the wrong way? I think the problem is that you have written normal comments instead of Haddock comments. Try adding a | in front of the paragraphs, or just merge them all into one Haddock

[Haskell-cafe] Blank definition list in haddock

2009-08-16 Thread Maurí­cio CA
I read in haddock documentation that we write definition lists like this: -- [...@something@] Definition of something. However, using that structure to document many itens, I get a blank list of definitions, like you can see in this section ('Macros') of the documentation for a package of mine:

[Haskell-cafe] Finalizers on FunPtrs

2009-08-12 Thread Maurí­cio CA
I see in Foreign.Ptr documentation that it is good practice to call freeHaskellFunPtr when a pointer to a Haskell function (obtained using 'dynamic' stubs) is not going to be used anymore. Is it possible to do that in a way that is similar to ForeignPtr behavior, where pointers are finalized when

[Haskell-cafe] Do you understand posix well?

2009-08-05 Thread Maurí­cio CA
I've beeing writing a low-level binding to posix that can be usefull if you want to use posix but has no time to learn FFI: http://hackage.haskell.org/package/bindings-posix However, my understandment of posix is barely nothing, and I see that many of its functionality is enabled or disabled by

[Haskell-cafe] Re: Space for commentaries on hackage

2009-08-05 Thread Maurí­cio CA
>> Sure! Replace "anonymous" for "easy to write". [...] > [...] every package I upload to hackage includes my email > address in the "maintainer" field, and I love getting emails > from people who use anything I maintain (even if they're asking > me to do work! I may not do it, but it's nice to k

[Haskell-cafe] Re: Space for commentaries on hackage

2009-08-05 Thread Maurí­cio CA
It would be nice to have a place for anonimous In these days of web spam, anonymous is not such a good idea. Sure! Replace "anonymous" for "easy to write". Although, thinking better, this should be something to ask at repository hosters, not at hackage. Best, Maurício _

[Haskell-cafe] Space for commentaries on hackage

2009-08-05 Thread Maurí­cio CA
It would be nice to have a place for anonimous comments below each page of a hackage package, maybe with a cabal option to enable/disable that for a particular package. Authors of packages with few users may want that as a way to get first impressions on their work they would otherwise not get. (A

[Haskell-cafe] Re: Adding a field to a data record

2009-07-28 Thread Maurí­cio CA
Suppose you have a data type like: Data Foo = Foo { a :: Int, b :: Int, ... many other fields ... y :: Int } deriving (Eq, Read, Show, Typeable, Data) Now I would like to add a field z :: Int to the end of Foo. If I have a ton of data out on disk, which I wrote with, say writeFile "a.data