File: Understanding_changesFile_equation.mdwn

package info (click to toggle)
propellor 5.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,788 kB
  • sloc: haskell: 17,913; makefile: 58; perl: 38; sh: 28
file content (15 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Hi, I'm trying to understand a part of the `changesFile` equation, specifically `oldstat`.

```
changesFile :: Checkable p i => p i -> FilePath -> Property i
changesFile p f = checkResult getstat comparestat p
  where
	getstat = catchMaybeIO $ getSymbolicLinkStatus f
	comparestat oldstat = do
		newstat <- getstat
		return $ if samestat oldstat newstat then NoChange else MadeChange
```

As we see, we catch `getstat` given `f`, but what I don't understand or see, is how is `oldstat` been passed/generated?

Thanks for the help.