File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,11 @@ Note to reader: Delete this line to expand comment block -}
162
162
suite " Exercise - whereIs" do
163
163
test " locates a file"
164
164
$ Assert .equal (Just (" /bin/" ))
165
+ $ map filename
165
166
$ whereIs root " ls"
166
167
test " doesn't locate a file"
167
168
$ Assert .equal (Nothing )
169
+ $ map filename
168
170
$ whereIs root " cat"
169
171
170
172
{- Note to reader: Delete this line to expand comment block
Original file line number Diff line number Diff line change @@ -127,12 +127,12 @@ allSizes paths =
127
127
)
128
128
paths
129
129
130
- whereIs :: Path -> String -> Maybe String
130
+ whereIs :: Path -> String -> Maybe Path
131
131
whereIs path fileName = head $ whereIs' $ allFiles path
132
132
where
133
- whereIs' :: Array Path -> Array String
133
+ whereIs' :: Array Path -> Array Path
134
134
whereIs' paths = do
135
135
path <- paths
136
136
child <- ls path
137
137
guard $ eq fileName $ fromMaybe " " $ last $ split (Pattern " /" ) $ filename child
138
- pure $ filename path
138
+ pure path
You can’t perform that action at this time.
0 commit comments