seqaid-0.1.1: Seqaid/Demo.hs
{-# LANGUAGE CPP #-}
-- |
-- Module : Seqaid.Demo
-- Copyright : (c) 2014, Andrew G. Seniuk
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Andrew Seniuk <rasfar@gmail.com>
-- Stability : provisional
-- Portability : POSIX, Cabal
--
-- Instrument a sample program (package
-- <http://hackage.haskell.org/package/leaky leaky>)
-- with dynamic forcing functions. Refer to
-- <http://hackage.haskell.org/package/deepseq-bounded deepseq-bounded>
-- for more information about this methodology.
module Main ( main ) where
--module Seqaid.Demo ( main ) where
import System.IO.Temp
import System.Directory
import System.Process
main = do
tdir <- createTempDirectory "." "leaky_"
-- XXX Note that "cabal get" already extracts the tarball for you.
let seqaid_init_bash = "\
\cabal get leaky-0.1.0.0\n\
\cd leaky-0.1.0.0\n\
\cabal configure\n\
\cabal build\n\
\cabal run 123\n\
\echo\n\
\echo \"(Please see " ++ tdir ++ "/leaky-0.1.0.0/README for the interpretation.)\"\n\
\echo\n"
setCurrentDirectory tdir
writeFile "seqaidinit.sh" seqaid_init_bash
p <- getPermissions "seqaidinit.sh"
setPermissions "seqaidinit.sh" (p { executable = True })
system "./seqaidinit.sh"