Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread Andy Smith
2008/9/9 Maurí­cio <[EMAIL PROTECTED]>: > I use Haskell, and my friends at > work use Java. Do you think it > could be a good idea to use Haskell > with Java, so I could understand > and cooperate with them? Is there a > a Haskell to Java compiler that's > already ready to use? Besides the other a

Re: [Haskell-cafe] trying to understand monad transformers....

2008-09-09 Thread wren ng thornton
wren ng thornton wrote: Daryoush Mehrtash wrote: The MaybeT transformer is defined as: newtype MaybeT m a = MaybeT {runMaybeT :: m (Maybe a)} Question: What does "runMaybeT x" mean? As for "what does it do", I think everyone else has handled that pretty well. As far as "what does it

Re[2]: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Bulat Ziganshin
Hello Johannes, Wednesday, September 10, 2008, 9:39:15 AM, you wrote: > Has there ever been a discussion of typed, user-definable, > user-processable source code annotations for Haskell? afair it was on haskell-prime list btw, Template Haskell may be used for this purpose (although not in porta

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Johannes Waldmann
Jason Dagit wrote: On the other hand, specifying tests was as simple as starting a function name with "prop_" [...] which of course reminds us of JUnit of the dark ages (up to 3.8), before they finally used annotations to declare test cases. Has there ever been a discussion of typed, user-d

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread wren ng thornton
Pieter Laeremans wrote: This : Prelude> let f = (\x -> return "something went wrong") :: IOError -> IO String Prelude> let t = return $ show $ "too short list" !! 100 :: IO String Prelude> catch t f "*** Exception: Prelude.(!!): index too large doesn't work. As others've said, the right an

Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread wren ng thornton
Maurí­cio wrote: Hi, I use Haskell, and my friends at work use Java. Do you think it could be a good idea to use Haskell with Java, so I could understand and cooperate with them? Is there a a Haskell to Java compiler that's already ready to use? Generally speaking, not really. There was a lot

Re: [Haskell-cafe] trying to understand monad transformers....

2008-09-09 Thread wren ng thornton
Daryoush Mehrtash wrote: The MaybeT transformer is defined as: newtype MaybeT m a = MaybeT {runMaybeT :: m (Maybe a)} Question: What does "runMaybeT x" mean? As for "what does it do", I think everyone else has handled that pretty well. As far as "what does it mean", it may help to th

Re: [Haskell-cafe] Re: Field names

2008-09-09 Thread wren ng thornton
Justin Bailey wrote: 2008/9/8 Daryoush Mehrtash <[EMAIL PROTECTED]> > Thanks. > > Pattern matching and memory management in Haskell (or may be GHC > implementation of it) is somewhat of a mystery to me. Are there > any references that explains the underlying implementation? Be careful what you

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Max Bolingbroke
2008/9/9 Sean Leather <[EMAIL PROTECTED]>: > >> My tests are making use of a nice console test runner I wrote that >> supports both HUnit and QuickCheck (and is extensible to other test >> providers by the user): >> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/test-framework. > > The

Re: [Haskell-cafe] Hackage policy question

2008-09-09 Thread Duncan Coutts
On Mon, 2008-09-08 at 16:26 -0700, Iavor Diatchki wrote: > Hi, > I just noticed that hackage has introduced a new policy to disallow > changes to a package without bumping the version. I understand that > this is probably a good idea for changes to the source code, but it > really would be nice to

Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread Daryoush Mehrtash
Why do you want to mix haskall and Java in one VM? If there are functionality within your code that is better implemented in haskell, then why not make that into a service (run it as haskell) with some api that Java code can use. Daryoush On Tue, Sep 9, 2008 at 2:36 AM, Maurí­cio <[EMAIL PROTEC

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-09 Thread Jason Dusek
Bruce Eckel <[EMAIL PROTECTED]> wrote: > ...shared-memory concurrency is impossible for programmers to > get right... Explicit locking is impractical to get right. Transactional interfaces take much of the pain out of that -- even web monkeys can get shared memory right with SQL! When two

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Jason Dagit
2008/9/9 Conal Elliott <[EMAIL PROTECTED]>: > Where do you like to place your tests? In the functionality modules? A > parallel structure? A single Test.hs file somewhere? The last time I had a chance to experiment with how to do this I used a single Test.hs for the whole project and I think t

RE: [Haskell-cafe] Functional references

2008-09-09 Thread Tim Docker
I've discussed the license of data-accessor with it's authors (Luke Palmer & Henning Thieleman). They are ok with changing it to BSD3. So I don't think the license will be a reason not to use it. Tim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ganesh

Re: [Haskell-cafe] Haskell stacktrace

2008-09-09 Thread Donn Cave
> This : > Prelude> let f = (\x -> return "something went wrong") :: IOError -> IO > String > Prelude> let t = return $ show $ "too short list" !! 100 :: IO String > Prelude> catch t f > "*** Exception: Prelude.(!!): index too large > > doesn't work. You might be interested in the difference b

[Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Peter Hercek
Justin Bailey wrote: 2008/9/9 Pieter Laeremans <[EMAIL PROTECTED]>: What 's the best equivalent haskell approach ? thanks in advance, Pieter The preferred approach is to look at your code, figure out where you are using tail (or could be calling something that uses tail) and use the "trace" fu

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Alec Berryman
Justin Bailey on 2008-09-09 14:12:38 -0700: > 2008/9/9 Pieter Laeremans <[EMAIL PROTECTED]>: > > What 's the best equivalent haskell approach ? > > thanks in advance, > > Pieter > > The preferred approach is to look at your code, figure out where you > are using tail (or could be calling something

[Haskell-cafe] Re: Windows console

2008-09-09 Thread Peter Hercek
Andrew Coppin wrote: (Ignore all references you see to enabling ANSI.SYS in your config.sys file; this applies only to 16-bit MS-DOS programs, *not* to 32-bit Windows programs.) You can add interpretation of ansi escape sequences to any win32 program by launching the application through ans

Re: [Haskell-cafe] Unicode and Haskell

2008-09-09 Thread Mattias Bengtsson
On Wed, 2008-09-10 at 00:07 +0200, Thomas Davie wrote: > import Prelude hiding (print) > import System.IO.UTF8 > > main = print "lots of UTF8" > Thanks a lot! signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Unicode and Haskell

2008-09-09 Thread Thomas Davie
On 10 Sep 2008, at 00:01, Mattias Bengtsson wrote: Today i wrote some sample code after a Logic lecture at my university. The idea is to represent the AST of propositional logic as an ADT with some convenience functions (like read-/show instances) and then later perhaps try to make some automat

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Sean Leather
> My tests are making use of a nice console test runner I wrote that > supports both HUnit and QuickCheck (and is extensible to other test > providers by the user): > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/test-framework. > The description looks great! I might have to try it ou

Re: [Haskell-cafe] Unicode and Haskell

2008-09-09 Thread Mattias Bengtsson
On Wed, 2008-09-10 at 00:01 +0200, Mattias Bengtsson wrote: > [..] > What happens can be seen in the attached picture[..] And here it is... <> signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@

[Haskell-cafe] Unicode and Haskell

2008-09-09 Thread Mattias Bengtsson
Today i wrote some sample code after a Logic lecture at my university. The idea is to represent the AST of propositional logic as an ADT with some convenience functions (like read-/show instances) and then later perhaps try to make some automatic transformations on the AST. After construction of th

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Sean Leather
> Thanks a bunch for these tips. I haven't used the flags feature of cabal > before, and i don't seem to be able to get it right. > This is also my first time, so I'm not sure exactly what I'm doing right. ;) I have: > > Flag test > Description: Enable testing > Default: False > > And I

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Krzysztof Kościuszkiewicz
On Tue, Sep 09, 2008 at 11:06:43PM +0200, Pieter Laeremans wrote: > This : > Prelude> let f = (\x -> return "something went wrong") :: IOError -> IO > String > Prelude> let t = return $ show $ "too short list" !! 100 :: IO String > Prelude> catch t f > "*** Exception: Prelude.(!!): index too lar

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread C.M.Brown
Or define your own ghead and gtail: ghead msg [] = error "ghead " ++ msg ++ "[]" ghead _ (x:xs) = x gtail msg [] = error "gtail" ++ msg ++ "[]" gtail msg (x:xs) = xs and you can call them with a name of a function to give you an idea where the error is occurring: myHead = ghead "myHead" [] C

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Ketil Malde
"Justin Bailey" <[EMAIL PROTECTED]> writes: > are using tail (or could be calling something that uses tail) and use > the "trace" function to output logging info. Another cheap trick is to use CPP with something like: #define head (\xs -> case xs of { (x:_) -> x ; _ -> error("head failed at lin

Re: [Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Justin Bailey
2008/9/9 Pieter Laeremans <[EMAIL PROTECTED]>: > What 's the best equivalent haskell approach ? > thanks in advance, > Pieter The preferred approach is to look at your code, figure out where you are using tail (or could be calling something that uses tail) and use the "trace" function to output lo

[Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Pieter Laeremans
This : Prelude> let f = (\x -> return "something went wrong") :: IOError -> IO String Prelude> let t = return $ show $ "too short list" !! 100 :: IO String Prelude> catch t f "*** Exception: Prelude.(!!): index too large doesn't work. kind regards, Pieter On Tue, Sep 9, 2008 at 10:35 PM, P

[Haskell-cafe] Re: Haskell stacktrace

2008-09-09 Thread Pieter Laeremans
Woops , I hit the "send" button to early. The java approach to locate the error would be try { ... }catch(Exception e ){ // log error throw new RuntimeException(e); } ... What 's the best equivalent haskell approach ? thanks in advance, Pieter On Tue, Sep 9, 2008 at 10:30 PM, Pieter Laere

[Haskell-cafe] Haskell stacktrace

2008-09-09 Thread Pieter Laeremans
Hello, I've written a cgi script in haskell, it crashes sometimes with the error message Prelude . tail : empty list In Java we would use this approach to log the erro try { } catch (Exception e) { } -- Pieter Laeremans <[EMAIL PROTECTED]> "The future is here. It's just not evenly distri

Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread Bulat Ziganshin
Hello Mauri­cio, Tuesday, September 9, 2008, 1:36:09 PM, you wrote: > I use Haskell, and my friends at > work use Java. Do you think it > could be a good idea to use Haskell > with Java, so I could understand > and cooperate with them? http://haskell.org/haskellwiki/Applications_and_libraries/In

Re: [Haskell-cafe] Windows console

2008-09-09 Thread Bulat Ziganshin
Hello Andrew, Tuesday, September 9, 2008, 11:15:08 PM, you wrote: > Haskell. I was not, however, able to find any way at all to import the > symbolic constants necessary, so I was forced to reading through the > source code of the raw C header files to find out what the numeric > values of thes

Re: [Haskell-cafe] Windows console

2008-09-09 Thread Max Bolingbroke
2008/9/9 Andrew Coppin <[EMAIL PROTECTED]>: > Actually, now that I think about it, it would be kind of nice to have a > magic package that writes out escape codes or calls the Win32 API depending > on which platform your program is compiled on - in the style of > System.FilePath. I don't know how t

Re: [Haskell-cafe] Windows console

2008-09-09 Thread Jonathan Cast
On Tue, 2008-09-09 at 20:15 +0100, Andrew Coppin wrote: > When coding in a POSIX-compliant environment, you can usually write > special escape codes to the console to change the text colour and so > forth. However, this does not work on Windows. > > (Ignore all references you see to enabling ANS

Re: [Haskell-cafe] [Fwd: profiling in haskell]

2008-09-09 Thread Tim Chevalier
2008/9/8 Vlad Skvortsov <[EMAIL PROTECTED]>: > Posting to cafe since I got just one reply on [EMAIL PROTECTED] I was > suggested to > include more SCC annotations, but that didn't help. The 'serialize' function > is still reported to consume about 32% of running time, 29% inherited. > However, fun

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-09 Thread Jed Brown
On Tue 2008-09-09 12:30, Bruce Eckel wrote: > So this is the kind of problem I keep running into. There will seem to be > consensus that you can do everything with isolated processes message passing > (and note here that I include Actors in this scenario even if their mechanism > is more complex).

Re: [Haskell-cafe] haskell core definition

2008-09-09 Thread Tim Chevalier
On Tue, Sep 9, 2008 at 8:34 AM, Justin Bailey <[EMAIL PROTECTED]> wrote: > This paper is a bit old but still very relevant: > > An External Representation for the GHC Core Language > http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.1755 > Or: http://www.haskell.org/ghc/docs/papers/co

[Haskell-cafe] Windows console

2008-09-09 Thread Andrew Coppin
When coding in a POSIX-compliant environment, you can usually write special escape codes to the console to change the text colour and so forth. However, this does not work on Windows. (Ignore all references you see to enabling ANSI.SYS in your config.sys file; this applies only to 16-bit MS-DO

[Haskell-cafe] Re: Munging wiki articles with tagsoup

2008-09-09 Thread Neil Mitchell
Hi Gwern, Sorry for not noticing this sooner, my haskell-cafe@ reading is somewhat behind right now! > After an hour, I came up with a nice clean little script: > > > > import Text.HTML.TagSoup.Render > import Text.HTML.TagSoup > > main :: IO () > main = interact convertPre > > conve

Re: [Haskell-cafe] Windows details

2008-09-09 Thread Andrew Coppin
Steve Schafer wrote: Version information and application icons are both stored in data structures called "resources"; these are appended to the executable portion of the application, inside the EXE file. There are a number of predefined resource types, such as the aforementioned version info and

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-09 Thread Bruce Eckel
So this is the kind of problem I keep running into. There will seem to be consensus that you can do everything with isolated processes message passing (and note here that I include Actors in this scenario even if their mechanism is more complex). And then someone will pipe up and say "well, of cour

Re: [Haskell-cafe] trying to understand monad transformers....

2008-09-09 Thread Paul Johnson
Daryoush Mehrtash wrote: The MaybeT transformer is defined as: newtype MaybeT m a = MaybeT {runMaybeT :: m (Maybe a)} instance Functor

Re: [Haskell-cafe] Windows details

2008-09-09 Thread Steve Schafer
On Tue, 09 Sep 2008 18:13:50 +0100, you wrote: >Under MS Windows, if you right-click on an executable file and select >"properties", sometimes there's a "Version" tab that tells you the >version number of the program. And sometimes there isn't. (Most >especially, GHC-compiled programs do not ha

[Haskell-cafe] Windows details

2008-09-09 Thread Andrew Coppin
I rather doubt anybody will know the answer to this, but I'll ask anyway... Under MS Windows, if you right-click on an executable file and select "properties", sometimes there's a "Version" tab that tells you the version number of the program. And sometimes there isn't. (Most especially, GHC-c

Re: [Haskell-cafe] haskell core definition

2008-09-09 Thread Andrew Coppin
Justin Bailey wrote: This paper is a bit old but still very relevant: An External Representation for the GHC Core Language http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.1755 Click "view or download" at the bottom to see the paper. Also, I haven't used this utility myself yet

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Max Bolingbroke
2008/9/9 Conal Elliott <[EMAIL PROTECTED]>: > Hi Sean. > > Thanks a bunch for these tips. I haven't used the flags feature of cabal > before, and i don't seem to be able to get it right. I have: > > Flag test > Description: Enable testing > Default: False > > And I get "Warning: unamb.cab

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Ketil Malde
"Conal Elliott" <[EMAIL PROTECTED]> writes: > Thanks a bunch for these tips. I haven't used the flags feature of cabal > before, and i don't seem to be able to get it right. Another option might be to have the test command build via 'ghc --make' instead of Cabal - this way, you can avoid mentio

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Conal Elliott
Hi Sean. Thanks a bunch for these tips. I haven't used the flags feature of cabal before, and i don't seem to be able to get it right. I have: Flag test Description: Enable testing Default: False And I get "Warning: unamb.cabal: Unknown section type: flag ignoring...". If I indent, I i

Re: [Haskell-cafe] haskell core definition

2008-09-09 Thread Justin Bailey
This paper is a bit old but still very relevant: An External Representation for the GHC Core Language http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.1755 Click "view or download" at the bottom to see the paper. Also, I haven't used this utility myself yet but it pages and colori

Re: [Haskell-cafe] Re: Field names

2008-09-09 Thread Justin Bailey
2008/9/8 Daryoush Mehrtash <[EMAIL PROTECTED]> > > Thanks. > > Pattern matching and memory management in Haskell (or may be GHC > implementation of it) is somewhat of a mystery to me. Are there any > references that explains the underlying implementation? > > Daryoush Be careful what you ask fo

Re: [Haskell-cafe] Hackage -> MacPorts?

2008-09-09 Thread Bjorn Bringert
On Wed, Sep 3, 2008 at 10:14 PM, John MacFarlane <[EMAIL PROTECTED]> wrote: > It would be great if there were an automated or semi-automated way > of generating a MacPorts Portfile from a HackageDB package, along > the lines of dons' cabal2arch. Has anyone been working on such a thing? > And, are a

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Sean Leather
> How do folks like to package up QuickCheck tests for their libraries? In >>> the main library? As a separate repo & package? Same repo & separate >>> package? Keeping tests with the tested code allows testing of non-exported >>> functionality, but can add quite a lot of clutter. >>> >> >> I h

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Conal Elliott
Thanks, Sean. On Tue, Sep 9, 2008 at 3:46 PM, Sean Leather <[EMAIL PROTECTED]> wrote: > > How do folks like to package up QuickCheck tests for their libraries? In >> the main library? As a separate repo & package? Same repo & separate >> package? Keeping tests with the tested code allows test

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Sean Leather
> How do folks like to package up QuickCheck tests for their libraries? In > the main library? As a separate repo & package? Same repo & separate > package? Keeping tests with the tested code allows testing of non-exported > functionality, but can add quite a lot of clutter. > I have QuickChec

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Dougal Stanton
On Tue, Sep 9, 2008 at 2:05 PM, Dougal Stanton <[EMAIL PROTECTED]> wrote: > If they're in a separate package it's less easy to wire quickcheck > tests into the commit procedure. And by package there, I mean repo. Obviously ;-) D ___ Haskell-Cafe mailin

Re: [Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Dougal Stanton
2008/9/9 Conal Elliott <[EMAIL PROTECTED]>: > How do folks like to package up QuickCheck tests for their libraries? In > the main library? As a separate repo & package? Same repo & separate > package? Keeping tests with the tested code allows testing of non-exported > functionality, but can add

Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread Donnchadh Ó Donnabháin
It's not haskell to java compiler but you might find cohatoe and eclipsefp interesting: http://cohatoe.blogspot.com/ http://eclipsefp.sourceforge.net/ Donnchadh 2008/9/9 Maurí­cio <[EMAIL PROTECTED]>: > Hi, > > I use Haskell, and my friends at > work use Java. Do you think it > could be a good

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Arnar Birgisson
On Tue, Sep 9, 2008 at 13:58, Sterling Clover <[EMAIL PROTECTED]> wrote: > I've been playing with this, and on top of STM as it exists, managed to > neatly interleave it with sqite3 and postgres. To do so with postgres, > however, required setting the locking mode to be a bit more restrictive than

[Haskell-cafe] packages and QuickCheck

2008-09-09 Thread Conal Elliott
How do folks like to package up QuickCheck tests for their libraries? In the main library? As a separate repo & package? Same repo & separate package? Keeping tests with the tested code allows testing of non-exported functionality, but can add quite a lot of clutter. My current leaning is to s

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Sterling Clover
I've been playing with this, and on top of STM as it exists, managed to neatly interleave it with sqite3 and postgres. To do so with postgres, however, required setting the locking mode to be a bit more restrictive than it is out-of-the-box. Clever use of encapsulation and monad transformer

Re: [Haskell-cafe] Haskell and Java

2008-09-09 Thread C.M.Brown
Hi, The only thing I can think of is GCJNI: http://www.haskell.org/gcjni/ This makes use of the FFI and a Greencarded Java JNI interface. It does allow you to call Java programs from Haskell. However, I'm not sure if it is still supported. hth, Chris. On Tue, 9 Sep 2008, [ISO-8859-1] Maurí­ci

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Arnar Birgisson
On Tue, Sep 9, 2008 at 11:58, Jules Bean <[EMAIL PROTECTED]> wrote: >> Maybe this is an idea for an extension to the STM system, adding >> something like unsafeIOToSTM, except that in addition to the main IO >> action, it also takes two more IO actions that are invoked on rollback >> and commit, re

Re: [Haskell-cafe] Can you do everything without shared-memory concurrency?

2008-09-09 Thread Sebastian Sylvan
On Mon, Sep 8, 2008 at 8:33 PM, Bruce Eckel <[EMAIL PROTECTED]> wrote: > As some of you on this list may know, I have struggled to understand > concurrency, on and off for many years, but primarily in the C++ and > Java domains. As time has passed and experience has stacked up, I have > become mor

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Jules Bean
Arnar Birgisson wrote: On Tue, Sep 9, 2008 at 11:36, Jules Bean <[EMAIL PROTECTED]> wrote: ...not only must it be safe to be called with invalid inputs, but it most not have any long-term effects, whether the input is valid or invalid, since I do not believe that there is any way for the functio

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Arnar Birgisson
On Tue, Sep 9, 2008 at 11:36, Jules Bean <[EMAIL PROTECTED]> wrote: > ...not only must it be safe to be called with invalid inputs, but it most > not have any long-term effects, whether the input is valid or invalid, since > I do not believe that there is any way for the function to 'undo' its effe

[Haskell-cafe] Haskell and Java

2008-09-09 Thread Maurí­cio
Hi, I use Haskell, and my friends at work use Java. Do you think it could be a good idea to use Haskell with Java, so I could understand and cooperate with them? Is there a a Haskell to Java compiler that's already ready to use? Thanks, Maurício ___ H

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Jules Bean
Ryan Ingram wrote: If the function isn't pure, you need to do a lot more proofs to assure that this is safe. In particular, the function must be able to be called with invalid input. If you are confident that this is the case, you can use unsafeIOToSTM to convert a call to that function into an

Re: [Haskell-cafe] STM and FFI

2008-09-09 Thread Ryan Ingram
What are you trying to do? (1) Call a foreign function from inside an STM transaction? If the function is pure, this is trivial, just declare it as a pure function in the foreign import statement. You do need to be a bit careful, however, as it is possible the function will get called with inval

Re: [Haskell-cafe] trying to understand monad transformers....

2008-09-09 Thread Ryan Ingram
2008/9/8 Daryoush Mehrtash <[EMAIL PROTECTED]>: > The MaybeT transformer is defined as: > > > newtype MaybeT m a = MaybeT {runMaybeT :: m (Maybe a)} > > Question: What does "runMaybeT x" mean? This is just shorthand for the following: > newtype MaybeT m a = MaybeT (m (Maybe a)) > runMaybeT :: Ma

Re: [Haskell-cafe] haskell job offer.

2008-09-09 Thread Lionel Barret De Nazaris
Thank you for the warm welcome. About the use of Haskell, it will be for our (urban) rule-based generation engines (there is a recursive stack of them). Think about a declarative geographic compiler and you're on the right track. This engines are not in Haskell right now but it *should* be bec

Re: [Haskell-cafe] trying to understand monad transformers....

2008-09-09 Thread Magnus Therning
2008/9/9 Daryoush Mehrtash <[EMAIL PROTECTED]>: > The MaybeT transformer is defined as: > > newtype MaybeT m a = MaybeT {runMaybeT :: m (Maybe a)} > > > instance Functor m => Functor (MaybeT m) where > > fmap f x = MaybeT $ fmap (fmap f) $ runMaybeT x > > > > > Question: What does "runMaybe