SkillsCast coming soon.
The first session of the beginners track starts with 'Agebraic Types'. By the end of this session you'll be very comfortable with types an dhow they can be used for practical purposes.
This session is based on this talk.
- Product types and sum types
interactive exercise - isFever function that handles degF and degC
interactive exercise - simple DSL for time
type TimeScale = Hour | Hours | Day | Days | Week | Weeks
type TimeDirection = Ago | Hence]
Maybe and Either
Single case DUs
Simple state machines
Designing for correctness. Make illegal states unrepresentable
interactive exercise - simple shopping cart
Handling errors with Either ("railway oriented programming") rather than exceptions interactive exercise - railway-oriented fizzbuzz
Code project: design the types for a blackjack game. Unions, tuples all over the place!
YOU MAY ALSO LIKE: