This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# Language JavaScriptFFI #-} | |
{-# Language OverloadedStrings #-} | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
describeString :: Text -> String | |
describeString n = mconcat | |
[ T.unpack n | |
, " (" | |
, show n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RecursiveDo #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.Map as Map | |
import qualified Data.Text as T | |
import Reflex.Dom | |
import GHCJS.DOM.Element (setScrollTop, getScrollHeight) | |
main :: IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Control.Lens ((&), (%~), (.~)) | |
import Data.Proxy | |
import Reflex.Dom | |
main :: IO () | |
main = mainWidget $ do | |
(click, ()) <- linkPreventDefault $ text "O.S." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Frontend where | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Obelisk.Frontend | |
import Obelisk.Route | |
import Reflex.Dom.Core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE CPP #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
#ifdef ghcjs_HOST_OS | |
import Reflex.Dom | |
#else | |
import Language.Javascript.JSaddle.Warp (run) | |
import Reflex.Dom.Core | |
#endif | |
main :: IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language PackageImports #-} | |
import Control.Monad | |
import "ghcjs-dom" GHCJS.DOM.Document (getBody) | |
import GHCJS.DOM.EventM (on, preventDefault) | |
import GHCJS.DOM.GlobalEventHandlers (keyDown) | |
import Reflex.Dom hiding (preventDefault) | |
import Web.KeyCode | |
main :: IO () | |
main = mainWidget $ do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TupleSections #-} | |
import Control.Arrow ((&&&)) | |
import Control.Monad.IO.Class (liftIO) | |
import qualified Data.Map as Map | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Reflex.Dom | |
main :: IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TupleSections #-} | |
import Control.Arrow ((&&&)) | |
import Control.Monad.IO.Class (liftIO) | |
import qualified Data.Map as Map | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Reflex.Dom | |
main :: IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables, RankNTypes #-} | |
import Reflex.Dom | |
import Data.Monoid ((<>)) | |
import Data.List (isPrefixOf) | |
main :: IO () | |
main = mainWidgetWithHead headTag bodyTag | |
headTag :: MonadWidget t m => m () | |
headTag = elAttr "link" ("rel" =: "stylesheet" <> "href" =: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") $ return () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad.IO.Class | |
import GHCJS.DOM (webViewGetDomDocument) | |
import GHCJS.DOM.Document (getBody) | |
import GHCJS.DOM.Element (keyDown) | |
import GHCJS.DOM.EventM (on, preventDefault) | |
import Reflex.Dom | |
main :: IO () | |
main = mainWidget $ do |
NewerOlder