How to find out the C type signature corresponding to a Haskell function type in FFI?

2006-03-07 Thread Brian Hulley
Hi - I've got a Haskell module with the following ffi import: foreign import ccall duma_init :: Int - IO Int However my problem is that I've got no idea what the type signature for the corresponding C function should be, and when I compile the above module with ghc -fglasgow-exts -fffi --make

Re: How to find out the C type signature corresponding to a Haskell function type in FFI?

2006-03-07 Thread Bulat Ziganshin
Hello Brian, Tuesday, March 7, 2006, 7:35:27 PM, you wrote: BH foreign import ccall duma_init :: Int - IO Int int duma_init(int); BH I've tried looking at the wiki but that only seems to give specific BH examples. I'm trying to find what the mapping is between Haskell function BH signatures

Getting GHC to print Done when it's finished linking?

2006-03-07 Thread Brian Hulley
Hi - I've set up my Visual Studio environment so that ghc is an external tool, where the output from ghc appears on the VS output pane. However when I use this to compile and link a Haskell program (I'm just using the plain text editor that comes with VC++ not the Haskell plugin because of its

Re: Getting GHC to print Done when it's finished linking?

2006-03-07 Thread Tomasz Zielonka
On Tue, Mar 07, 2006 at 06:45:52PM -, Brian Hulley wrote: Is there any flag to get ghc or the ghc linker to print Done or something when it's finished? In unix you could wrap ghc in a script that would print Done if ghc finished successfully. I am sure you can do it somehow in windows.

Re: Getting GHC to print Done when it's finished linking?

2006-03-07 Thread Neil Mitchell
In unix you could wrap ghc in a script that would print Done if ghc finished successfully. I am sure you can do it somehow in windows. ghc --make Whatever if errorfail 1 goto failed echo Success :-) goto end :failed echo Failure :-( :end Thanks Neil

Re: How to find out the C type signature corresponding to a Haskell function type in FFI?

2006-03-07 Thread Tomasz Zielonka
On Tue, Mar 07, 2006 at 04:35:27PM -, Brian Hulley wrote: A third point is, how would I pass an arbitrary monad instead of just using IO? What for? IO is the monad that most closely matches the imperative, C semantics. That's why FFI only supports the IO monad (and pure functions). Other

Re: Getting GHC to print Done when it's finished linking?

2006-03-07 Thread Tomasz Zielonka
On Tue, Mar 07, 2006 at 06:54:50PM +, Neil Mitchell wrote: In unix you could wrap ghc in a script that would print Done if ghc finished successfully. I am sure you can do it somehow in windows. ghc --make Whatever if errorfail 1 goto failed echo Success :-) goto end :failed echo

Re: How to find out the C type signature corresponding to a Haskell function type in FFI?

2006-03-07 Thread Ian Lynagh
On Tue, Mar 07, 2006 at 07:57:50PM +0100, Tomasz Zielonka wrote: On Tue, Mar 07, 2006 at 04:35:27PM -, Brian Hulley wrote: A third point is, how would I pass an arbitrary monad instead of just using IO? What for? IO is the monad that most closely matches the imperative, C semantics.

Re: Getting GHC to print Done when it's finished linking?

2006-03-07 Thread Brian Hulley
Neil Mitchell wrote: In unix you could wrap ghc in a script that would print Done if ghc finished successfully. I am sure you can do it somehow in windows. ghc --make Whatever if errorfail 1 goto failed echo Success :-) goto end failed echo Failure :-( end Thanks Neil - the script below,

Re: How to find out the C type signature corresponding to a Haskell function type in FFI?

2006-03-07 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Tuesday, March 7, 2006, 7:35:27 PM, you wrote: foreign import ccall duma_init :: Int - IO Int int duma_init(int); Also, I really wanted to be able to use () - IO () but () doesn't seem to be allowed in FFI... void f(void); foreign import ccall f :: IO

Re: [Haskell] Re: Trying On Learn Haskell Web Server

2006-03-07 Thread Mattias Bengtsson
On Tue, 2006-03-07 at 00:06 +0100, Niklas Broberg wrote: On 3/6/06, Graham Klyne [EMAIL PROTECTED] wrote: - An easy way to map incoming URIs to specific functions (hmm.. or to monadic values, I think) I don't think I understand what you're after exactly, but I'm sure it's interesting,

[Haskell] Announcement: Bluespec, Inc. is seeking summer interns

2006-03-07 Thread Ravi Nanavati
Bluespec, Inc. is a hardware design startup based in Waltham, Massachusetts that is building the next generation of Electronic Design Automation (EDA) tools. Bluespec's toolset, which is based on functional programming technology, delivers a high-level design and verification environment to

Re: Keep the present Haskell record system!

2006-03-07 Thread Johannes Waldmann
Cale Gibbard wrote: (a thoughtful response, thank you) and ... ... field labels can be renamed such that they don't overlap. Inventing new names is not hard work. Oh yes it is. I want meaningful names, and if the meaning of two things is identical, then inventing separate names is hard and

Re: partial type signatures/annotations/declarations..

2006-03-07 Thread Martin Sulzmann
FYI, Chameleon supports a combination of lexically scoped and partial type annotation. The latest Chameleon version is a broken (fix on its way). Though, besides the implementation there's also a concise formal description. See [July 2005] Lexically Scoped Type Annotations

partial application syntax

2006-03-07 Thread Wolfgang Jeltsch
Hello, there was some proposal for introducing a special syntax where f x _ z or f x ? z means \y - f x y z. Is there some information on the Haskell' trac site about this? Best wishes, Wolfgang ___ Haskell-prime mailing list

Re: relaxed instance rules spec (was: the MPTC Dilemma (please solve))

2006-03-07 Thread Ben Rudiak-Gould
John Meacham wrote: On Thu, Mar 02, 2006 at 03:53:45AM -, Claus Reinke wrote: the problem is that we have somehow conjured up an infinite type for Mul to recurse on without end! Normally, such infinite types are ruled out by occurs-checks (unless you are working with Prolog III;-), so

[Haskell-cafe] Web application frameworks (was: [Haskell] Re: Trying On Learn Haskell Web Server)

2006-03-07 Thread Graham Klyne
[Switching to haskell-cafe] Niklas Broberg wrote: Ehum, shameless plug. :) Pretty much what I was fishing for... On 3/6/06, Graham Klyne [EMAIL PROTECTED] wrote: Cale Gibbard wrote: Ah, neat, I knew about WASH, but somehow I'd missed the fact that there was a server there :)

Re: [Haskell-cafe] library sort

2006-03-07 Thread Sven Panne
Am Samstag, 4. März 2006 21:30 schrieb Neil Mitchell: And a related question is: Which packages are searchable by Hoogle? The best answer to that is some. I intentionally excluded OpenGL and other graphics ones because they have a large interface and yet are not used by most people using

Re: [Haskell-cafe] library sort

2006-03-07 Thread Neil Mitchell
Well, this a bold assumption IMHO, and I'm not particularly happy with that, as you can probably imagine. I would also imagine that Joe Programmer is more likely to use wxHaskell or Gtk2Hs than those - however because those are outside the standard tree they don't make it in. I don't think much

Re: [Haskell-cafe] | vs. $ (was: request for code review)

2006-03-07 Thread Brian Hulley
Brian Hulley wrote: translate :: (Monad m) = String - m String translate = do createParseContext readToFirstIdentifier dealWithDeclarator consolidateOutput The type signature above doesn't match the do

Re: [Haskell-cafe] Layout rule (was Re: PrefixMap: code reviewrequest)

2006-03-07 Thread Daniel Fischer
Am Montag, 6. März 2006 16:52 schrieb Malcolm Wallace: Daniel Fischer [EMAIL PROTECTED] wrote: At the beginning of the module, there is _no_ current indentation level - thus the fourth equation of L applies. I think, the third from last equation of L applies, since If the first lexeme

[Haskell-cafe] Can't uninstall GHC or prepare SOE installation on OS X

2006-03-07 Thread Xavier Elizalde
I've installed the Glasgow Haskell Compiler 6.4.1 for OS X on my system. I have The Haskell School of Expression book and the instructions for setting up and running the SOE software seem to have a different configuration compared to GHC 6.4.1. Namely, it's meant to use X11 and locations

Re: [Haskell-cafe] Web application frameworks

2006-03-07 Thread Björn Bringert
Graham Klyne wrote: [Switching to haskell-cafe] Niklas Broberg wrote: ... On 3/6/06, Graham Klyne [EMAIL PROTECTED] wrote: - Options to run the whole thing behind Apache to leverage its security and web space management capabilities Lemmih has implemented a HSP/FastCGI binding for

Re: [Haskell-cafe] | vs. $ (was: request for code review)

2006-03-07 Thread Shannon -jj Behrens
I did think of using a monad, but being relatively new to Haskell, I was confused about a few things. Let's start by looking at one of my simpler functions: -- Keep pushing tokens until we hit an identifier. pushUntilIdentifier :: ParseContextTransformation pushUntilIdentifier ctx |

[Haskell-cafe] Haddock Problems

2006-03-07 Thread Daniel Fischer
Hi all, I've just installed haddock-0.7, nice, but... haddock -o h7doc -h -D h7doc/fusi.haddock --use-package=base Verwaltung.hs Teams.hs Stats.hs Match.hs Main.hs Liga.hs Item.hs Helpers.hs Datum.hs Warning: Helpers: could not find link destinations for: GHC.Base.Int GHC.Base.String

Re: [Haskell-cafe] | vs. $ (was: request for code review)

2006-03-07 Thread Brian Hulley
Shannon -jj Behrens wrote: I did think of using a monad, but being relatively new to Haskell, I was confused about a few things. Let's start by looking at one of my simpler functions: -- Keep pushing tokens until we hit an identifier. pushUntilIdentifier :: ParseContextTransformation

[Haskell-cafe] ANN: pass.net is live in haskell!

2006-03-07 Thread S. Alexander Jacobson
I just launched http://pass.net. Pass.net lets website use the user's email domains to authenticate. The default implementation is in Haskell and is now live. -Alex- PS I am at ETech right now and will be at SXSW next week. If you are here, please say hi.

[Haskell-cafe] Annoucing alternative to Text.Regex

2006-03-07 Thread Chris Kuklewicz
This message is cross-posted to haskell-cafe@haskell.org and [EMAIL PROTECTED] Hi, Working on the shootout (specifically http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdnalang=all ), it was impossible to use Text.Regex since it was too slow (it would reach the timeout limit,