Re: [Haskell-cafe] process-conduit appears to hang on windows

2012-04-16 Thread grant
Michael Snoyman  snoyman.com> writes:

> 
> I'm not sure what the original problems were that caused it to hang on
> Windows, so I can't really speak to that part of the code. The
> conduit-specific stuff looks good though.
> 
> Michael
> 

Thanks for taking a look. I guess windows handling of processes 
is a lot different than linux.
Grant



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Connection to database

2012-04-16 Thread yrazes
Hi Brandon:

I did read the README.markdown.

I run the Test.hs that is set by default and the Test.hs (my Test), with
the command I got in README:
julita@yulys:~/hdbc-mysql$ ghc -idist/build -L/opt/local/lib/mysql5/mysql
-lmysqlclient --make Test

I got the same error message related to "Could not find module
`Database.HDBC.MySQL.RTS':"
I "googled" it, but I can not find something about the header or dev I need
to run this successfully.


(myTest):
__-
  import Control.Monad
  import Database.HDBC
  import Database.HDBC.MySQL
  main = do conn <- connectMySQL defaultMySQLConnectInfo {
 mysqlHost = "127.0.0.1",
 mysqlUser = "root",
 mysqlPassword = "123456"
  }

rows <- quickQuery' conn "show databases" []
forM_ rows $ \row -> putStrLn $ show row

__-


On Mon, Apr 16, 2012 at 8:27 PM, Brandon Allbery wrote:

> On Mon, Apr 16, 2012 at 18:14, yrazes  wrote:
>
>> 3.
>> julita@yulys:~/hdbc-mysql$ ls
>> ChangeLog  Database  README.markdown  Test.hs
>> COPYINGHDBC-mysql.cabal  Setup.lhstestsrc
>> julita@yulys:~/hdbc-mysql$ runhaskell Test.hs
>>
>> but I got this error message:
>>
>> Database/HDBC/MySQL.hs:65:8:
>> Could not find module `Database.HDBC.MySQL.RTS':
>>   Use -v to see a list of the files searched for.
>>
>>
>> * I tried to do something about the Setup.lhs, but I could not do
>> anything at all.
>>
>
> Did you happen to look at the README, or is that our job?
>
> --
> brandon s allbery  allber...@gmail.com
> wandering unix systems administrator (available) (412) 475-9364 vm/sms
>
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] TLS support for haskell-xmpp

2012-04-16 Thread John Goerzen

Dmitry & others,

Attached is a diff implementing TLS support for haskell-xmpp, and 
correcting a build failure.


The support is rough but it seems to work so far.

-- John
diff -durN -x '*~' -x Test.hs orig/haskell-xmpp-1.0/haskell-xmpp.cabal haskell-xmpp-1.0/haskell-xmpp.cabal
--- orig/haskell-xmpp-1.0/haskell-xmpp.cabal	2011-01-15 16:50:14.0 -0600
+++ haskell-xmpp-1.0/haskell-xmpp.cabal	2012-04-16 21:03:49.125224872 -0500
@@ -32,7 +32,7 @@
 
 library
   Hs-Source-Dirs: ./src
-  Build-Depends: base > 3 && <=5, random, pretty, array, HaXml >= 1.20.2, mtl >= 1.0, network, html, polyparse, regex-compat, stm, utf8-string
+  Build-Depends: base > 3 && <=5, random, pretty, array, HaXml >= 1.20.2 && < 1.21, mtl >= 1.0, network, html, polyparse, regex-compat, stm, utf8-string, gnutls, bytestring
   Exposed-modules: Network.XMPP
 , Network.XMPP.Sasl
 , Network.XMPP.Core
diff -durN -x '*~' -x Test.hs orig/haskell-xmpp-1.0/src/Network/XMPP/Concurrent.hs haskell-xmpp-1.0/src/Network/XMPP/Concurrent.hs
--- orig/haskell-xmpp-1.0/src/Network/XMPP/Concurrent.hs	2011-01-15 16:50:14.0 -0600
+++ haskell-xmpp-1.0/src/Network/XMPP/Concurrent.hs	2012-04-16 21:46:04.405285127 -0500
@@ -36,6 +36,8 @@
 import Network.XMPP.XEP.Version 
 import Network.XMPP.IM.Presence
 import Network.XMPP.Utils
+import qualified Network.Protocol.TLS.GNU as TLS
+import qualified Data.ByteString.Lazy.Char8 as BC8
 
 import System.IO
 
@@ -54,7 +56,7 @@
   liftIO $ forkIO $ runReaderT a (Thread in' out')
   s <- get
   liftIO $ forkIO $ loopWrite s out'
-  liftIO $ forkIO $ connPersist (handle s)
+  liftIO $ forkIO $ connPersist (transport s)
   loopRead in' 
 where 
   loopRead in' = loop $ 
@@ -105,10 +107,20 @@
 else do
   waitFor f
 
-connPersist :: Handle -> IO ()
-connPersist h = do
+connPersist :: Transport -> IO ()
+connPersist (HandleTransport h) = do
   hPutStr h " "
   putStrLn ""
   threadDelay 3000
-  connPersist h
-
+  connPersist (HandleTransport h)
+connPersist (TLSTransport t) = do
+  r <- TLS.runTLS t $ do
+TLS.putBytes (BC8.pack " ")
+  case r of
+Left x -> fail (show x)
+Right _ -> return ()
+  putStrLn ""
+  threadDelay 3000
+  connPersist (TLSTransport t)
+  
+
diff -durN -x '*~' -x Test.hs orig/haskell-xmpp-1.0/src/Network/XMPP/Core.hs haskell-xmpp-1.0/src/Network/XMPP/Core.hs
--- orig/haskell-xmpp-1.0/src/Network/XMPP/Core.hs	2011-01-15 16:50:14.0 -0600
+++ haskell-xmpp-1.0/src/Network/XMPP/Core.hs	2012-04-16 21:33:28.101267152 -0500
@@ -26,6 +26,9 @@
 import Network.XMPP.JID
 import Network.XMPP.IQ
 import Network.XMPP.Utils
+import Text.XML.HaXml.Xtract.Parse (xtract)
+import qualified Network.Protocol.TLS.GNU as TLS
+
 
 -- | Open connection to specified server and return `Stream' coming from it
 initiateStream :: Handle
@@ -50,7 +53,48 @@
  
  debug "Stream started"
  --debug $ "Observing: " ++ render (P.content m)
- m <- xtractM "/stream:features/mechanisms/mechanism/-"
+ 
+ -- First, we read stream:features
+ sf_ <- xtractM "/stream:features"
+ let sf = case sf_ of
+   [] -> error "Did not get stream:features"
+   [x] -> x
+   x -> error "Got many stream:features"
+   
+ -- Now, we look for starttls.
+ newsf <- case xtract id "/stream:features/starttls" sf of
+   [] -> do debug "Did not see starttls in features"
+return sf
+   x -> do debug $ "Saw starttls: " ++ show x
+   out $ toContent $ ptag "starttls" 
+ [xmlns "urn:ietf:params:xml:ns:xmpp-tls"]
+ []
+   nm <- nextM
+   case xtract id "/proceed" nm of
+ [] -> fail "Did not get proceed after starttls"
+ _ -> return ()
+   debug $ "Starting TLS"
+   session <- liftIO $ TLS.runClient (TLS.handleTransport h) $ do
+ TLS.setPriority [TLS.X509]
+ TLS.setCredentials =<< TLS.certificateCredentials
+ TLS.handshake
+ TLS.getSession
+   case session of
+ Left x -> fail (show x)
+ Right x -> do 
+   debug $ "Got TLS session"
+   resetStreamTLS h x
+   debug $ "Stream reset"
+   out $ toContent $ stream Client server
+   startM
+   tlssf_ <- xtractM "/stream:features"
+   debug $ "Got new features"
+   return $ case tlssf_ of
+ [] -> error "Did not get stream:features"
+ [x] -> x
+ x -> error "Got many stream:features"
+   
+ let m = xtract id "/stream:features/mechanisms/mechanism/-" newsf
  let mechs =

Re: [Haskell-cafe] Connection to database

2012-04-16 Thread Brandon Allbery
On Mon, Apr 16, 2012 at 18:14, yrazes  wrote:

> 3.
> julita@yulys:~/hdbc-mysql$ ls
> ChangeLog  Database  README.markdown  Test.hs
> COPYINGHDBC-mysql.cabal  Setup.lhstestsrc
> julita@yulys:~/hdbc-mysql$ runhaskell Test.hs
>
> but I got this error message:
>
> Database/HDBC/MySQL.hs:65:8:
> Could not find module `Database.HDBC.MySQL.RTS':
>   Use -v to see a list of the files searched for.
>
>
> * I tried to do something about the Setup.lhs, but I could not do anything
> at all.
>

Did you happen to look at the README, or is that our job?

-- 
brandon s allbery  allber...@gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] CFP SCAM 2012 - submissions due May 4 (abstracts: April 29)

2012-04-16 Thread Sonia Haiduc

**
* 12th IEEE International Working Conference on Source   *
*Code Analysis and Manipulation  *
*SCAM 2012   *
* http://scam2012.cs.usask.ca/   *
**
* September 23 - 24, 2012*
* Riva Del Garda, Trento, Italy  *
**
* *** CALL FOR PAPERS ****
**

OVERVIEW/SCOPE
**
The aim of  SCAM  is to bring  together researchers  and practitioners
working on theory, techniques and applications, which concern analysis
and/or manipulation of the source code of computer systems. While much
attention  in the wider  software engineering  community  is  properly
directed towards  other aspects of  systems  development and evolution,
such as  specification, design and requirements engineering, it is the
source code that contains the only precise description of the behavior
of the  system.  The  analysis and manipulation  of  source  code thus
remains a pressing concern.

COVERED TOPICS AND PAPER FORMATS

We welcome submission  of  *full papers*  that describe  original  and
significant work in the field of source code analysis and manipulation.
SCAM explicitly solicits results from any theoretical or technological
domain that can be applied to the following or similar topics:
- program transformation
- abstract interpretation
- program slicing
- source level software metrics
- decompilation
- source level testing and verification
- source level optimization
- program comprehension

SCAM  also welcomes *short tool papers* that introduce tools for source
code analysis and  manipulation. Tool papers should describe a concrete
source code analysis or manipulation tool that is available for download
and general use  and can  be  run and demonstrated  at  the conference.

Submitted papers should not be  longer than  10 pages (6 pages for tool
papers). All papers  submitted  should  follow  IEEE  Computer  Society
Press Proceedings Author Guidelines.  The  papers  should  be submitted
electronically in PDF form via the conference web site.Submitted papers
must not have  been previously  published or concurrently submitted for
consideration elsewhere.

In addition  to  the main  and  tool tracks,  SCAM 2012 solicits 2-page
*Frontiers position papers* describing a significantly new  idea in the
theory, technology, application or  engineering of source code analysis
and manipulation systems. Frontiers  authors will join in an open panel
discussion of the frontiers of the area at the conference.

IMPORTANT DATES
***
Abstract submission (full and frontiers papers): April 29, 2012
Papers submission (full and frontiers papers): May 04, 2012
Tool papers submission: May 31, 2012
Notification full and frontier papers: June 16, 2012
Notification tool papers: June 21, 2012
Camera ready submission: July 06, 2012
Working Conference: September 23 - 24, 2012

PROCEEDINGS
***
All  accepted  papers  will appear  in  the  proceedings  which  will be
published by the IEEE Computer Society Press. Best papers from SCAM 2012
will be considered for revision, extension, and publication in a special
issue of the Journal of Software: Evolution and Process.

ORGANIZING COMMITTEE

*General Chair*
James R. Cordy, Queen's University, Canada

*Program Co-Chairs*
Mariano Ceccato, Fondazione Bruno Kessler, Italy
Zheng Li, Beijing University of Chemical Technology, China

*Tool Chair*
Chanchal K. Roy, University of Saskatchewan, Canada

*Local Arangements Chair*
Alessandro Marchetto, Fondazione Bruno Kessler, Italy

*Finance Chair*
Dave Binkley, Loyola University Maryland, USA

*Publications Chair*
Dawn Lawrie, Loyola University Maryland, USA

*Publicity Chair*
Sonia Haiduc, Wayne State University, Detroit, USA

*Web chair*
Minhaz Fahim Zibran, University of Saskatchewan, Canada

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Connection to database

2012-04-16 Thread yrazes
Hi guys,

I was trying to get a connection MySql Haskell and I followed this steps:

1.
install cabal-install
install libghc-haskelldb-hdbc-dev (headers del haskell y hdbc)
install libmysqlclient-dev (headers del mysqlclient)

2.
git clone git://github.com/bos/hdbc-mysql.git

3.
julita@yulys:~/hdbc-mysql$ ls
ChangeLog  Database  README.markdown  Test.hs
COPYINGHDBC-mysql.cabal  Setup.lhstestsrc
julita@yulys:~/hdbc-mysql$ runhaskell Test.hs

but I got this error message:

Database/HDBC/MySQL.hs:65:8:
Could not find module `Database.HDBC.MySQL.RTS':
  Use -v to see a list of the files searched for.


* I tried to do something about the Setup.lhs, but I could not do anything
at all.

If somebody can help me, I will appreciate it.

Best regards,
Julita
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0

2012-04-16 Thread Ben Franksen
Paolo Capriotti wrote:
> I'm pleased to announce the release of version 0.1.0 of pipes-core, a
> library for efficient, safe and compositional IO, similar in scope to
> iteratee and conduits.
> 
> http://hackage.haskell.org/package/pipes-core

I like your pipes package. This is very similar to what Mario Blažević wrote 
about his Coroutines in the Monad.Reader (can't remember which issue; great 
article, BTW, many thanks Mario for making me understand the iteratee 
business (and also generators) for the first time). Your pipes-core looks 
even simpler to use, maybe due to avoiding to make a type distinction 
between consumer/producer/pipe (except the natural one i.e. through the 
input/output types), even though the parameterization by a functor (as in 
Monad.Coroutine) has its own beauty.


Two issues:

(1) What is the reason for the asymmetry in
 
  type Producer b m = Pipe () b m
  type Consumer a m = Pipe a Void m

i.e. why does Producer use () for the input? I would expect it to use Void, 
like Consumer does for its output. Calling await in a Producer resulting in 
an immediate 'return ()' as you say is allowed (in the tutorial) strikes me 
as not very useful.

If the idea is simply to flag nonsense like

  consumer >+> producer

with a type error, then it might be a better idea to introduce two different 
Void types:

  data NoOutput
  data NoInput

  type Producer b m = Pipe NoInput b m
  type Consumer a m = Pipe a NoOutput m
  type Pipeline m = Pipe NoInput NoOutput m

(and isn't this nicely self-explaining?)

(2) The $$ operator is poorly named. I would intuitively expect an operator 
that looks so similar to the standard $ to have the same direction of data 
flow (i.e. right to left, like function application and composition) but 
your is left to right. You could use e.g. >$> instead, which has the 
additional advantage of allowing a symmetric variant for the other direction 
i.e. <$<.

Cheers
Ben


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Announce: keera-three-balance-checker-0.0.1

2012-04-16 Thread Morten Olsen Lysgaard

On 04/16/2012 06:22 PM, Ivan Perez wrote:

PS. Why Announce instead of ANNOUNCE? Because this is not
a big deal, it's just a toy.


I like the feel of this package, there should be more of this. Good to 
see that Haskell "floats the boat" for both the hackers and academia.


--
Morten

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Announce: keera-three-balance-checker-0.0.1

2012-04-16 Thread Ivan Perez
Hi everyone,
 I wrote a small app to keep my Three Mobile PayG balance always
under control. I've been using it for a while and it seems to work fine.
It's just an icon docked in the system bar that shows the current balance
when you move the mouse over it.

If you don't know what Three Mobile is, then you don't need this.
If you use a different operator and would find this kind of app
handy, let me know and we can probably find a way to make it work
for you.

Code, instructions and screenshots:
https://github.com/ivanperez-keera/keera-three-balance-checker

My cabal repo:
remote-repo: ivanperez-keera:http://ivanperez-keera.github.com/packages/archive

If any of you find it useful, I'd be glad to know. If you find any bugs,
drop me a line and we'll find out how to fix them together.

Cheers,
Ivan.

PS. Why Announce instead of ANNOUNCE? Because this is not
a big deal, it's just a toy.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Building cabal-install for new ghc build

2012-04-16 Thread Lyndon Maydwell
Nice tip!

On Mon, Apr 16, 2012 at 4:42 PM, Daniël de Kok  wrote:
> On Apr 16, 2012, at 5:28 AM, Lyndon Maydwell wrote:
>> I've found that I had to make several modifications to the
>> bootstrap.sh and cabal-install.cabal files in order to get this to
>> work. I am wondering how the maintainers of the Haskell-platform, etc
>> are dealing with these issues.
>
> I usually get a recent cabal-install from the Cabal Darcs repository, which 
> normally builds without modifications to bootstrap.sh on a recent GHC:
>
> darcs get http://darcs.haskell.org/cabal/
>
> Or if you want a particular branch (such as 1.14):
>
> darcs get http://darcs.haskell.org/cabal-branches/cabal-1.14/
>
> Of course, you need Darcs to do this, but binary builds of Darcs are provided 
> on the Darcs website.
>
> -- Daniël

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Hackathon in Munich

2012-04-16 Thread Heinrich Hördegen


Dear all,

the Munich Haskell Meeting is glad to announce a local one day Hackathon 
in Munich. It will take place the 12th of May 2012 from 10am to 6pm. 
Please checkout the details at:


http://www.haskell-munich.de/dates

Cordially yours,
Heinrich


--
--

hoerde...@funktional.info
www.funktional.info

--


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Building cabal-install for new ghc build

2012-04-16 Thread Daniël de Kok
On Apr 16, 2012, at 5:28 AM, Lyndon Maydwell wrote:
> I've found that I had to make several modifications to the
> bootstrap.sh and cabal-install.cabal files in order to get this to
> work. I am wondering how the maintainers of the Haskell-platform, etc
> are dealing with these issues.

I usually get a recent cabal-install from the Cabal Darcs repository, which 
normally builds without modifications to bootstrap.sh on a recent GHC:

darcs get http://darcs.haskell.org/cabal/

Or if you want a particular branch (such as 1.14):

darcs get http://darcs.haskell.org/cabal-branches/cabal-1.14/

Of course, you need Darcs to do this, but binary builds of Darcs are provided 
on the Darcs website.

-- Daniël
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANNOUNCE : Juicy.Pixels 1.2.1

2012-04-16 Thread Vincent Berthoux
Hello everyone,

I'm pleased to announce you the new version of Juicy.Pixels, the 1.2.1, no
new major features, here's the changelog :
 - Removed dependency on the array package.
 - Updated dependency list to handle latest mtl version.
 - Helper functions to save files without thinking about it.
 - Some code snippets in the API documentations

GitHub : https://github.com/Twinside/Juicy.Pixels
Hackage : http://hackage.haskell.org/package/JuicyPixels


   Regards

 Vincent Berthoux
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe