From 011c064aa3ff6067913e745331946dc1d917a42b Mon Sep 17 00:00:00 2001
From: Jordan Martinez <jordanalex.martinez@protonmail.com>
Date: Tue, 12 Jul 2022 19:19:02 -0500
Subject: [PATCH 1/3] Fix compiler warnings in examples

---
 client/examples/ADTs.purs        | 1 +
 client/examples/DoNotation.purs  | 3 ++-
 client/examples/Generic.purs     | 1 +
 client/examples/Loops.purs       | 1 +
 client/examples/Operators.purs   | 1 +
 client/examples/QuickCheck.purs  | 1 +
 client/examples/Records.purs     | 2 ++
 client/examples/Recursion.purs   | 1 +
 client/examples/TypeClasses.purs | 1 +
 9 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/client/examples/ADTs.purs b/client/examples/ADTs.purs
index 5bc0dec5..a751c4ca 100644
--- a/client/examples/ADTs.purs
+++ b/client/examples/ADTs.purs
@@ -19,5 +19,6 @@ derive instance ordName :: Ord Name
 phoneBook :: Map Name String
 phoneBook = singleton (Name "John" "Smith") "555-555-1234"
 
+main :: Effect Unit
 main = render =<< withConsole do
   logShow (lookup (Name "John" "Smith") phoneBook)
diff --git a/client/examples/DoNotation.purs b/client/examples/DoNotation.purs
index 98bc3141..512e80cf 100644
--- a/client/examples/DoNotation.purs
+++ b/client/examples/DoNotation.purs
@@ -5,7 +5,7 @@ import Control.MonadPlus (guard)
 import Effect.Console (logShow)
 import Data.Array ((..))
 import Data.Foldable (for_)
-import TryPureScript
+import TryPureScript (render, withConsole)
 
 -- Find Pythagorean triples using an array comprehension.
 triples :: Int -> Array (Array Int)
@@ -16,5 +16,6 @@ triples n = do
   guard $ x * x + y * y == z * z
   pure [x, y, z]
 
+main :: Effect Unit
 main = render =<< withConsole do
   for_ (triples 20) logShow
diff --git a/client/examples/Generic.purs b/client/examples/Generic.purs
index 1fea8470..e461a772 100644
--- a/client/examples/Generic.purs
+++ b/client/examples/Generic.purs
@@ -45,6 +45,7 @@ instance eqPerson :: Eq Person where
 instance ordPerson :: Ord Person where
   compare = genericCompare
 
+main :: Effect Unit
 main = render =<< withConsole do
   logShow $ Person
     { first: "John"
diff --git a/client/examples/Loops.purs b/client/examples/Loops.purs
index fc0e1290..bcf907b3 100644
--- a/client/examples/Loops.purs
+++ b/client/examples/Loops.purs
@@ -7,6 +7,7 @@ import Data.Array ((..))
 import Data.Foldable (for_)
 import TryPureScript (render, withConsole)
 
+main :: Effect Unit
 main = render =<< withConsole do
   for_ (10 .. 1) \n -> log (show n <> "...")
   log "Lift off!"
diff --git a/client/examples/Operators.purs b/client/examples/Operators.purs
index 23f56351..4b4cba1d 100644
--- a/client/examples/Operators.purs
+++ b/client/examples/Operators.purs
@@ -16,5 +16,6 @@ infixl 5 subdirectory as </>
 filepath :: FilePath
 filepath = "usr" </> "local" </> "bin"
 
+main :: Effect Unit
 main = render =<< withConsole do
   log filepath
diff --git a/client/examples/QuickCheck.purs b/client/examples/QuickCheck.purs
index e513109d..bac5f296 100644
--- a/client/examples/QuickCheck.purs
+++ b/client/examples/QuickCheck.purs
@@ -5,6 +5,7 @@ import Data.Array (sort)
 import Test.QuickCheck (quickCheck, (===))
 import TryPureScript (render, withConsole, h1, h2, p, text)
 
+main :: Effect Unit
 main = do
   render $ h1 $ text "QuickCheck"
   render $ p $ text """QuickCheck is a Haskell library which allows us to assert properties
diff --git a/client/examples/Records.purs b/client/examples/Records.purs
index deba7d99..413b4c18 100644
--- a/client/examples/Records.purs
+++ b/client/examples/Records.purs
@@ -5,10 +5,12 @@ import Effect.Console (log)
 import TryPureScript (render, withConsole)
 
 -- We can write functions which require certain record labels...
+showPerson :: forall r. { firstName :: String, lastName :: String | r } -> String
 showPerson o = o.lastName <> ", " <> o.firstName
 
 -- ... but we are free to call those functions with any
 -- additional arguments, such as "age" here.
+main :: Effect Unit
 main = render =<< withConsole do
   log $ showPerson
     { firstName: "John"
diff --git a/client/examples/Recursion.purs b/client/examples/Recursion.purs
index fd213181..4f3e9396 100644
--- a/client/examples/Recursion.purs
+++ b/client/examples/Recursion.purs
@@ -12,6 +12,7 @@ isEven :: Int -> Boolean
 isEven 0 = true
 isEven n = isOdd (n - 1)
 
+main :: Effect Unit
 main = render =<< withConsole do
   logShow $ isEven 1000
   logShow $ isEven 1001
diff --git a/client/examples/TypeClasses.purs b/client/examples/TypeClasses.purs
index 5853abf6..58a57abf 100644
--- a/client/examples/TypeClasses.purs
+++ b/client/examples/TypeClasses.purs
@@ -39,6 +39,7 @@ printf = printfWith ""
 debug :: String -> Int -> String -> String
 debug uri status msg = printf "[" uri "] " status ": " msg
 
+main :: Effect Unit
 main = render =<< withConsole do
   log $ debug "http://www.purescript.org" 200 "OK"
   log $ debug "http://bad.purescript.org" 404 "Not found"

From b2c4fa29556471bec5a03f438658c69dc1b3ec9e Mon Sep 17 00:00:00 2001
From: Jordan Martinez <jordanalex.martinez@protonmail.com>
Date: Tue, 12 Jul 2022 19:20:10 -0500
Subject: [PATCH 2/3] Add div with 'root' id to support cookbook recipes

---
 client/public/frame.html | 1 +
 1 file changed, 1 insertion(+)

diff --git a/client/public/frame.html b/client/public/frame.html
index f40cf9bd..317ecd6e 100644
--- a/client/public/frame.html
+++ b/client/public/frame.html
@@ -47,5 +47,6 @@
 </head>
 <body>
   <main id="main"></main>
+  <div id="root"></div>
 </body>
 </html>

From 8919ccd6d7656c57286b9e1f23a6f3c00e4488ab Mon Sep 17 00:00:00 2001
From: Jordan Martinez <jordanalex.martinez@protonmail.com>
Date: Tue, 12 Jul 2022 19:21:56 -0500
Subject: [PATCH 3/3] Add changelog

---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 25a4f37d..b7076855 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ New features:
 Bugfixes:
 
 Other improvements:
+- Fixes compiler warnings in examples (#286 by @JordanMartinez)
+- Support cookbook repo UI recipes by adding element to `frame.html` (#286 by @JordanMartinez)
 
 ## [v2022-07-12.1](https://github.com/purescript/trypurescript/releases/tag/v2022-07-12.1)