Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
fp:lab10 [2021/05/20 12:33]
lfa
fp:lab10 [2021/05/20 13:32] (current)
lfa
Line 52: Line 52:
 10.8 Write a function ''​mkdir :: Path -> FTree -> FTree''​ which takes a path and a filesystem and produces a new filesystem. If the path existed in the original, nothing changes. If the path didn't exist in the original, the new filesystem will contain a directory at that path. 10.8 Write a function ''​mkdir :: Path -> FTree -> FTree''​ which takes a path and a filesystem and produces a new filesystem. If the path existed in the original, nothing changes. If the path didn't exist in the original, the new filesystem will contain a directory at that path.
  
-10.9 Write a function ''​rm :: Path -> FTree -> FTree''​ which takes a path and a filesystem and produces a new filesystem ​where nothing exists ​at that path.+10.9 Write a function ''​rm :: Path -> FTree -> FTree''​ which takes a path and a filesystem and produces a new filesystem ​without the entry at that path.
  
 10.10 Write a function ''​longestPath2 :: FTree -> Path''​ which takes a filesystem and returns the longest path. 10.10 Write a function ''​longestPath2 :: FTree -> Path''​ which takes a filesystem and returns the longest path.
  
-10.11 Write a function ''​findEntry2 :: String -> FTree -> Maybe Path''​ which takes the name of an entry (dir or file) and a filesystem and determines whether that entry can be found in the filesystem. If it doesn'​t exist, ''​Nothing''​ is returned, otherwise ''​Just p''​ where ''​p''​ is the complete path of that entry. +10.11 Write a function ''​findEntry2 :: String -> FTree -> Path''​ which takes the name of an entry (dir or file) and a filesystem and determines whether that entry can be found in the filesystem. If it doesn'​t exist, ​an empty path ''​[]''​ is returned.