Zulip Chat Archive

Stream: Is there code for X?

Topic: Check if file exists


Adam Topaz (Aug 29 2023 at 21:55):

Do we have some function, with type signature System.FilePath -> IO Bool for example, that checks whether a file exists in the filesystem?

Adam Topaz (Aug 29 2023 at 21:56):

@loogle System.FilePath -> IO Bool

loogle (Aug 29 2023 at 21:56):

:search: docs#System.FilePath.walkDir, docs#System.FilePath.walkDir.go

Kyle Miller (Aug 29 2023 at 22:23):

:search: docs#System.FilePath.pathExists

Adam Topaz (Aug 29 2023 at 22:24):

BaseIO!

Kyle Miller (Aug 29 2023 at 22:24):

(@Henrik Böving In the docs System.FilePath is showing up as Lake.FilePath. Do you have any idea why?)

Scott Morrison (Aug 29 2023 at 23:13):

Oooh, could loogle know about monads?

Joachim Breitner (Aug 30 2023 at 08:00):

@loogle System.FilePath, "exist"

loogle (Aug 30 2023 at 08:00):

:shrug: nothing found

Henrik Böving (Aug 30 2023 at 08:01):

Kyle Miller said:

(Henrik Böving In the docs System.FilePath is showing up as Lake.FilePath. Do you have any idea why?)

O_O no I didn't notice that yet, I'll investigate, thats a fun one

Joachim Breitner (Aug 30 2023 at 08:01):

@loogle System.FilePath, "Exist"

loogle (Aug 30 2023 at 08:01):

:search: docs#System.FilePath.pathExists

Joachim Breitner (Aug 30 2023 at 08:02):

Ok, I should certainly do the match case insensitively

Mario Carneiro (Aug 30 2023 at 08:02):

also underscore insensitively

Joachim Breitner (Aug 30 2023 at 08:03):

That's already harder, but you can search for multiple words.

Mario Carneiro (Aug 30 2023 at 08:03):

it could just be a noncontiguous substring

Joachim Breitner (Aug 30 2023 at 08:03):

@loogle BaseIO, "File", "Exists"

loogle (Aug 30 2023 at 08:03):

:search: docs#System.FilePath.pathExists

Joachim Breitner (Aug 30 2023 at 08:04):

Is the autocompletion algorithm used by VSCode exposed in the libraries somewhere? Is it using some kind of index?

Julian Berman (Sep 01 2023 at 09:38):

I don't recall what VSCode specifically does, but I like linking to https://github.com/jhawthorn/fzy/blob/master/ALGORITHM.md as both a good overview of possibilities as well as what I personally find most intuitive (the one it implements)


Last updated: Dec 20 2023 at 11:08 UTC