File: Internal.hs

package info (click to toggle)
stylish-haskell 0.14.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 916 kB
  • sloc: haskell: 7,954; makefile: 67; sh: 15
file content (15 lines) | stat: -rw-r--r-- 574 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--------------------------------------------------------------------------------
module Language.Haskell.Stylish.Config.Internal
    ( ancestors
    ) where


--------------------------------------------------------------------------------
import           Data.List       (inits)
import           System.FilePath (joinPath, splitPath)


--------------------------------------------------------------------------------
-- All ancestors of a dir (including that dir)
ancestors :: FilePath -> [FilePath]
ancestors = map joinPath . reverse . dropWhile null . inits . splitPath