назад Оглавление вперед
[25]
The example code shows how the transformer version of the Continuation monad can be used to create a combined monad for using continuations and doing I/O. The example builds on examples 18, 19 and 20. Example 22 This example is discussed in the section: Standard monad transformers. The example code shows how the transformer version of the Writer monad can be used to create a combined monad for logging and doing I/O. The example adds timestamps to the log entries of the firewall simulator from example 17. Example 23 This example is discussed in the section: Standard monad transformers. The example code shows how the transformer version of the Reader monad can be used to create a monad that combines a shared environment with I/O. The example converts the template system of example 16 to use files as templates. Example 24 This example is discussed in the section: Standard monad transformers. The example code uses the StateT transformer on the List monad to create a combined monad for doing non-deterministic stateful computations. The example uses the combined monad to solve a logic problem. Example 25 This example is discussed in the section: An example with multiple monad transformers. The example code uses the StateT and WriterT transformers on the List monad to create a combined monad for doing non-deterministic stateful computations with logging. The example uses the combined monad to solve the N-queens problem. Example 26 This example is discussed in the section: Heavy lifting. The example code demonstrates the use of the lift function and the necessity of managing its use in complex transformer stacks. | | | | | ФП 02005-03 01 | Лист 81 | | | | | | | | № докум. | | | Копиоова Фоомат |
Лист регистрации изменений | Номера листов (страниц) | Всего листов (страниц) в докум. | документа | Входящий № сопроводительного докум. и дата | | | | изменённых | заменённых | | аннулирован-ных | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
[стр.Начало] [стр.1] [стр.2] [стр.3] [стр.4] [стр.5] [стр.6] [стр.7] [стр.8] [стр.9] [стр.10] [стр.11] [стр.12] [стр.13] [стр.14] [стр.15] [стр.16] [стр.17] [стр.18] [стр.19] [стр.20] [стр.21] [стр.22] [стр.23] [стр.24] [стр.25]
|