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,
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.
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,
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
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
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
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;
�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
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:
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,
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
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
design space
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
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 r)) $
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
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
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
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 else peek
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,
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
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
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
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 with a
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
clarify what you
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
___
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
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 the
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 the
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
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
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 4001?
If
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
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
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
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.
(...)
I would
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
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
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
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 of
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. These
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
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 and .c
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 same
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
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://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
possible.
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
___
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
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 safe code,
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, but
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
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.
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
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 idea
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 allowed
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
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
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.
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
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 know that
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
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
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
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
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
...) 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
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.
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
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
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
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.
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
bug)
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 the C
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 for such
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
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 - IO
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
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,
78 matches
Mail list logo