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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleyesod-1.6.2.3Haskell2010

Yesod.Default.Util

Various utilities used in the scaffolded site.

  • 2 types
  • 8 values
  • Packageyesod-1.6.2.3
  • Exports10
  • LanguageHaskell2010
  • LicenceMIT
  • SourceUtil.hs
valueaddStaticContentExternal
  1. :: (ByteString -> Either a ByteString)

    javascript minifier

  2. -> (ByteString -> String)

    hash function to determine file name

  3. -> FilePath

    location of static directory. files will be placed within a "tmp" subfolder

  4. -> ([Text] -> Route master)

    route constructor, taking a list of pieces

  5. -> Text

    filename extension

  6. -> Text

    mime type

  7. -> ByteString

    file contents

  8. -> HandlerFor master (Maybe (Either Text (Route master, [(Text, Text)])))
#

An implementation of addStaticContent which stores the contents in an external file. Files are created in the given static folder with names based on a hash of their content. This allows expiration dates to be set far in the future without worry of users receiving stale content.