-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added type annotations on the mkProgram functions #313
Added type annotations on the mkProgram functions #313
Conversation
As a side note while doing this I was also curious on the type Program<'model, 'msg, 'view> =
{ init : unit -> 'model * Cmd<'msg>
update : 'msg -> 'model -> 'model * Cmd<'msg>
subscribe : 'model -> Cmd<'msg>
view : 'view
debug : bool
onError : (string * exn) -> unit } Does the type Program<'model, 'msg> =
{ init : unit -> 'model * Cmd<'msg>
update : 'msg -> 'model -> 'model * Cmd<'msg>
subscribe : 'model -> Cmd<'msg>
view : 'model -> ('msg -> unit) -> ViewElement
debug : bool
onError : (string * exn) -> unit } This would then make the required function signatures clearer still? If you agree I can update the commit? It would also require adding say a |
Maybe it's related to the StaticView part, but this seems more like an early code that haven't needed updating since then. |
Ok, I'll update the pull request with the types updated. |
Yes the generic 'view is related to the half-elmish support I wonder if we should duplicate out the half-elmish support into an entirely separate DLL. Or deprecate/remove it - though there are still people who advocate it as a stepping stone. |
If you were to remove it I guess the question is |
Today, most of the work goes to the full-elmish approach. We're not actively supporting half-elmish. That way, we separate it from Fabulous and say we won't support it further.
I would prefer to merge this PR as-is. It's useful enough. |
Merging. |
When starting to using the
Program.mkProgram
,Program.mkSimple
the intellisense/compiler currently show generic type names like'a
which makes it hard to work out what your functions need to do:So I've added the type annotations to make it a bit clearer: