-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
The return types of picture
, animation
, and game
are pretty intense for newcomers, particularly those not super comfortable with advanced type signatures. Additionally, they are hard-coded with internal types which causes confusion. I think hiding that behind a type alias would make the experience much more approachable. Something like:
type alias PictureProgram =
Platform.Program () Screen ( Basics.Int, Basics.Int )
type alias AnimationProgram =
Platform.Program () Animation Msg
type alias GameProgram memory =
Platform.Program () (Game memory) Msg
This would allow folks to write programs like:
main : PictureProgram
main =
picture [ circle blue 40 ]
or
main : AnimationProgram
main =
animation view
or
main : GameProgram Memory
main =
game view update initialMemory
Metadata
Metadata
Assignees
Labels
No labels