Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit df575c6

Browse files
committed
Make function comments psc-doc friendly
1 parent e3bd38d commit df575c6

File tree

1 file changed

+50
-47
lines changed

1 file changed

+50
-47
lines changed

src/Node/FS/Aff.purs

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -39,180 +39,180 @@ import qualified Node.FS.Async as A
3939
toAff :: forall eff a.
4040
(A.Callback eff a -> Eff (fs :: F.FS | eff) Unit) ->
4141
Aff (fs :: F.FS | eff) a
42-
toAff p = makeAff (\e a -> p $ either e a)
42+
toAff p = makeAff \e a -> p $ either e a
4343

4444
toAff1 f a = toAff (f a)
4545
toAff2 f a b = toAff (f a b)
4646
toAff3 f a b c = toAff (f a b c)
4747

4848
-- |
49-
-- Renames a file.
50-
--
49+
-- | Rename a file.
50+
-- |
5151
rename :: forall eff. FilePath
5252
-> FilePath
5353
-> Aff (fs :: F.FS | eff) Unit
5454
rename = toAff2 A.rename
5555

5656
-- |
57-
-- Truncates a file to the specified length.
58-
--
57+
-- | Truncates a file to the specified length.
58+
-- |
5959
truncate :: forall eff. FilePath
6060
-> Number
6161
-> Aff (fs :: F.FS | eff) Unit
6262
truncate = toAff2 A.truncate
6363

6464
-- |
65-
-- Changes the ownership of a file.
66-
--
65+
-- | Changes the ownership of a file.
66+
-- |
6767
chown :: forall eff. FilePath
6868
-> Number
6969
-> Number
7070
-> Aff (fs :: F.FS | eff) Unit
7171
chown = toAff3 A.chown
7272

7373
-- |
74-
-- Changes the permissions of a file.
75-
--
74+
-- | Changes the permissions of a file.
75+
-- |
7676
chmod :: forall eff. FilePath
7777
-> Perms
7878
-> Aff (fs :: F.FS | eff) Unit
7979
chmod = toAff2 A.chmod
8080

8181
-- |
82-
-- Gets file statistics.
83-
--
82+
-- | Gets file statistics.
83+
-- |
8484
stat :: forall eff. FilePath
8585
-> Aff (fs :: F.FS | eff) Stats
8686
stat = toAff1 A.stat
8787

8888
-- |
89-
-- Creates a link to an existing file.
90-
--
89+
-- | Creates a link to an existing file.
90+
-- |
9191
link :: forall eff. FilePath
9292
-> FilePath
9393
-> Aff (fs :: F.FS | eff) Unit
9494
link = toAff2 A.link
9595

9696
-- |
97-
-- Creates a symlink.
98-
--
97+
-- | Creates a symlink.
98+
-- |
9999
symlink :: forall eff. FilePath
100100
-> FilePath
101101
-> F.SymlinkType
102102
-> Aff (fs :: F.FS | eff) Unit
103103
symlink = toAff3 A.symlink
104104

105105
-- |
106-
-- Reads the value of a symlink.
107-
--
106+
-- | Reads the value of a symlink.
107+
-- |
108108
readlink :: forall eff. FilePath
109109
-> Aff (fs :: F.FS | eff) FilePath
110110
readlink = toAff1 A.readlink
111111

112112
-- |
113-
-- Find the canonicalized absolute location for a path.
114-
--
113+
-- | Find the canonicalized absolute location for a path.
114+
-- |
115115
realpath :: forall eff. FilePath
116116
-> Aff (fs :: F.FS | eff) FilePath
117117
realpath = toAff1 A.realpath
118118

119119
-- |
120-
-- Find the canonicalized absolute location for a path using a cache object for
121-
-- already resolved paths.
122-
--
120+
-- | Find the canonicalized absolute location for a path using a cache object
121+
-- | for already resolved paths.
122+
-- |
123123
realpath' :: forall eff cache. FilePath
124124
-> { | cache }
125125
-> Aff (fs :: F.FS | eff) FilePath
126126
realpath' = toAff2 A.realpath'
127127

128128
-- |
129-
-- Deletes a file.
130-
--
129+
-- | Deletes a file.
130+
-- |
131131
unlink :: forall eff. FilePath
132132
-> Aff (fs :: F.FS | eff) Unit
133133
unlink = toAff1 A.unlink
134134

135135
-- |
136-
-- Deletes a directory.
137-
--
136+
-- | Deletes a directory.
137+
-- |
138138
rmdir :: forall eff. FilePath
139139
-> Aff (fs :: F.FS | eff) Unit
140140
rmdir = toAff1 A.rmdir
141141

142142
-- |
143-
-- Makes a new directory.
144-
--
143+
-- | Makes a new directory.
144+
-- |
145145
mkdir :: forall eff. FilePath
146146
-> Aff (fs :: F.FS | eff) Unit
147147
mkdir = toAff1 A.mkdir
148148

149149
-- |
150-
-- Makes a new directory with the specified permissions.
151-
--
150+
-- | Makes a new directory with the specified permissions.
151+
-- |
152152
mkdir' :: forall eff. FilePath
153153
-> Perms
154154
-> Aff (fs :: F.FS | eff) Unit
155155
mkdir' = toAff2 A.mkdir'
156156

157157
-- |
158-
-- Reads the contents of a directory.
159-
--
158+
-- | Reads the contents of a directory.
159+
-- |
160160
readdir :: forall eff. FilePath
161161
-> Aff (fs :: F.FS | eff) [FilePath]
162162
readdir = toAff1 A.readdir
163163

164-
--|
165-
-- Sets the accessed and modified times for the specified file.
166-
--
164+
-- |
165+
-- | Sets the accessed and modified times for the specified file.
166+
-- |
167167
utimes :: forall eff. FilePath
168168
-> Date
169169
-> Date
170170
-> Aff (fs :: F.FS | eff) Unit
171171
utimes = toAff3 A.utimes
172172

173173
-- |
174-
-- Reads the entire contents of a file returning the result as a raw buffer.
175-
--
174+
-- | Reads the entire contents of a file returning the result as a raw buffer.
175+
-- |
176176
readFile :: forall eff. FilePath
177177
-> Aff (fs :: F.FS | eff) Buffer
178178
readFile = toAff1 A.readFile
179179

180180
-- |
181-
-- Reads the entire contents of a text file with the specified encoding.
182-
--
181+
-- | Reads the entire contents of a text file with the specified encoding.
182+
-- |
183183
readTextFile :: forall eff. Encoding
184184
-> FilePath
185185
-> Aff (fs :: F.FS | eff) String
186186
readTextFile = toAff2 A.readTextFile
187187

188188
-- |
189-
-- Writes a buffer to a file.
190-
--
189+
-- | Writes a buffer to a file.
190+
-- |
191191
writeFile :: forall eff. FilePath
192192
-> Buffer
193193
-> Aff (fs :: F.FS | eff) Unit
194194
writeFile = toAff2 A.writeFile
195195

196196
-- |
197-
-- Writes text to a file using the specified encoding.
198-
--
197+
-- | Writes text to a file using the specified encoding.
198+
-- |
199199
writeTextFile :: forall eff. Encoding
200200
-> FilePath
201201
-> String
202202
-> Aff (fs :: F.FS | eff) Unit
203203
writeTextFile = toAff3 A.writeTextFile
204204

205205
-- |
206-
-- Appends the contents of a buffer to a file.
207-
--
206+
-- | Appends the contents of a buffer to a file.
207+
-- |
208208
appendFile :: forall eff. FilePath
209209
-> Buffer
210210
-> Aff (fs :: F.FS | eff) Unit
211211
appendFile = toAff2 A.appendFile
212212

213213
-- |
214-
-- Appends text to a file using the specified encoding.
215-
--
214+
-- | Appends text to a file using the specified encoding.
215+
-- |
216216
appendTextFile :: forall eff. Encoding
217217
-> FilePath
218218
-> String
@@ -226,6 +226,9 @@ import Data.Function
226226
foreign import fs "var fs = require('fs');" ::
227227
{ exists :: forall a. Fn2 FilePath (Boolean -> a) Unit }
228228

229+
-- |
230+
-- | Check to see if a file exists.
231+
-- |
229232
exists :: forall eff. String
230233
-> Aff (fs :: F.FS | eff) Boolean
231234
exists file = makeAff \_ a -> pure $ runFn2 fs.exists file a

0 commit comments

Comments
 (0)