úÎ4G3U     portable provisionalgcross@phys.washington.edu  The function , takes a heading and a body and produce an G ErrorMessage object from them; this can be considered to be a thin  wrapper around Data.Map.singleton. LSince one usually wants to return not just an ErrorMessage, but a value of  the form Left error_message, the function  is provided M as a convenience; it creates the error message, and then wraps it inside  of  .  The function  is similar to the function ,  but for the body it takes a  instead of a . It is provided  for convenience.  The function  is  composed with  the   constructor for convenience. CUse this function when you want to create an error message from a  multi-line string. %Although one could alternatively use , if one were to do L this then one would only see only the first line of be indented when the 7 error message is formatted for output. For example,  @ errorMessageText "A poem:" "Roses are red.\nViolets are blue." 2produces the following (formatted) error message:   A poem:  Roses are red.  Violets are blue. DThe reason for this is because the line breaks are not known to the  N combinators, and so the indentation is not handled properly. The function  # takes care of this for you. For  example,  S errorMessageTextFromMultilineString "A poem:" "Roses are red.\nViolets are blue." 2produces the following (formatted) error message:  A poem:  Roses are red.  Violets are blue.  The function  is   composed with the   constructor  for convenience. This function takes an  and formats it into a . It , does this by converting the headings into  objects, merging them I with their respective bodies (the latter having been indented by four . spaces), and then concatenating the result. %This is the utility function used by   to format a  F given a heading and a body; it indents the body by four spaces and % then appends it after the heading. EThis function takes a list of values which might contain errors and L returns either a list of the errors found in the values or the full list L of results. Note that there is no restriction on the type of the errors. This function is similar to  , but instead of J returning a list of errors it combines them into a single error. Note L that only restriction on the type of the error is that it be an instance  of &, so this operation is not limited to  s but could  also be used for, say,  s, as in the following example:  7 dictionary_mapping_words_to_lengths :: [(String,Int)] ' dictionary_mapping_words_to_lengths =  [("foo",3)  ,("bar",3)  ]  @ getWordLengthsOrError :: [String] -> Either ErrorMessage [Int]  getWordLengthsOrError =  mapLeft  (errorMessage G "Error looking up the following words in the dictionary:"  )  .  gatherResultsOrError  . & map lookupAndReturnResultOrError The function call  3 getWordLengthsOrError ["foo","apple","cat","bar"] (results in the following error message: 9 Error looking up the following words in the dictionary:  apple  cat         error-message-1.0.1Data.ErrorMessage ErrorMessageunwrapErrorMessage errorMessageleftErrorMessageerrorMessageTextleftErrorMessageText#errorMessageTextFromMultilineString'leftErrorMessageTextFromMultilineStringformatErrorMessageformatMessageWithHeadinggatherResultsOrErrorsgatherResultsOrErrorbase Data.EitherLeftGHC.BaseStringansi-wl-pprint-0.5.1Text.PrettyPrint.ANSI.LeijenDoctext Data.MonoidMonoid