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

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.