Skip to content

Commit 35ac564

Browse files
committed
Add Show and Eq instances for FileFlags
1 parent 9bd4c5c commit 35ac564

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Node/FS.purs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ data FileFlags = R | R_PLUS | RS | RS_PLUS
2525
| W | WX | W_PLUS | WX_PLUS
2626
| A | AX | A_PLUS | AX_PLUS
2727

28+
instance showFileFlags :: Show FileFlags where
29+
show R = "R"
30+
show R_PLUS = "R_PLUS"
31+
show RS = "RS"
32+
show RS_PLUS = "RS_PLUS"
33+
show W = "W"
34+
show WX = "WX"
35+
show W_PLUS = "W_PLUS"
36+
show WX_PLUS = "WX_PLUS"
37+
show A = "A"
38+
show AX = "AX"
39+
show A_PLUS = "A_PLUS"
40+
show AX_PLUS = "AX_PLUS"
41+
42+
instance eqFileFlags :: Eq FileFlags where
43+
eq x y = show x == show y
44+
2845
fileFlagsToNode :: FileFlags -> String
2946
fileFlagsToNode ff = case ff of
3047
R -> "r"

0 commit comments

Comments
 (0)