Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Processing a list of files the Haskell way (Michael Schober)
   2.  Uhc and JavaScript, is it usable? (Nathan H?sken)
   3.  [Haskell Cabal] Failed to compil on install      twidge
      (Gabriel Delattre)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 Mar 2012 12:14:59 +0100
From: Michael Schober <[email protected]>
Subject: Re: [Haskell-beginners] Processing a list of files the
        Haskell way
To: Chadda? Fouch? <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

On 03/14/2012 01:04 PM, Chadda? Fouch? wrote:
> In my own tests it wasn't very fast : 10min to check a 25GB hierarchy of
> music files, using 13MB of memory maximum. Though I must admit that I
> didn't try to find similar tools to compare so I'm not too certain of
> normal performance times.
I finally got it running after a Haskell-platform update from source to 
resolve some dependencies, but now it works like a charm. Runtime isn't 
an issue for me so far and memory consumption seems to be in acceptable 
levels, so it's a very good start - thanks again.

I took the liberty to modify the output a little bit to my needs - maybe 
a future reader will find it helpful, too. It's attached below.

Best,
Michael

-- 

module Main where

import Data.Conduit.Filesystem (traverse)
import qualified Data.Conduit.List as CL
import Data.Conduit

import Data.Digest.Pure.MD5 (MD5Digest)
import Crypto.Conduit (hashFile)

import qualified Data.Map as M
import qualified Filesystem.Path.CurrentOS as FP
import System.Environment

duplicates :: FilePath -> IO [(MD5Digest,[FilePath])]
duplicates dir = runResourceT $ do
    md5s <- traverse False (FP.decodeString dir) $$ CL.mapM process =$ 
CL.fold buildMap M.empty
    return . M.assocs . M.filter ((>1).length) $ md5s
      where
        process :: FP.FilePath -> IO (MD5Digest, FilePath)
        process fp = do
          let strFp = FP.encodeString fp
          md5 <- hashFile strFp
          return (md5,strFp)
        buildMap m (md5,fp) = M.insertWith' (flip (++)) md5 [fp] m

main = do
   [dir] <- getArgs
   putStrLn . unlines . map (\(md5,paths) -> (show md5) ++ "-->\n" ++ 
(unlines paths)) =<< duplicates dir



------------------------------

Message: 2
Date: Thu, 15 Mar 2012 22:58:22 +0100
From: Nathan H?sken <[email protected]>
Subject: [Haskell-beginners] Uhc and JavaScript, is it usable?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hi,

I trying to inform myself about the uhc haskell -> js compiler but I can find 
very little information.
Is it mature enough to be used?
Can an interactive application using the canvas for animations be made with it?
Is webgl possible?


Thanks!
Nathan
-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120315/23422ebd/attachment-0001.htm>

------------------------------

Message: 3
Date: Fri, 16 Mar 2012 10:21:42 +0100
From: Gabriel Delattre <[email protected]>
Subject: [Haskell-beginners] [Haskell Cabal] Failed to compil on
        install twidge
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi !

I'm new to Haskell and Cabal. I try to install twidge.

I get this tone of tone of warning. It is a fresh install of Haskell from the 
package (pkg)

$cabal install twidge

                                         ^
5 warnings generated.
[1 of 7] Compiling Codec.Binary.UTF8.String ( Codec/Binary/UTF8/String.hs, 
dist/build/Codec/Binary/UTF8/String.o )

Codec/Binary/UTF8/String.hs:153:5:
    parse error (possibly incorrect indentation)
cabal: Error: some packages failed to install:
ConfigFile-1.1.1 depends on text-0.11.1.13 which failed to install.
HSH-2.0.4 depends on text-0.11.1.13 which failed to install.
HUnit-1.2.4.2 failed during the building phase. The exception was:
ExitFailure 1
HaXml-1.13.3 failed during the building phase. The exception was:
ExitFailure 1
MissingH-1.1.1.0 depends on text-0.11.1.13 which failed to install.
SHA-1.5.0.0 depends on binary-0.5.1.0 which failed to install.
binary-0.5.1.0 failed during the building phase. The exception was:
ExitFailure 1
curl-1.3.7 failed during the building phase. The exception was:
ExitFailure 1
hoauth-0.2.3 depends on utf8-string-0.3.7 which failed to install.
hslogger-1.1.5 depends on text-0.11.1.13 which failed to install.
network-2.3.0.11 depends on text-0.11.1.13 which failed to install.
parsec-3.1.2 depends on text-0.11.1.13 which failed to install.
text-0.11.1.13 failed during the building phase. The exception was:
ExitFailure 1
twidge-1.0.6.1 depends on utf8-string-0.3.7 which failed to install.
utf8-string-0.3.7 failed during the building phase. The exception was:
ExitFailure 1


Also the ton of warning are very long I can not copy paste them here (lines of 
lines of error/warning)
So please find them there :
http://pastebin.com/txVTRw1U


Gabriel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120316/d79be7a3/attachment-0001.htm>

------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 45, Issue 20
*****************************************

Reply via email to