HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleservant-static-th-1.0.0.1Haskell2010

Servant.Static.TH.Internal.Util

Utilities functions for use in this package.

  • 2 values

Remove a leading period from a String.

Example1 expression
removeLeadingPeriod ".jpg""jpg"

Just return the String if it doesn't start with a period:

Example1 expression
removeLeadingPeriod "hello""hello"

Return an empty string if the only character in the string is a period:

Example1 expression
removeLeadingPeriod "."""

Remove at most one period:

Example1 expression
removeLeadingPeriod "..bye"".bye"

Return an extension for a FilePath. Just like takeExtension, but doesn't return the leading period.

Example1 expression
getExtension "/some/file.html""html"

Empty string is returned for files with no extension:

Example1 expression
getExtension "file"""