This file contains 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 Reflex.Dom | |
main = mainWidget $ el "div" $ do | |
t <- textInput def | |
dynText $ _textInput_value t |
This file contains 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
[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 ) |
This file contains 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
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) |
This file contains 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
[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. | |
This file contains 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
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 |
This file contains 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
@js.native | |
trait Window extends js.Object { | |
def alert(message: String): Unit = js.native | |
} | |
@js.native | |
@JSName("window") | |
object W extends Window |
This file contains 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
In Scala: | |
@js.native | |
trait Props extends js.Object { | |
val value: String = js.native | |
val items: scala.collection.mutable.Seq[String] = js.native | |
} | |
@JSExport | |
val TestCompB: ReqProps[Props, Unit, Unit, TopNode] = |
This file contains 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
module Main where | |
import Prelude | |
import Data.Foldable (for_) | |
import Data.String (length, fromCharArray) | |
import Data.Unfoldable (replicate) | |
import Control.Monad.Eff | |
import Control.Monad.Eff.Console (log) |
This file contains 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
@js.native | |
trait Props extends js.Object { | |
var value: String = js.native | |
var index: Int = js.native | |
var key: String = js.native | |
} | |
case class ScalaProps(val value:String, val index:Int, val key:String) | |
// how do i convert ScalaProps to Props ? |
This file contains 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 MyProducers.MapProducer | |
trait Entity | |
case class Ref[T](id: String) | |
case class IntEntity(int: Int) | |
case class StringEntity(s: String) | |
trait RefResolver { |
OlderNewer