Skip to content

Instantly share code, notes, and snippets.

@jhegedus42
Created June 21, 2015 10:32
Show Gist options
  • Save jhegedus42/affc0bc6f0ae9413df2c to your computer and use it in GitHub Desktop.
Save jhegedus42/affc0bc6f0ae9413df2c to your computer and use it in GitHub Desktop.
[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 )
source.hs:4:21:
Couldn't match type ‘TextInput’
with ‘Widget
Reflex.Spider.Internal.Spider
(Gui
Reflex.Spider.Internal.Spider
Reflex.Spider.Internal.SpiderHost
(Reflex.Host.Class.HostFrame Reflex.Spider.Internal.Spider))’
Expected type: Widget
Reflex.Spider.Internal.Spider
(Gui
Reflex.Spider.Internal.Spider
Reflex.Spider.Internal.SpiderHost
(Reflex.Host.Class.HostFrame Reflex.Spider.Internal.Spider))
()
Actual type: TextInput ()
In the second argument of ‘($)’, namely
‘el "div"
$ do { t <- textInput def;
dynText $ _textInput_value t }’
In the expression:
mainWidget
$ el "div"
$ do { t <- textInput def;
dynText $ _textInput_value t }
In an equation for ‘main’:
main
= mainWidget
$ el "div"
$ do { t <- textInput def;
dynText $ _textInput_value t }
@ryantrinkle
Copy link

It looks like you might be building this with the master branch of try-reflex. If you delete the def, that will work; however, it's better to update try-reflex to develop.

@jhegedus42
Copy link
Author

Ok, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment