榆树签名在"Program Never Model Msg"中是什么意思? [英] what does the elm signature mean in "Program Never Model Msg"?
问题描述
我只是开始使用Elm,并且不了解Haskell及其编译器我正在尝试掌握 Html.program
func:(a->字符串)->字符串-这意味着需要一个函数并返回一个字符串main:程序Never Model Msg-这是什么意思?
Program
是由以下三个类型变量参数化的类型: flags
, model
和 msg
. 从不
是不能有任何值的类型(请参阅链接,以获取对它的含义以及与单位类型()
的区别)的很好解释.
的程序的类型code>,并传递类型为 I'm just starting on elm and without understanding Haskell and its compiler
I'm trying to grasp what the signature mean in
这篇关于榆树签名在"Program Never Model Msg"中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!程序从不模型消息
因此是没有任何标志(从不
),模型类型为 Model
Msg
的消息.Html.program
func: (a -> String) -> String -- this means expects a function and return a string
main: Program Never Model Msg -- What does this mean?
Program
is a type parameterized by three type variables: flags
, model
, and msg
. Never
is a type that cannot have any value (see the link for a good explanation of what this means and how it differs from the unit type ()
).Program Never Model Msg
therefore is the type of a program that doesn't have any flags (Never
), has a model of type Model
, and passes messages of type Msg
.