From 70f3992691ceea6d20eb214825d34f5aed99908b Mon Sep 17 00:00:00 2001 From: depsterr Date: Sun, 26 Jun 2022 19:09:57 +0200 Subject: [PATCH] perfectionist details and building --- kino.cabal | 6 +++--- src/Kino/UI.hs | 4 +--- src/Kino/UI/Widgets.hs | 4 +--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/kino.cabal b/kino.cabal index c33f362..5fef7f4 100644 --- a/kino.cabal +++ b/kino.cabal @@ -22,7 +22,7 @@ library other-modules: -- other-extensions: ghc-options: -Wall - build-depends: base ^>=4.14.1.0 + build-depends: base , wreq , aeson , lens-aeson @@ -44,7 +44,7 @@ executable kino other-modules: -- other-extensions: ghc-options: -Wall -threaded - build-depends: base ^>=4.14.1.0 + build-depends: base , kino hs-source-dirs: app default-language: Haskell2010 @@ -54,4 +54,4 @@ test-suite kino-test type: exitcode-stdio-1.0 hs-source-dirs: test main-is: MyLibTest.hs - build-depends: base ^>=4.14.1.0 + build-depends: base diff --git a/src/Kino/UI.hs b/src/Kino/UI.hs index 45fe851..77ef99d 100644 --- a/src/Kino/UI.hs +++ b/src/Kino/UI.hs @@ -62,9 +62,7 @@ runApp = defaultMain app initialState -- | The starting event which grabs the inital listing startEvent :: AppS -> EventM Ident AppS -startEvent s = do - -- todo move unwrapping our response structure into a function - pure =<< liftIO (setMovies s) +startEvent = liftIO . setMovies -- | The drawing function which defers to the proper function -- from UI.Widgets diff --git a/src/Kino/UI/Widgets.hs b/src/Kino/UI/Widgets.hs index 807b31a..0b8d864 100644 --- a/src/Kino/UI/Widgets.hs +++ b/src/Kino/UI/Widgets.hs @@ -30,14 +30,12 @@ select = withAttr (attrName "selected") -- movie to the widget second widget. Used by movieWidgets widgetCons :: AppS -> JSONMovie -> Widget Ident -> Widget Ident widgetCons s m w = - embed $ if Just m == (s ^. appDetails) + (<=> w) $ if Just m == (s ^. appDetails) then select . visible $ if s ^. appExpanded then expandedWidget m else movieWidget m else movieWidget m - where - embed = (<=> w) -- | Returns a big list of all movies movieWidgets :: AppS -> Widget Ident