enum-text 0.5.1.0 → 0.5.2.0
raw patch · 3 files changed
+11/−5 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- ChangeLog.md +4/−0
- enum-text.cabal +4/−4
- src/Text/Enum/Text.hs +3/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+# 0.5.2.0++ * icorporate MonadFail+ # 0.5.1.0 * add @UsingEnumText@ wrapper type and instances for
enum-text.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.1.+-- This file has been generated from package.yaml by hpack version 0.31.2. -- -- see: https://github.com/sol/hpack ----- hash: aa4522c3c0e28379109cad28a0f168141981649e20d845d6327e43f08f4c8024+-- hash: fc466a91bf6e816562e629c30f60ef63336e95b83a88815f1cb6336d76619511 name: enum-text-version: 0.5.1.0+version: 0.5.2.0 synopsis: A text rendering and parsing toolkit for enumerated types description: A text rendering and parsing toolkit for enumerated types. Please see the README on GitHub at <https://github.com/cdornan/enum-text#readme> category: Text@@ -37,7 +37,7 @@ ghc-options: -Wall build-depends: array- , base >=4.8.2 && <10+ , base >=4.9 && <10 , bytestring , fmt , hashable
src/Text/Enum/Text.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-} module Text.Enum.Text ( EnumText(..)@@ -12,6 +13,7 @@ , defaultEnumTextConfig ) where +import Control.Monad.Fail import Data.Array import qualified Data.ByteString.Char8 as B import Data.Coerce@@ -91,7 +93,7 @@ toFieldEnumText e = enumByteStringArray ! I e -- | A cassava field parser using the 'renderEnumText' format.- fromFieldEnumText_ :: Monad m => B.ByteString -> m e+ fromFieldEnumText_ :: MonadFail m => B.ByteString -> m e fromFieldEnumText_ bs = maybe (fail msg) return $ HM.lookup bs hashmap_b where msg = "fromFieldEnumText_: enumeration not recognised: "++show bs