packages feed

jsaddle-hello (empty) → 1.0.0.0

raw patch · 4 files changed

+77/−0 lines, 4 filesdep +basedep +ghcjs-domdep +jsaddlesetup-changed

Dependencies added: base, ghcjs-dom, jsaddle, lens

Files

+ LICENSE view
@@ -0,0 +1,23 @@+The MIT License (MIT)++Copyright (c) 2014 Hamish Mackenzie++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+
+ Setup.hs view
@@ -0,0 +1,6 @@+module Main (main) where++import Distribution.Simple++main :: IO ()+main = defaultMain
+ jsaddle-hello.cabal view
@@ -0,0 +1,31 @@+name: jsaddle-hello+version: 1.0.0.0+cabal-version: >=1.6+build-type: Simple+license: MIT+license-file: LICENSE+copyright: (c) Hamish Mackenzie+maintainer: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>+stability: stable+homepage: https://github.com/ghcjs/jsaddle-hello+bug-reports: https://github.com/ghcjs/jsaddle-hello/issues+synopsis: JSaddle Hello World, an example package+description: This is an implementation of the classic "Hello World" program using JSaddle,+             as an example of how to create a minimal JSaddle application.+             Please submit any suggestions and improvements.+category: Web+author: Hamish Mackenzie+data-dir: ""++source-repository head+    type: git+    location: https://github.com/ghcjs/jsaddle-hello++executable jsaddle-hello+    build-depends: base >=4.2 && <5, ghcjs-dom >=0.0.7 && <0.1,+                   jsaddle >=0.1.1.4 && <0.2, lens >=4.0.7 && <5.0+    main-is: Main.hs+    buildable: True+    hs-source-dirs: src++
+ src/Main.hs view
@@ -0,0 +1,17 @@+module Main (+    main+) where++import GHCJS.DOM (runWebGUI, postGUIAsync)+import Control.Lens ((^.))+import Language.Javascript.JSaddle (jsg, js, (<#), runJSaddle_)++main = runWebGUI $ \ webView -> do+    let runjs = postGUIAsync . runJSaddle_ webView++    runjs $ do+        document <- jsg "document"+        let body = js "body"+            innerHtml = js "innerHtml"+        document ^. body ^. innerHtml <# "<h1>Hello World</h1>"+