Compare commits
No commits in common. "44bc4d8832788b76e3d7255baf31f8185984bf8e" and "f3004eb020d8d9dba84fea3008e0e6b3563b2170" have entirely different histories.
44bc4d8832
...
f3004eb020
@ -8,4 +8,4 @@ before_script:
|
|||||||
- mkdir -p ~/.config/nixpkgs
|
- mkdir -p ~/.config/nixpkgs
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- nix-build ./release.nix --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://cache.nixos.org https://masser-ebook-manager.cachix.org" -A backend -A frontend
|
- nix-build ./release.nix -A backend --option trusted-public-keys "masser-ebook-manager.cachix.org-1:mtFSkQ2MO5MvjUpulZoFKjKUIa8g8CTcdPVuJaPKS1w= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option binary-caches "https://cache.nixos.org https://masser-ebook-manager.cachix.org"
|
||||||
|
12
default.nix
12
default.nix
@ -1,18 +1,11 @@
|
|||||||
{ nixpkgs, haskellPackages }:
|
{ nixpkgs, haskellPackages }:
|
||||||
|
|
||||||
let
|
let jsaddle = nixpkgs.fetchFromGitHub {
|
||||||
jsaddle = nixpkgs.fetchFromGitHub {
|
|
||||||
owner = "ghcjs";
|
owner = "ghcjs";
|
||||||
repo = "jsaddle";
|
repo = "jsaddle";
|
||||||
rev = "68208be806c49a2a0c9f037dfac85feae10a8c80";
|
rev = "68208be806c49a2a0c9f037dfac85feae10a8c80";
|
||||||
sha256 = "0acj0x716ikfb08ndib36jmwxkwq399lvkip46sfkh1ynn0pvc1c";
|
sha256 = "0acj0x716ikfb08ndib36jmwxkwq399lvkip46sfkh1ynn0pvc1c";
|
||||||
};
|
};
|
||||||
miso = nixpkgs.fetchFromGitHub {
|
|
||||||
owner = "dmjio";
|
|
||||||
repo = "miso";
|
|
||||||
rev = "a9c4f0a3a6e7d87f9432dc6cf4b1d0c052bf7ef1";
|
|
||||||
sha256 = "1yq5y4vffslm6abnfnggp5m3k6vla6mzcwmhmm23l8yizsvdkwv2";
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -26,7 +19,6 @@ in
|
|||||||
generic-lens = nixpkgs.haskell.lib.dontCheck super.generic-lens;
|
generic-lens = nixpkgs.haskell.lib.dontCheck super.generic-lens;
|
||||||
jsaddle-warp = nixpkgs.haskell.lib.dontCheck (super.callPackage (jsaddle + "/jsaddle-warp") {});
|
jsaddle-warp = nixpkgs.haskell.lib.dontCheck (super.callPackage (jsaddle + "/jsaddle-warp") {});
|
||||||
jsaddle = super.callPackage (jsaddle + "/jsaddle") {};
|
jsaddle = super.callPackage (jsaddle + "/jsaddle") {};
|
||||||
miso = super.callPackage (miso + "/miso-ghc-jsaddle.nix") {};
|
|
||||||
};
|
};
|
||||||
tools = with haskellPackages; [
|
tools = with haskellPackages; [
|
||||||
ghcid
|
ghcid
|
||||||
|
@ -23,6 +23,5 @@ executable frontend
|
|||||||
, common
|
, common
|
||||||
, miso
|
, miso
|
||||||
, jsaddle-warp
|
, jsaddle-warp
|
||||||
, mtl
|
|
||||||
hs-source-dirs: src
|
hs-source-dirs: src
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
@ -1,41 +1,4 @@
|
|||||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
||||||
{-# LANGUAGE LambdaCase #-}
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Control.Monad.Trans (liftIO)
|
|
||||||
import Language.Javascript.JSaddle.Warp
|
|
||||||
import Miso
|
|
||||||
import Miso.String
|
|
||||||
|
|
||||||
data Action = Add
|
|
||||||
| Subtract
|
|
||||||
| SayHello
|
|
||||||
| NoOp
|
|
||||||
|
|
||||||
newtype Model = Model Int deriving (Eq, Num, ToMisoString)
|
|
||||||
|
|
||||||
updateModel :: Action -> Model -> Effect Action Model
|
|
||||||
updateModel Add m = noEff (m + 1)
|
|
||||||
updateModel Subtract m = noEff (m - 1)
|
|
||||||
updateModel SayHello m = m <# (liftIO (putStrLn "Hello world") >> pure NoOp)
|
|
||||||
updateModel NoOp m = noEff m
|
|
||||||
|
|
||||||
viewModel :: Model -> View Action
|
|
||||||
viewModel x =
|
|
||||||
div_ [] [ button_ [ onClick Add ] [ text "+" ]
|
|
||||||
, text (ms x)
|
|
||||||
, button_ [ onClick Subtract ] [ text "-" ]
|
|
||||||
]
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = run 8081 $ startApp App{..}
|
main = putStrLn "Hello, Haskell!"
|
||||||
where
|
|
||||||
model = Model 0
|
|
||||||
initialAction = SayHello
|
|
||||||
update = updateModel
|
|
||||||
view = viewModel
|
|
||||||
subs = []
|
|
||||||
events = defaultEvents
|
|
||||||
mountPoint = Nothing
|
|
||||||
|
Loading…
Reference in New Issue
Block a user