Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Collection of functions for dealing with typesafe wrappers around
strings (i.e. "newtype Name = Name String
" etc) and string-like
structures alike.
- class ToString w where
- liftT :: (ToString a, IsString a) => (String -> String) -> a -> a
- shapeshift :: (ToString a, IsString b) => a -> b
- emptyToNothing :: ToString a => a -> Maybe a
- nothingToEmpty :: IsString a => Maybe a -> a
Documentation
class ToString w where Source #
Typeclass for a string-like structures that may expose the contained value.
Typical usage is something along the lines of
newtype LastName = LastName String deriving (IsString, ToString)
shapeshift :: (ToString a, IsString b) => a -> b Source #
Converts from one string-like structure to another one.