Skip to content

Instantly share code, notes, and snippets.

View jhegedus42's full-sized avatar

jhegedus42

  • Helsinki
View GitHub Profile
@js.native
trait Window extends js.Object {
def alert(message: String): Unit = js.native
}
@js.native
@JSName("window")
object W extends Window
This is available [here] as a .lhs file.
Let's just deal with the `MaybeT` transformer.
First some imports:
> import Control.Monad
> import Control.Monad.Trans
> import Control.Monad.Trans.Maybe
[nix-shell:~/try-reflex/reflex-todomvc]$ codex update
cabal: user error (Saved package config file seems to be corrupt. Try re-running the 'configure' command.)
codex: *warning* falling back on dependency resolution using hackage
Nothing to update.
clear = FrameBuffer $ (DepthImage @1 1000, ColorImage @1 navy) -- ...
triangleRasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
colorFragmentCtx = AccumulationContext (DepthOp Less True, ColorOp NoBlending (V4 True True True True))
rasterizeWith = Rasterize
triangles = triangleRasterCtx
cubeVertexStream = Fetch "stream4" Triangles (Attribute "position4" :: Vec 4 Float)
[nix-shell:~/try-reflex]$ cat source.hs
import Reflex.Dom
import Data.Default
main = mainWidget $ el "div" $ do
t <- textInput def
dynText $ _textInput_value t
[nix-shell:~/try-reflex]$ ghcjs source.hs
[1 of 1] Compiling Main ( source.hs, source.js_o )
import Reflex.Dom
main = mainWidget $ el "div" $ do
t <- textInput def
dynText $ _textInput_value t