summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorgnusosa@2538fbd05a723a8f83b066e159f5d5f83b9f400d2016-02-24 20:19:17 +0000
committeradmin2016-02-24 20:19:17 +0000
commit8c30a41ab97ac127ea0ba98e23540f7790f6dbfb (patch)
tree06b7fb3d4956e69d96fcce15344d7e1505f2d032 /doc
parent17b1fcef0881e8edb5e78a6f78d4c1fee481a25f (diff)
Diffstat (limited to 'doc')
-rw-r--r--doc/forum/Understanding_changesFile_equation.mdwn15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/forum/Understanding_changesFile_equation.mdwn b/doc/forum/Understanding_changesFile_equation.mdwn
new file mode 100644
index 00000000..5e360097
--- /dev/null
+++ b/doc/forum/Understanding_changesFile_equation.mdwn
@@ -0,0 +1,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.