Skip to content

Commit a66207c

Browse files
rnjtranjanharendra-kumar
authored andcommitted
Add dirname module
1 parent edf66d2 commit a66207c

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/Streamly/Coreutils/Dirname.hs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- |
2+
-- Module : Streamly.Coreutils.Dirname
3+
-- Copyright : (c) 2022 Composewell Technologies
4+
-- License : BSD-3-Clause
5+
-- Maintainer : streamly@composewell.com
6+
-- Stability : experimental
7+
-- Portability : GHC
8+
--
9+
-- Strip the last component from file name.
10+
11+
module Streamly.Coreutils.Dirname
12+
(dirname)
13+
where
14+
15+
import System.FilePath (takeDirectory)
16+
17+
dirname :: FilePath -> FilePath
18+
dirname = takeDirectory

streamly-coreutils.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@ library
104104
, time >= 1.9 && < 1.14
105105
, unix >= 2.7.0 && < 2.8
106106
, directory >= 1.2.2 && < 1.4
107+
, filepath >= 1.4 && < 1.5
107108
hs-source-dirs: src
108109
exposed-modules:
109110
Streamly.Coreutils
110111
, Streamly.Coreutils.Common
111112
, Streamly.Coreutils.Cp
112113
, Streamly.Coreutils.Directory
114+
, Streamly.Coreutils.Dirname
113115
, Streamly.Coreutils.Mv
114116
, Streamly.Coreutils.Stat
115117
, Streamly.Coreutils.Mkdir

0 commit comments

Comments
 (0)