- Adam Granicz ([email protected], GitHub:granicz, Twitter:@granicz), IntelliFactory
- F# language reference
- Tour of F#
- Syme, D., Granicz. A., Cisternino A. (2017). Expert F# 4.0. 4th Edition. Apress. ISBN 978-1-4842-0741-3.
- Setting up your F# environment
- Formats and tools
- Web programming
- Ways to earn a grade:
- Homework (3x) - 100 points
- Project work (1+1) - 150 points
- Extra credit
- Grade 5 - 225+ points
- Grade 4 - 200+ points
- Grade 3 - 175+ points
- Grade 2 - 150+ points
- Fail - below 150 points
- Assignment #1 - (40 points, due date: Mar 29, 2024).
- Numbers, sequences/lists, mapping/filtering/folding, discriminated unions, functions/recursion
- Assignment #2 - (30 points, due date: May 17, 2024).
- Basic concepts for building web applications with WebSharper
- Assignment #3 - (30 points) - TBD
During the course of the semester, you will work on and complete two larger projects.
-
Mid-term project (50 points, due date: Apr 26, 2024). You should aim for 200+ LOC, not counting boiler-plate and templates/configuration.
-
Personal project (100 points, due date: last Sunday of the semester) - this is a project you can pick for youself, and it is meant to help you explore F# more fully at your own pace and according to your own interest.
Projects can be native, mobile, or web applications. For both the mid-term and end-of-semester projects, you should:
- Use a public repository (hosted on GitHub or any other host), and send its URL via email.
- Have a
README.md
in the root of your repository describing your project, its motivation, and how to build/run it.The README should contain 1) screenshot(s) of your application and 2) a try-live link (for web and mobile apps).
For the try-live link, if your app is client-only, use the repository's
gh-pages
to host it, and add a build action that deploys each commit to it. For an example of such build action, see IntelliLogo'sghpages.yml
, and adapt it to your needs. If your app needs a server-side (for data access, etc.), you should set up auto-deployment to a suitable free host (Azure websites, etc.).If each project was awarded a grade on its own, it would be as follows:
- Grade
1
(fail). The project fails to compile, has no or incomplete README, doesn't have a try-live link, or has been fully or largely copied from elsewhere.- Grade
2
. The project idea is unoriginal (it adds little value over an existing project) or has insufficient content.- Grade
3
. The project idea is unoriginal but the implementation makes significant additions, or it centers on a new idea with missing functionality or incomplete features.- Grade
4
. The project implements an original idea, and presents a well-rounded, standalone contribution that has good practical value.- Grade
5
(outstanding). The project solves a real-life problem for a larger audience, and it does so with a polished user interface (UI) and user experience (UX).See this page for instructions.
You can find the code walkthroughs in the course sandbox repositories:
- DUE-FSharp-Sandbox-2024 - a client-server application
- DUE-FSharp-SPASandbox-2024 - a single-page application (SPA)
If you encounter NuGet errors about missing
WebSharper.*
packages, make sure you have the WebSharper developer NuGet feed configured on your system. See instructions.
Mar 1, 2024 (online)
- Chapter 2, Chapter 3 - Functional programming
- Your first F# program - analyzing a string for duplicate words
- Using F# Interactive (FSI/fsi)
- Bindings - using
let
, left-hand-side (LHS) is a pattern - Values and immutability
- Types and signatures
- Type inference and type annotations
- Functions calls
- Scope
- Dot-notation
- Tuples
- Values and objects
- Opening namespaces and modules -
open
- Values, methods, properties
- MSDN - F# reference
Mar 8, 2024 (online)
- Expert F# 4 - Chapter 3 - Functional programming
- Basic types and their literals (
bool
,int
,float
,double
,string
,unit
) - Arithmetic operators, using type annotations to drive overload selection
- Converting values
- Basic comparison (
=
,<>
,<
,<=
,>
,>=
,min
,max
) - Strings and their characters
- Conditionals
- Recursive functions
- Lists, Arrays
- Options
- Pattern matching
- Function values, function composition, first-class functions
- MSDN - F# reference
- Discriminated unions
- Active patterns
- Namespaces, nested namespaces
- Modules, nested modules
- Functions, anonymous functions, currying, higher-order functions
- https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/,
- https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword
- Recurive, and mutually recursive functions - https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/recursive-functions-the-rec-keyword
- Basic types and their literals (
Mar 15, 2024 - National holiday, no class
Mar 22, 2024 (online)
- Chapter 4 - Imperative programming
- Mutable records
- Mutable let-bindings
- Reference cells
- Arrays, slicing
- .NET collections - lazy vs eager
- Sequences
- Chapter 5
- Exploring some simple type definitions
- Understanding generics
- Making things generic
- Reference and value types
- MSDN - F# reference
Mar 29, 2024 - National holiday, no class
Apr 5, 2024 (online)
Be sure to follow along the course Sandbox repository (see above)
- Asynchronous computations
- Installing WebSharper project templates
- Sitelets - doc
- Routing via endpoint type annotations, endpoint modifiers (
EndPoint
,Json
,FormData
) - Returning various content types (Text, Json, HTML, error codes, custom responses)
- Implementing microservices (POST/GET)
- Routing via endpoint type annotations, endpoint modifiers (
- Client-side programming with WebSharper.UI - doc
- Reactive variables and views
- Templating
- Calling RPCs
- Example application: IntelliLogo
Apr 12, 2024 (online)
- WebSharper.UI templating - see the Sandbox
- Simple web form to collect user data
- Client->Server calls (RPC)
Apr 19, 2024 (online)
- WebSharper.UI templating
- Understanding the difference between
FromDocument
andInline
for the client-side templating behavior
- Understanding the difference between
- WebSharper.Forms - see the Sandbox
- WebSharper.Charting - see the Sandbox
- Active patterns
- Single-case - used for value conversion
- Multi-case - used for subdiving into a closed set of "shapes"
- Partial - used to deal with only a partial set of input values -> must return an option
- Parameterized partial - using an argument to drive how the returned value is computed
Apr 26, 2024 (online)
- Adding popups in your WebSharper applications
- See relevant bits around
LoseChangesReason
in this commit
- See relevant bits around
- Quick overview of libraries available for data access
- Hands-on: Plotting functions - see commit
- WebSharper.Forms to collect data
- Parsing math formulas with active patterns
- Evaluating an AST to compute values of formulas
- Drawing lines on HTML5 Canvas
May 3, 2024 (online)
- Working with the WebSharper SPA template (
websharper-spa
)- Converting sitelets to SPAs - see SPA Sandbox for structuring SPAs
- Switching "pages" in an SPA using client-side routing
- Setting up auto-deploy with GitHub Actions - see sample script
May 10, 2024 (online)
- Looking at several student projects and issues
May 17, 2024 (online) - TBD
May 24, 2024 (online) - TBD