Gabriella439 / Haskell-Pipes-Safe-Library

Safety for the pipes ecosystem
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Simple execution error on Win32 #17

Open m15k opened 9 years ago

m15k commented 9 years ago

The intent of program

The intent of the program is to crawl a top level directory and look at each file, using libmagic determine if that file is a data file. If so then collect some metrics like create a histogram of the bytes of the file and run a variance against that result.

The issue

On Windows the program just hangs or crashes. Using sysinternals nothing appears to be wrong as far as commands issued through Windows. It should be said that this works flawlessly on Linux.

So I fire up cabal and check the function that does the work against a single file, works as intended.

However, if i do something like this in GHCI

ghci> let a = scanFileSystem "C:\Users\Montez\Documents\Code" ghci> :t a a :: Pipes.ListT (Pipes.Safe.SafeT IO) Info ghci> import Pipes ghci> import Pipes.Safe ghci> runSafeT $ runListT a >> mzero

:27:26: No instance for (MonadPlus (SafeT IO)) arising from a use of `mzero' In the second argument of`(>>)', namely `mzero' In the second argument of`($)', namely `runListT a >> mzero' In the expression: runSafeT $ runListT a >> mzero ghci> runSafeT $ runListT a

(This hangs and never does any work, similarly to how the application operates)

Library versions

pipes-4.1.4 pipes-safe-2.2.0 dirstream-1.0.0

Maybe relevant code gist?

Gabriella439 commented 9 years ago

Thanks for opening the issue! It may take me a couple of weeks, but I will try to complete this as soon as possible.

m15k commented 9 years ago

No worries. Wish I had enough knowledge to squash it myself. On Dec 9, 2014 6:49 PM, "Gabriel Gonzalez" notifications@github.com wrote:

Thanks for opening the issue! It may take me a couple of weeks, but I will try to complete this as soon as possible.

— Reply to this email directly or view it on GitHub https://github.com/Gabriel439/Haskell-Pipes-Safe-Library/issues/17#issuecomment-66386947 .

Gabriella439 commented 9 years ago

I haven't had a chance to look at this yet, but I wanted to point you to my newly released turtle library, which provides a similar functionality (streaming over directory trees): https://hackage.haskell.org/package/turtle-1.0.1/docs/Turtle-Tutorial.html

I'm mentioning this for two reasons:

m15k commented 9 years ago

Awesome, will wire it up tomorrow. On Feb 3, 2015 5:04 PM, "Gabriel Gonzalez" notifications@github.com wrote:

I haven't had a chance to look at this yet, but I wanted to point you to my newly released turtle library, which provides a similar functionality (streaming over directory trees): https://hackage.haskell.org/package/turtle-1.0.1/docs/Turtle-Tutorial.html

I'm mentioning this for two reasons:

-

turtle has a simpler implementation and API and may work for you instead of dirstream.

I would like you to test your program against turtle if you could. The reason why is that I want to see if it's an issue specific to pipes-safe or not

— Reply to this email directly or view it on GitHub https://github.com/Gabriel439/Haskell-Pipes-Safe-Library/issues/17#issuecomment-72755462 .