a*f 发帖数: 1790 | 1 Haskell可以写FP,但是不等于Haskell代码都是FP
下面这段代码定义Web form的一个field,都是描述性的定义,看不出和FP有啥关系,
按这种方式写Web有啥好处?
import Html exposing (Html, Attribute, text, toElement, div, input)
import Html.Attributes exposing (..)
import Html.Events exposing (on, targetValue)
import Signal exposing (Address)
import StartApp.Simple as StartApp
main =
StartApp.start { model = "", view = view, update = update }
update newStr oldStr =
newStr
view : Address String -> String -> Html
view address string =
div []
[ input
... 阅读全帖 |
|