Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
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