mirror of
https://github.com/fjvallarino/monomer.git
synced 2024-10-26 19:49:50 +03:00
Initial (partial) commit
This commit is contained in:
parent
177cebfd25
commit
3fb8fa4a4b
2
.ghcid
2
.ghcid
@ -1,3 +1,3 @@
|
||||
--command "stack repl"
|
||||
--command "stack repl monomer:exe:todo"
|
||||
--test ":main"
|
||||
--restart=package.yaml
|
||||
|
43
examples/todo/Main.hs
Normal file
43
examples/todo/Main.hs
Normal file
@ -0,0 +1,43 @@
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Codec.Serialise
|
||||
import Data.Default
|
||||
import Data.Text (Text)
|
||||
import GHC.Generics
|
||||
|
||||
import Monomer
|
||||
|
||||
data TodoModel = TodoModel {
|
||||
_active :: [Todo],
|
||||
_complete :: [Todo]
|
||||
} deriving (Eq, Show, Generic, Serialise)
|
||||
|
||||
data Todo = Todo {
|
||||
_todoDesc :: Text,
|
||||
_todoComplete :: Bool
|
||||
} deriving (Eq, Show, Generic, Serialise)
|
||||
|
||||
data TodoEvt
|
||||
= TodoInit
|
||||
deriving (Eq, Show)
|
||||
|
||||
buildUI wenv model = widgetTree where
|
||||
widgetTree = vstack [
|
||||
label "Test"
|
||||
]
|
||||
|
||||
handleEvent wenv node model evt = case evt of
|
||||
TodoInit -> []
|
||||
|
||||
main = do
|
||||
simpleApp_ model handleEvent buildUI config
|
||||
where
|
||||
model = TodoModel [] []
|
||||
config = [
|
||||
appTheme darkTheme,
|
||||
appFontDef "Regular" "./assets/fonts/Roboto-Regular.ttf"
|
||||
]
|
29
package.yaml
29
package.yaml
@ -1,18 +1,18 @@
|
||||
name: monomer
|
||||
version: 0.1.0.0
|
||||
github: "fjvallarino/monomer"
|
||||
license: BSD3
|
||||
author: "Francisco Vallarino"
|
||||
maintainer: "fjvallarino@gmail.com"
|
||||
copyright: "2018 Francisco Vallarino"
|
||||
name: monomer
|
||||
version: 0.1.0.0
|
||||
github: "fjvallarino/monomer"
|
||||
license: BSD3
|
||||
author: "Francisco Vallarino"
|
||||
maintainer: "fjvallarino@gmail.com"
|
||||
copyright: "2018 Francisco Vallarino"
|
||||
|
||||
extra-source-files:
|
||||
- README.md
|
||||
- ChangeLog.md
|
||||
|
||||
# Metadata used when publishing your package
|
||||
# synopsis: GUI Library
|
||||
# category: GUI
|
||||
synopsis: GUI Library
|
||||
category: GUI
|
||||
|
||||
# To avoid duplicated efforts in documentation and dealing with the
|
||||
# complications of embedding Haddock markup inside cabal files, it is
|
||||
@ -64,8 +64,8 @@ library:
|
||||
|
||||
executables:
|
||||
monomer-exe:
|
||||
main: Main.hs
|
||||
source-dirs: app
|
||||
main: Main.hs
|
||||
source-dirs: app
|
||||
ghc-options:
|
||||
- -fwarn-incomplete-patterns
|
||||
- -threaded
|
||||
@ -78,6 +78,13 @@ executables:
|
||||
- lens
|
||||
- monomer
|
||||
|
||||
todo:
|
||||
main: Main.hs
|
||||
source-dirs: examples/todo
|
||||
dependencies:
|
||||
- lens
|
||||
- monomer
|
||||
|
||||
tests:
|
||||
monomer-test:
|
||||
main: Spec.hs
|
||||
|
Loading…
Reference in New Issue
Block a user