Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New takeDirectory function #79

Merged
merged 1 commit into from Sep 13, 2019
Merged

New takeDirectory function #79

merged 1 commit into from Sep 13, 2019

Conversation

newhoggy
Copy link
Collaborator

@newhoggy newhoggy commented Sep 12, 2019

λ> takeDirectory (S3Uri "blah" "aa/bb/cc")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey "aa/bb"}
λ> takeDirectory (S3Uri "blah" "aa/bb/c")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey "aa/bb"}
λ> takeDirectory (S3Uri "blah" "aa/bb/")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey "aa"}
λ> takeDirectory (S3Uri "blah" "aa/bb")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey "aa"}
λ> takeDirectory (S3Uri "blah" "aa/")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey ""}
λ> takeDirectory (S3Uri "blah" "aa")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey ""}
λ> takeDirectory (S3Uri "blah" "")
S3Uri {bucket = BucketName "blah", objectKey = ObjectKey ""}

Copy link
Contributor

@jwan2021 jwan2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jwan2021
Copy link
Contributor

jwan2021 commented Sep 12, 2019

Or using dirname? looks similar to dirname command in shell :)

@newhoggy
Copy link
Collaborator Author

I wanted dirname actually, but existing function has this name: https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:takeDirectory

@newhoggy
Copy link
Collaborator Author

I decided to use dirname instead.

@newhoggy newhoggy merged commit 28a081c into master Sep 13, 2019
@newhoggy newhoggy deleted the takeDirectory-function branch September 13, 2019 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants