COMPSCI 1JC3 Chapter Notes - Chapter 4: Peekaboo, Type Constructor, Init

40 views3 pages

Document Summary

Comp sci chapter 4 fold, signals and functional reactive programming. To get the position of the mouse for a simple game called peekaboo, new modules must be imported: module peekaboo where import graphics . Coll age exposing ( . import color exposing ( . import mouse import si g n al. Now there is also a new type for the main function signal element. A new function is also used signal. map which looks a lot like list. map. The type signal element uses a type constructor signal analogous to list, which took one type and defined the type of a list of elements of that type. A signal is a lot like a list. List defines a list of values put together at one time, while signal defines list of values which are generated one at a time. Signal. map works by mapping a function over the values which arrive in the signal over time.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents