Learn how to define and instantiate F# discriminated unions. Learn how to identify discriminated union instances and recover their payloads using pattern matching.
- [Instructor] The next construct we're going to look at…is the discriminated union…and here really, if you're just used to…object oriented languages like C# and Java,…here's where we strike out into completely new territory.…We're declaring a type here.…The type is called shape…and that shape can take three subtypes.…The subtypes are a square,…that's simply a label.…The word square is simply a label.…It's not related to that square function…where we were multiplying things by themselves earlier on.…A square, if you calculate this area,…you really only need one piece of information…and that's the length of one of those sides,…so we're saying if you're going to create a square,…you're just going to give its value…and we're going to call that side.…
Another subthing of shape is a rectangle.…For a rectangle, you're going to need to give…a length and a height.…Again, that fully defines the size of the rectangle.…We're not worried about position here,…we're just worrying about area.…The third kind of shape we might want to talk about…
- Defining values and calling functions in F#
- Defining and identifying discriminated unions
- Working with if-else expressions
- Writing unit test
- Using type providers to access data
- Analyzing data with collection functions
- Plotting data using the R type provider
- Using railway-oriented programming to handle errors
- Integrating with Twitter
- Deploying an F# application to Azure
Skill Level Intermediate
1. Get Started with F#
2. Build a Simple Parser with Unit Testing
3. Use F# CSV Type Provider to Get Data
4. Analyze Data with F# Collection Functions
5. Use RStats Provider and ggplot2 to Plot Data
6. Use BoxKite with Twitter
7. Deploy a Working Bot
Next steps1m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.