summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-08 13:15:36 -0500
committerBen Sima <ben@bsima.me>2020-12-08 13:15:36 -0500
commit6722bb77093d16523db926f5894e7d987eeadbf1 (patch)
tree8ceb57f4061039b272df947330b2ba019333ed1d
parent94c9fbf38bc711431cd55d2c7cbe7443e56976f6 (diff)
Slight refactor for clarity
-rw-r--r--Biz/Devalloc.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs
index cb09f10..a806d65 100644
--- a/Biz/Devalloc.hs
+++ b/Biz/Devalloc.hs
@@ -230,11 +230,10 @@ data Analysis = Analysis
instance Lucid.ToHtml Analysis where
toHtmlRaw = Lucid.toHtml
- toHtml analysis =
- Lucid.toHtml <| render
+ toHtml = Lucid.toHtml . render
where
- render :: Lucid.Html ()
- render =
+ render :: Analysis -> Lucid.Html ()
+ render analysis =
Lucid.div_ <| do
Lucid.h1_ "Analysis Results"
Lucid.p_ (Lucid.toHtml <| Text.pack <| show <| targetRepo analysis)
@@ -248,11 +247,7 @@ encodeParams =
. Web.FormUrlEncoded.urlEncodeParams
selectRepo :: Vector GitHub.Repo -> Lucid.Html ()
-selectRepo repos =
- repos
- |> Vector.toList
- |> mapM_ render
- |> Lucid.ul_
+selectRepo = Lucid.ul_ . mapM_ render . Vector.toList
where
render :: GitHub.Repo -> Lucid.Html ()
render repo =