on 3caa3db help sign in
20 lines 582 B history raw
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Obelisk.Command.Repl
4 ( runRepl
5 , watch
6 ) where
8import Data.Monoid ((<>))
10import Obelisk.App (MonadObelisk)
11import Obelisk.Command.Project
13-- | Run an interactive repl within a given path
14runRepl :: MonadObelisk m => FilePath -> m ()
15runRepl dir = inProjectShell "ghc" $ "cd " <> dir <> "; cabal new-repl"
17-- | Watch the given directory for errors and warnings
18watch :: MonadObelisk m => FilePath -> m ()
19watch dir = inProjectShell "ghc" $ "cd " <> dir <> "; ghcid -W --command='cabal new-repl'"