HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulehspec-core-2.11.18Haskell2010

Test.Hspec.Core.Util

Contents
  1. String functions
  2. Working with paths
  3. Working with exceptions
Synopsis

String functions

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

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.

Working with exceptions

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.