Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/FPLean/MonadTransformers/ReaderIO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ Indeed, it is enough to define {anchorName showFileAndDir}`showFileName` and {an

```anchor showFileAndDir
def showFileName (file : String) : ConfigIO Unit := do
IO.println s!"{(← read).currentPrefix} {file}"
IO.println ((← read).fileName file)

def showDirName (dir : String) : ConfigIO Unit := do
IO.println s!"{(← read).currentPrefix} {dir}/"
IO.println ((← read).dirName dir)
```

One final operation from the original {anchorName ConfigIO}`ConfigIO` remains to be translated to a use of {anchorName MyReaderT}`ReaderT`: {anchorName locally}`locally`.
Expand Down
4 changes: 2 additions & 2 deletions examples/douglib/DirTree.lean
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ instance : MonadLift m (ReaderT ρ m) where

-- ANCHOR: showFileAndDir
def showFileName (file : String) : ConfigIO Unit := do
IO.println s!"{(← read).currentPrefix} {file}"
IO.println ((← read).fileName file)

def showDirName (dir : String) : ConfigIO Unit := do
IO.println s!"{(← read).currentPrefix} {dir}/"
IO.println ((← read).dirName dir)
-- ANCHOR_END: showFileAndDir


Expand Down