Implementation of Registry Functionalities

Learn about the implementation of different functions written in the actions.php file for our phonebook registry.

Registry functions in actions.php

It’s impossible to complete the application without factoring in the registry-related functionalities that correspond to the other more sophisticated patterns in the table, that is, interaction with a registry and, therefore, the filesystem. Working with a flat-file registry, or any file for that matter, means that many of the actions performed on the said entity are some variation of read and write operations, or sometimes a mix of both.

Read and write are impure operations, much like printing to a standard output device (a console) and, as such, warrant the usage of the IO monad. The mostly empty bodies of the functions defined in the snippet below are imperative to realizing a fully functioning phonebook.

Get hands-on with 1200+ tech skills courses.