|
definition: |
splitModuleFileName :: ModuleIdent -> FilePath -> (FilePath, FilePath)
splitModuleFileName mid fn = case splitModuleIdentifiers mid of
[_] -> splitFileName fn
ms -> let (base, ext) = splitExtension fn
dirs = splitDirectories base
(pre , suf) = splitAt (length dirs - length ms) dirs
path = if null pre
then ""
else addTrailingPathSeparator (joinPath pre)
in (path, joinPath suf <.> ext)
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
---------------------------------------------------------------------------
Split the `FilePath` of a module into the directory prefix and the
`FilePath` corresponding to the module name.
For instance, the call `splitModuleFileName "Data.Set" "lib/Data/Set.curry"`
evaluates to `("lib", "Data/Set.curry")`.
This can be useful to compute output directories while retaining the
hierarchical module structure.
|
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_) |-> {(,)}}
|
|
name: |
splitModuleFileName |
|
precedence: |
no precedence defined |
|
result-values: |
{(,)}
|
|
signature: |
String -> String -> (String, String) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |