Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does the elm signature mean in "Program Never Model Msg"?

Tags:

elm

I'm just starting on elm and without understanding Haskell and its compiler I'm trying to grasp what the signature mean in Html.program

func: (a -> String) -> String -- this means expects a function and return a string
main: Program Never Model Msg -- What does this mean?
like image 939
user2167582 Avatar asked Dec 07 '25 09:12

user2167582


1 Answers

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.

like image 188
Dogbert Avatar answered Dec 10 '25 12:12

Dogbert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!