×
all 18 comments

[–]eegreg 16 points17 points  (6 children)

http://hackage.haskell.org/package/fsnotify

Despite the "Accelerating Haskell Application Development" project being cut short, it still produced a very useful cross-platform file watching library that is now being used by Yesod and we expect eventually all Haskell file watching needs. The student has been very slowly fixing bugs & improving the library from real world feedback.

By the definition of success given here (produce a library that others depend on) this project will most certainly meet it, although it may need more time to reach popularity goals.

This project is succeeding despite the circumstances by design because it had incremental goals (given more GSoC time even more would have been achieved).

[–]chrisdoner 2 points3 points  (3 children)

I had a few mintes, so I thought I'd try this library and I got this far:

 chris@midnight:~$ cabal install fsnotify
 chris@midnight:~$ ghci
 Prelude> :m + System.FSNotify
 Prelude System.FSNotify> :set prompt "IT'S HASKELL TIME> "
 IT'S HASKELL TIME> withManager (\w -> watchDir w "/tmp/" 
 IT'S HASKELL TIME> :t watchDir
 watchDir
   :: WatchManager
      -> system-filepath-0.4.7:Filesystem.Path.Internal.FilePath
      -> fsnotify-0.0.4:System.FSNotify.Types.ActionPredicate
      -> fsnotify-0.0.4:System.FSNotify.Types.Action
      -> IO ()
 IT'S HASKELL TIME> :i ActionPredicate

 Top level: Not in scope: data constructor `ActionPredicate'

I demand an explanation for this! ლ(ಠ益ಠლ) (Seriously, how do I use this library?)

[–]ArtyomKazak 2 points3 points  (0 children)

I think the author has simply forgotten to export some modules. Here is how I think it should work:

import Data.Text (pack)
import Filesystem.Path.CurrentOS (fromText)
import System.FSNotify

path = fromText $ pack "/tmp"
pred = const True  --ActionPredicate ~ (Event -> Bool)
act  = print  --Action ~ (Event -> IO ())

main = do
  wm <- startManager  --for some reason withManager didn’t work for me
  watchDir wm path pred act
  stopManager wm

[–]eegreg 0 points1 point  (1 child)

Hi Chris, we will add an example in the README, glad you got that far :)

import System.FSNotify
import System.FSNotify.Devel

watch :: IO WatchManager
watch = do
  wd <- getWorkingDirectory
  man <- startManager
  coffee man wd
  return man

coffee ∷ WatchManager -> FilePath -> IO () 
coffee man dir = do
  putStrLn $ "coffee " ++ encodeString dir
  treeExtExists man dir "coffee" $ \fp -> do
    compileCoffee2Javascript fp -- invokes the 'coffee' executable

[–]c_wraith 2 points3 points  (0 children)

I think he's got a point, though - why are those functions exposed in the top-level module of the package, if you can't use them?

[–]chrisdoner 1 point2 points  (0 children)

Hm, cool! I'll try this out next time I need to watch files. I tried the inotify lib in the past. Everything installed correctly and I made the trivialist of examples, but it wouldn't pick up anything. Was pretty frustrating, I can tell you! I killed a man!

[–]aseipp 0 points1 point  (0 children)

Man, I hate the lack of inotify on Linux, so I was planning on using this to implement some equivalent of inotifywait for OS X. This is awesome, :)

[–]edwardkmett 8 points9 points  (1 child)

I would argue that Shae's project was successful in that he has created a multi-user collaborative ghci session.

However the approach he took is not one where you leave it running on a server like gwern wants. It is intended for more like 'call for help' scenarios.

[–]apfelmus 0 points1 point  (0 children)

Well, I tend to agree with Gwern here that be project was unsuccessful.

Public server or no, I think Gwern would be happy if people were using it, even if you have to run it locally. That's why we started out with the minimalistic scotty framework; I was never fond of the decision to switch to full-blown Yesod.

[–]sclv 12 points13 points  (1 child)

I no longer think these summaries are even modestly useful, because the judgement criteria are too harsh and too arbitrary. They reflect a bias towards "success" of a gsoc project as something measurable directly measurable in uptake and users within a relatively short span of time.

GSoC projects are chosen, on the other hand, with an eye towards long-term payoff in Haskell infrastructure.

The criteria that would yield us "high success" projects in the sense judged here would also yield us projects that weren't very interesting, useful, or important.

[–]eegreg 6 points7 points  (0 children)

I think this summary is very useful. But I agree that judgement is entirely too quick. Better would be to actually talk to each project and ask them to give their success criteria and an estimate of when they think it will be reached.

[–][deleted] 1 point2 points  (1 child)

50-50 guesser seems arbitrary. Wouldn't it be better to compare to the guesser which uses the sampled success probability of past Haskell SoCs?

[–]gwern[S] 1 point2 points  (0 children)

It doesn't really matter. Doing a quick sum of all the non-2012 successful/unsuccessful ratings, I get a chance of being successful at (4+6+2+3+3+4) / ((4+2+5+1+2+4) + (4+6+2+3+3+4)) = 0.55, which isn't terribly different from a guess of 0.5.

(Why not redo it with 0.55? Well, I already had the code written for doing it with 0.5...)

[–]gwern[S] 1 point2 points  (4 children)

[–]chrisdoner 3 points4 points  (3 children)

I'm stuck in an infinite link clicking loop, HELP M—

[–]gwern[S] 0 points1 point  (2 children)

Don't worry! The actual article doesn't link back to either the email or the Reddit submission, so you'll escape that infinite loop eventually if you just click links at random!

[–]dmwit 3 points4 points  (1 child)

The article now links to the reddit submission (as a link with the text "Edward Kmett"), which means you may now get stuck in an infinite loop after all!

[–]gwern[S] 0 points1 point  (0 children)

D'oh!