COMPSCI 1JC3 Chapter Notes - Chapter 4: Peekaboo, Type Constructor, Init
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.