packages feed

to-string-class 0.1 → 0.1.1

raw patch · 2 files changed

+10/−1 lines, 2 files

Files

Data/String/ToString.hs view
@@ -14,11 +14,15 @@     ( ToString     , toString     , fromToString+    , prop_fromToString     )     where  import Data.String (IsString, fromString) +-- | Class of string-like types that can be converted to 'String's.+--+-- Ensure that instances of this class obey the 'prop_fromToString' law. class ToString s where     -- | Convert a string-like type to a 'String'.     toString :: s -> String@@ -30,6 +34,11 @@     toString = (:[])  -- | General coercion between string-like types.+--+-- Note that: @fromToString = 'fromString' . 'toString'@ fromToString :: (IsString s2, ToString s1) => s1 -> s2 fromToString = fromString . toString +-- | @prop_fromToString x = 'fromToString' x == x@+prop_fromToString :: (IsString s, ToString s, Eq s) => s -> Bool+prop_fromToString x = fromToString x == x
to-string-class.cabal view
@@ -1,5 +1,5 @@ Name:                   to-string-class-Version:                0.1+Version:                0.1.1 Synopsis:               Converting string-like types to Strings. Description:            This library provides the class:                         .