packages feed

convertible-text-0.3.0: convertible-text.cabal

Name: convertible-text
Version: 0.3.0
License: LGPL
Maintainer: Michael Snoyman <michael@snoyman.com>
Author: John Goerzen, Michael Snoyman
Copyright: Copyright (c) 2009-2009 John Goerzen
license-file: COPYRIGHT
extra-source-files: COPYING, utils/genCinstances.hs
homepage: http://github.com/snoyberg/convertible/tree/text
Category: Data, Failure
synopsis: Typeclasses and instances for converting between types
Description:
 This is a port of John Goerzen's convertible package, intended to distinguish between conversions which are guaranteed to succeed and those which might fail.  It uses the attempt package, which in turn uses the failure package, so that this package is fully compatible with the failure framework.
 .
 This package currently contains all of the typeclasses and instances for convertible.  However, as these features are ported to the convertible package, this package will be left with only the instances for converting to and from text types (String, ByteString (lazy and strict) and Text (lazy and strict).
 .
 Be aware that conversions to and from bytestrings assume UTF-8 encoding. If a different encoding is desired, you can use a newtype wrapper and declare an instance of @ConvertAttempt@ or @ConvertSuccess@ on it.
 .
 The main module to import is "Data.Convertible.Text".
Stability: Stable
Build-Type: Simple

Cabal-Version: >=1.2

flag buildtests
  description: Build the executable to run unit tests
  default: False

flag nolib
  description: Skip building the library.
  default: False

flag time_gte_113
  description: time > 1.1.3 has defined some more instances so omit them here

library
  if flag(nolib)
      Buildable: False
  else
      Buildable: True
  Build-Depends: base >= 4 && < 5,
                 old-time >= 1.0.0.2 && < 1.1,
                 containers >= 0.2.0.1 && < 0.4,
                 text >= 0.5 && < 0.8,
                 bytestring >= 0.9.1.4 && < 0.10,
                 attempt >= 0.3.0 && < 0.4,
                 template-haskell
  if flag(time_gte_113)
    Build-Depends: time>=1.1.3 && <= 1.1.4
    CPP-OPTIONS: -DTIME_GTE_113
  else
    Build-Depends: time<1.1.3

  GHC-Options: -Wall -fno-warn-orphans

  Exposed-Modules: Data.Convertible.Text,
                   Data.Convertible.Base,
                   Data.Convertible.Utils,
                   Data.Convertible.Instances,
                   Data.Convertible.Instances.C,
                   Data.Convertible.Instances.Map,
                   Data.Convertible.Instances.Num,
                   Data.Convertible.Instances.Time,
                   Data.Convertible.Instances.Text,
                   Data.Convertible.Instances.String

executable           runtests
    if flag(buildtests)
        Buildable: True
        cpp-options:     -DTEST
        build-depends:   test-framework,
                         test-framework-quickcheck2,
                         test-framework-hunit,
                         HUnit,
                         QuickCheck >= 2 && < 3
    else
        Buildable: False
    ghc-options:     -Wall
    main-is:         runtests.hs