Skip to content
Snippets Groups Projects
  • sheaf's avatar
    6dd579fc
    Setup Hooks: make Location a separate data type · 6dd579fc
    sheaf authored
    This commit makes Location a separate data type:
    
      data Location where
        Location
          :: SymbolicPath Pkg (Dir baseDir)
          -> RelativePath baseDir File
          -> Location
    
    instead of being a type synonym for (FilePath, FilePath).
    
    We noted during testing of the Hooks API that it was all too easy to
    give an incorrect location for rule outputs, e.g. by omitting an
    extension or using an absolute path.
    This change allows us to improve the API documentation, as well as
    clarifying the types to avoid any ambiguities about what kind of file
    path is expected (FilePath vs SymbolicPath).
    6dd579fc
    History
    Setup Hooks: make Location a separate data type
    sheaf authored
    This commit makes Location a separate data type:
    
      data Location where
        Location
          :: SymbolicPath Pkg (Dir baseDir)
          -> RelativePath baseDir File
          -> Location
    
    instead of being a type synonym for (FilePath, FilePath).
    
    We noted during testing of the Hooks API that it was all too easy to
    give an incorrect location for rule outputs, e.g. by omitting an
    extension or using an absolute path.
    This change allows us to improve the API documentation, as well as
    clarifying the types to avoid any ambiguities about what kind of file
    path is expected (FilePath vs SymbolicPath).
Code owners
Assign users and groups as approvers for specific file changes. Learn more.