HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehspec-core-2.11.14Haskell2010

Test.Hspec.Core.Util

  • 1 type
  • 10 values

String functions

4 declarations
valuepluralize :: Int -> String -> String
#

pluralize count singular pluralizes the given singular word unless given count is 1.

Examples:

Example1 expression
pluralize 0 "example""0 examples"
Example1 expression
pluralize 1 "example""1 example"
Example1 expression
pluralize 2 "example""2 examples"

Working with paths

4 declarations
typetype Path = ([String], String)
#

A Path describes the location of a spec item within a spec tree.

It consists of a list of group descriptions and a requirement description.

valuejoinPath :: Path -> String
#

Join a Path with slashes. The result will have a leading and a trailing slash.

Working with exceptions

3 declarations
valuesafeTry :: IO a -> IO (Either SomeException a)
#

safeTry evaluates given action and returns its result. If an exception occurs, the exception is returned instead. Unlike try it is agnostic to asynchronous exceptions.