servant-static-th-0.1.0.0: Embed a directory of static files in your application and serve them from your Servant server

CopyrightDennis Gosnell 2017
LicenseBSD3
MaintainerDennis Gosnell (cdep.illabout@gmail.com)
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe
LanguageHaskell2010

Servant.Static.TH.Internal.Util

Description

Utilities functions for use in this package.

Synopsis

Documentation

removeLeadingPeriod :: String -> String Source #

Remove a leading period from a String.

>>> removeLeadingPeriod ".jpg"
"jpg"

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

>>> removeLeadingPeriod "hello"
"hello"

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

>>> removeLeadingPeriod "."
""

Remove at most one period:

>>> removeLeadingPeriod "..bye"
".bye"

getExtension :: FilePath -> FilePath Source #

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

>>> getExtension "/some/file.html"
"html"

Empty string is returned for files with no extension:

>>> getExtension "file"
""