File tree Expand file tree Collapse file tree 5 files changed +64
-0
lines changed
plutus-profiled-plugin-test Expand file tree Collapse file tree 5 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ packages: cardano-constitution
2727 plutus-metatheory
2828 plutus-tx
2929 plutus-tx-plugin
30+ plutus-profiled-plugin-test
3031 doc/docusaurus/docusaurus-examples.cabal
3132
3233-- We never, ever, want this.
Original file line number Diff line number Diff line change 159159 quick-shell = project . projectVariants . ${ ghc } . shellFor {
160160 name = "plutus-shell-${ ghc } " ;
161161 tools = { cabal = "latest" ; } ;
162+ buildInputs = [
163+ pkgs . git
164+ ] ;
162165 withHoogle = false ;
163166 shellHook = ''
164167 ${ locale-archive-hook }
Original file line number Diff line number Diff line change 1+ {-# OPTIONS_GHC -fplugin=SimplePlugin #-}
2+
3+ module Main where
4+
5+ import Control.Concurrent
6+
7+ main :: IO ()
8+ main = do
9+ let getBool = do
10+ threadDelay 1000000
11+ return False
12+ b <-
13+ {-# SCC "YYYYYYYYYYYYYY" #-}
14+ getBool
15+ putStrLn (" I got a bool from the main module -> " ++ show b)
Original file line number Diff line number Diff line change 1+ cabal-version : 3.0
2+ name : plutus-profiled-plugin-test
3+ version : 0.1.0.0
4+ build-type : Simple
5+ synopsis : Minimal GHC plugin and test executable
6+ category : Development
7+
8+ library
9+ hs-source-dirs : src
10+ exposed-modules : SimplePlugin
11+ build-depends :
12+ , base >= 4.9 && < 5
13+ , ghc
14+
15+ default-language : Haskell2010
16+
17+ executable simple-plugin-test
18+ main-is : Main.hs
19+ hs-source-dirs : app
20+ ghc-options : -threaded -rtsopts -with-rtsopts=-N
21+ build-depends :
22+ , base >= 4.9 && < 5
23+ , plutus-profiled-plugin-test
24+
25+ default-language : Haskell2010
Original file line number Diff line number Diff line change 1+ module SimplePlugin (plugin ) where
2+
3+ import Control.Concurrent
4+ import GHC.Plugins
5+
6+ -- | A very simple GHC plugin that just logs a message during compilation.
7+ plugin :: Plugin
8+ plugin =
9+ defaultPlugin
10+ { installCoreToDos = \ _ todos -> do
11+ let getBool = do
12+ liftIO $ threadDelay 1000000
13+ return True
14+ b <-
15+ {-# SCC "XXXXXXXXXXXXXX" #-}
16+ getBool
17+ putMsgS (" I got a bool from the plugin -> " ++ show b)
18+ pure todos
19+ , pluginRecompile = purePlugin
20+ }
You can’t perform that action at this time.
0 commit comments