concept disk in category f#

appears as: disk, disk, disks
Get Programming with F#: A guide for .NET developers

This is an excerpt from Manning's book Get Programming with F#: A guide for .NET developers.

  • 1 Writes text to disk
  • 2 Writes several files to disk
  • Storing a serialized transaction log to disk for each customer
  • 19.4. Rehydrating an account from disk

    OK, great—you’ve now managed to get your tool serializing all the transactions to disk. Now, let’s go the other way. On startup, instead of creating a blank account with a balance of £0, the tool should search for a folder for that user (by name), and then rehydrate the current status of the account based on their transaction history. This is simple, again, if you break it into small, composable functions.

    Listing 21.4. Writing functions for a discriminated union
    let seek disk = match disk with | HardDisk _ -> "Seeking loudly at a reasonable speed!" 1 | MMC _ -> "Seeking quietly but slowly" 2 | SolidState -> "Already found it!" seek mySsd 3