Copyright | (c) Dennis Gosnell 2018 |
---|---|
License | BSD3 |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module exposes termonad's basic configuration options, as well as defaultMain
.
If you want to configure Termonad, please take a look at Termonad.Config.
Synopsis
- defaultMain :: TMConfig -> IO ()
- start :: TMConfig -> IO ()
- module Termonad.Config
Documentation
defaultMain :: TMConfig -> IO () Source #
Run Termonad with the given TMConfig
.
This function will check if there is a ~/.config/termonad/termonad.hs
file
and a ~/.cache/termonad/termonad-linux-x86_64
binary. Termonad will
perform different actions based on whether or not these two files exist.
Here are the four different possible actions based on the existence of these two files.
~/.config/termonad/termonad.hs
exists,~/.cache/termonad/termonad-linux-x86_64
existsThe timestamps of these two files are checked. If the
~/.config/termonad/termonad.hs
file has been modified after the~/.cache/termonad/termonad-linux-x86_64
binary, then Termonad will use GHC to recompile the~/.config/termonad/termonad.hs
file, producing a new binary at~/.cache/termonad/termonad-linux-x86_64
. This new binary will be re-executed. TheTMConfig
passed to thisdefaultMain
will be effectively thrown away.If GHC fails to recompile the
~/.config/termonad/termonad.hs
file, then Termonad will just executestart
with theTMConfig
passed in.If the
~/.cache/termonad/termonad-linux-x86_64
binary has been modified after the~/.config/termonad/termonad.hs
file, then Termonad will re-exec the~/.cache/termonad/termonad-linux-x86_64
binary. TheTMConfig
passed to thisdefaultMain
will be effectively thrown away.~/.config/termonad/termonad.hs
exists,~/.cache/termonad/termonad-linux-x86_64
does not existTermonad will use GHC to recompile the
~/.config/termonad/termonad.hs
file, producing a new binary at~/.cache/termonad/termonad-linux-x86_64
. This new binary will be re-executed. TheTMConfig
passed to thisdefaultMain
will be effectively thrown away.If GHC fails to recompile the
~/.config/termonad/termonad.hs
file, then Termonad will just executestart
with theTMConfig
passed in.~/.config/termonad/termonad.hs
does not exist,~/.cache/termonad/termonad-linux-x86_64
existsTermonad will ignore the
~/.cache/termonad/termonad-linux-x86_64
binary and just runstart
with theTMConfig
passed to this function.~/.config/termonad/termonad.hs
does not exist,~/.cache/termonad/termonad-linux-x86_64
does not existTermonad will run
start
with theTMConfig
passed to this function.
Other notes:
- That the locations of
~/.config/termonad/termonad.hs
and~/.cache/termonad/termonad-linux-x86_64
may differ depending on your system. - In your own
~/.config/termonad/termonad.hs
file, you can use eitherdefaultMain
orstart
. As long as you always execute the system-widetermonad
binary (instead of the binary produced as~/.cache/termonad/termonad-linux-x86_64
), the effect should be the same.
start :: TMConfig -> IO () Source #
Run Termonad with the given TMConfig
.
Do not perform any of the recompilation operations that the defaultMain
function does.
module Termonad.Config