raft-0.3.7.0: Miscellaneous Haskell utilities for data structures and data manipulation.

Safe HaskellSafe
LanguageHaskell2010

Data.String.Util

Contents

Description

Utilities related to String.

Synopsis

Classes

class (Read a, Show a) => Stringy a where Source #

Class for stringlike values that can be read and shown.

Minimal complete definition

toString, fromString

Methods

toString :: a -> String Source #

Convert to a string.

fromString :: String -> a Source #

Instances

((~) * (Predicate a) flag, Printable flag a, Read a, Show a) => Stringy a Source # 

Functions

readExcept :: (ToString s, IsString e, MonadError e m, Read a) => s -> m a Source #

Read a string or return a message that it cannot be parsed.

maybeString :: (Eq a, IsString a) => a -> Maybe a Source #

Lift a non-empty string.