Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created September 5, 2021 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/63953e45061087725388cc0b387c288f to your computer and use it in GitHub Desktop.
Save dustinlacewell/63953e45061087725388cc0b387c288f to your computer and use it in GitHub Desktop.
import System.FSNotify
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
main =
withManager $ \mgr -> do
-- start a watching job (in the background)
watchDir
mgr -- manager
"." -- directory to watch
(const True) -- predicate
print -- action
-- sleep forever (until interrupted)
forever $ threadDelay 1000000
import Graphics.Gloss
windowDisplay :: Display
windowDisplay = InWindow "Window" (200, 200) (10, 10)
main :: IO ()
main = animate windowDisplay white animationFunc
animationFunc :: Float -> Picture
animationFunc time = Circle (1 * time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment