[Haskell-cafe] The Good, the Bad and the GUI

Alberto G. Corona agocorona at gmail.com
Tue Aug 12 20:01:25 UTC 2014


sorry:  instead of

at "result" Html $ ....

is

at "result" Insert $ ....


2014-08-12 21:59 GMT+02:00 Alberto G. Corona <agocorona at gmail.com>:

>
>
>
> 2014-08-12 21:18 GMT+02:00 Wojciech Narczyński <wojtek at power.com.pl>:
>
> W dniu 2014-08-12 01:22, Alberto G. Corona pisze:
>>
>>> But formlets are implemented in the server side.  and you probably think
>>> in applications with heavy use of JavaScript for validations, interaction
>>>  etc. In this case, there is a formlet implementation in the client side,
>>> which is my.. Ahem!... package hplaygroud:
>>>
>>> https://github.com/agocorona/hplayground
>>>
>>>  Very interesting, please allow a few questions about your approach:
>>
>> 1. Would it be possible to save a snapshot of a paritally filled form on
>> the server?
>>
>
> hplayground is client side. but by means of Haste.Ajax it is possible to
> send something to a server.
>
>  do
>          r  <- (+) <$> inputAndSend
>                      <*> inputAndSend
>          p  (show r) ++> noWidget
>      where
>      inputAndSend= do
>          r <- inputInt Nothing `wake` OnKeyPress <++ br
>          sendInt  r
>          return r
>      sendInt i=  send the int trough Haste.Ajax
>
>  2. Would it be possible to display the sum before the values: 3 = [ 1] +
>> [  2] <-- this is rendered HTML, not Haskell?
>>
>> yes, using "at":
>
>  do
>         wraw $ div  ! id "result" $ noHtml
>          r  <- (+) <$> inputInt Nothing `wake` OnKeyPress <++ br
>                      <*> inputInt Nothing `wake` OnKeyPress <++ br
>
>          at "result" Html $ p  (show r) ++> noWidget
>
>
>> (I thought I would have more questions, but somehow I can't think of any
>> right now...)
>>
>> --
>> Kind regards,
>> Wojtek
>>
>
>
>
> --
> Alberto.
>



-- 
Alberto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140812/b099e147/attachment.html>


More information about the Haskell-Cafe mailing list