HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleservant-static-th-1.0.0.0Haskell2010

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"""