summaryrefslogtreecommitdiff
path: root/com/influencedbybooks
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-11-01 14:24:24 -0700
committerBen Sima <ben@bsima.me>2019-11-01 14:25:49 -0700
commit9756eb0806aef63137ed53c7f78eee13aa3db9d7 (patch)
tree0c3bf0becc08e37386109ff8c518fa442df6266b /com/influencedbybooks
parent0a6fd40946f72e9995ca04b05d7556bf20585d4f (diff)
add buildHaskellApp nix function
Diffstat (limited to 'com/influencedbybooks')
-rw-r--r--com/influencedbybooks/aero.hs6
-rw-r--r--com/influencedbybooks/apex.hs15
-rw-r--r--com/influencedbybooks/core.hs2
-rw-r--r--com/influencedbybooks/default.nix32
-rw-r--r--com/influencedbybooks/influencers.hs4
-rw-r--r--com/influencedbybooks/keep.hs6
-rw-r--r--com/influencedbybooks/look.hs2
-rw-r--r--com/influencedbybooks/move.hs4
8 files changed, 18 insertions, 53 deletions
diff --git a/com/influencedbybooks/aero.hs b/com/influencedbybooks/aero.hs
index 92d071d..63066c5 100644
--- a/com/influencedbybooks/aero.hs
+++ b/com/influencedbybooks/aero.hs
@@ -3,11 +3,11 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- | Front-end
-module Com.InfluencedByBooks.Aero where
+module Com.Influencedbybooks.Aero where
import Com.Simatime.Alpha
-import Com.InfluencedByBooks.Move (move)
-import Com.InfluencedByBooks.Core (Action(..), see, init)
+import Com.Influencedbybooks.Move (move)
+import Com.Influencedbybooks.Core (Action(..), see, init)
import Miso (App(..), defaultEvents, miso)
main :: IO ()
diff --git a/com/influencedbybooks/apex.hs b/com/influencedbybooks/apex.hs
index fd4766b..32e6403 100644
--- a/com/influencedbybooks/apex.hs
+++ b/com/influencedbybooks/apex.hs
@@ -8,25 +8,24 @@
{-# LANGUAGE TypeOperators #-}
-- | Server
-module Com.InfluencedByBooks.Apex where
+module Com.Influencedbybooks.Apex where
-import Com.Simatime Alpha
-import Com.InfluencedByBooks.Core
-import qualified Com.InfluencedByBooks.Keep as Keep
-import qualified Com.InfluencedByBooks.Look as Look
+import Com.Simatime.Alpha
+import Com.Influencedbybooks.Core
+import qualified Com.Influencedbybooks.Keep as Keep
+import qualified Com.Influencedbybooks.Look as Look
import qualified Clay
import qualified Data.Text.Lazy as Lazy
import qualified Data.Text.Lazy.Encoding as Lazy
import Data.Maybe (fromMaybe)
import Data.Acid (AcidState)
import qualified Data.Acid.Abstract as Acid
-import GitHash (giHash, tGitInfoCwd)
import qualified Lucid as L
import Lucid.Base
import Miso
import Network.HTTP.Media ((//), (/:))
import Network.HTTP.Types
-import Network.RemoteData
+import Com.Simatime.Network
import Network.Wai
import Network.Wai.Application.Static
import Network.Wai.Handler.Warp
@@ -60,10 +59,8 @@ instance L.ToHtml a => L.ToHtml (HtmlPage a) where
cssRef "/css/main.css"
L.body_ $ do
page
- L.p_ gitCommit
where
page = L.toHtml x
- gitCommit = L.toHtml $ giHash $$tGitInfoCwd
jsRef href = L.with (L.script_ mempty)
[ makeAttribute "src" href
, makeAttribute "type" "text/javascript"
diff --git a/com/influencedbybooks/core.hs b/com/influencedbybooks/core.hs
index 9bd2353..2a616f3 100644
--- a/com/influencedbybooks/core.hs
+++ b/com/influencedbybooks/core.hs
@@ -5,7 +5,7 @@
{-# LANGUAGE OverloadedStrings #-}
-- | Main app logic
-module Com.InfluencedByBooks.Core where
+module Com.Influencedbybooks.Core where
import Com.Simatime.Alpha
import Data.Aeson hiding (Success)
diff --git a/com/influencedbybooks/default.nix b/com/influencedbybooks/default.nix
deleted file mode 100644
index f2ff1ec..0000000
--- a/com/influencedbybooks/default.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-# TODO: translate this back to regular nix?
-{
- name = "ibb";
- deps = {
- both = [
- "clay"
- "miso"
- "protolude"
- "servant"
- "text"
- ];
- apex = [
- "MonadRandom"
- "acid-state"
- "blaze-html"
- "blaze-markup"
- "bytestring"
- "githash"
- "ixset"
- "random"
- "safecopy"
- "scotty"
- "servant-server"
- "text"
- ];
- aero = [
- "aeson"
- "containers"
- "ghcjs-base"
- ];
- };
-}
diff --git a/com/influencedbybooks/influencers.hs b/com/influencedbybooks/influencers.hs
index 2583770..c0cb143 100644
--- a/com/influencedbybooks/influencers.hs
+++ b/com/influencedbybooks/influencers.hs
@@ -2,9 +2,9 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
-module Com.InfluencedByBooks.Influencers where
+module Com.Influencedbybooks.Influencers where
-import Com.InfluencedByBooks.Core
+import Com.Influencedbybooks.Core
allPeople :: [Person]
allPeople =
diff --git a/com/influencedbybooks/keep.hs b/com/influencedbybooks/keep.hs
index 0bc527a..2b7ff3a 100644
--- a/com/influencedbybooks/keep.hs
+++ b/com/influencedbybooks/keep.hs
@@ -10,9 +10,9 @@
-- `Biz.Keep`. I could wrap all the safecopy stuff in my own template haskell
-- like `$(keep ''MyType)`.
--
-module Com.InfluencedByBooks.Keep where
+module Com.Influencedbybooks.Keep where
-import Com.InfluencedByBooks.Core (Person(..), Book(..))
+import Com.Influencedbybooks.Core (Person(..), Book(..))
import Control.Monad.State (get, put)
import Control.Monad.Reader (ask)
import Data.Acid (Update, makeAcidic)
@@ -24,7 +24,7 @@ import Data.SafeCopy
import Data.Text (Text)
import qualified Data.Text as Text
-import qualified Com.InfluencedByBooks.Influencers as Influencers
+import qualified Com.Influencedbybooks.Influencers as Influencers
-- * Keep
diff --git a/com/influencedbybooks/look.hs b/com/influencedbybooks/look.hs
index d61fc11..68ae81f 100644
--- a/com/influencedbybooks/look.hs
+++ b/com/influencedbybooks/look.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
-- | The look and feel of Ibb
-module Com.InfluencedByBooks.Look where
+module Com.Influencedbybooks.Look where
import Com.Simatime.Alpha
import Clay
diff --git a/com/influencedbybooks/move.hs b/com/influencedbybooks/move.hs
index 2c0ee37..63af430 100644
--- a/com/influencedbybooks/move.hs
+++ b/com/influencedbybooks/move.hs
@@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
-- | App update logic
-module Com.InfluencedByBooks.Move (
+module Com.Influencedbybooks.Move (
move
-- * Server interactions
, fetchPeople
@@ -10,7 +10,7 @@ module Com.InfluencedByBooks.Move (
import Alpha
import Data.Aeson
-import Com.InfluencedByBooks.Core as Core
+import Com.Influencedbybooks.Core as Core
import JavaScript.Web.XMLHttpRequest (Request(..), Method(GET), RequestData(NoData), contents, xhrByteString)
import Miso
import Miso.String