Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

App.Path

Contents

Description

This module tries to avoid confusing relative, absolute, and canonical paths at the type level. This is different from the hackage paths package, because I have Relative to AppDir, and I distinguish Canonical.

I used to have a separate Absolute path, but the conversions get awkward.

Synopsis

Documentation

newtype AppDir Source #

Constructors

AppDir FilePath 

Instances

Instances details
Eq AppDir # 
Instance details

Defined in App.Path

Methods

(==) :: AppDir -> AppDir -> Bool #

(/=) :: AppDir -> AppDir -> Bool #

Show AppDir # 
Instance details

Defined in App.Path

get_app_dir :: IO AppDir Source #

All paths should be relative to this one. I may later change this to an env var, a flag, or just leave it hardcoded.

data Relative Source #

Paths which are intended to be relative to the app dir get this type, so it's harder to accidentally use them directly.

Instances

Instances details
Eq Relative # 
Instance details

Defined in App.Path

Show Relative # 
Instance details

Defined in App.Path

String.IsString Relative # 
Instance details

Defined in App.Path

Canonical

data Canonical Source #

This is a path that is absolute and has had all the symlinks squeezed out. The only reason I have this is that I want to strip the global save dir prefix to get a shorter save file name. Save filenames come from the user and likely involve symlinks.

Instances

Instances details
Eq Canonical # 
Instance details

Defined in App.Path

Show Canonical # 
Instance details

Defined in App.Path