Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

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
Show AppDir Source # 
Instance details

Defined in App.Path

Eq AppDir Source # 
Instance details

Defined in App.Path

Methods

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

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

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
String.IsString Relative Source # 
Instance details

Defined in App.Path

Show Relative Source # 
Instance details

Defined in App.Path

Eq Relative Source # 
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
Show Canonical Source # 
Instance details

Defined in App.Path

Eq Canonical Source # 
Instance details

Defined in App.Path