Piso 0.1 → 0.2
raw patch · 3 files changed
+11/−7 lines, 3 filesdep ~basedep ~template-haskell
Dependency ranges changed: base, template-haskell
Files
- Data/Piso.hs +5/−2
- Data/Piso/TH.hs +2/−2
- Piso.cabal +4/−3
Data/Piso.hs view
@@ -17,7 +17,9 @@ import Control.Category (Category(..)) --- | Bidirectional isomorphism that is partial in the backward direction.+-- | Bidirectional isomorphism that is total when applied in the forward+-- direction (@a -> b@), but partial when applied in the backward direction+-- (@b -> Maybe a@). -- -- This can be used to express constructor-deconstructor pairs. For example: --@@ -42,7 +44,8 @@ -- -- Module @Data.Piso.Common@ contains @Piso@s for some common datatypes. ----- Modules @Data.Piso.Generic@ and @Data.Piso.TH@ offer generic ways of deriving @Piso@s for custom datatypes.+-- Modules @Data.Piso.Generic@ and @Data.Piso.TH@ offer generic ways of+-- deriving @Piso@s for custom datatypes. data Piso a b = Piso (a -> b) (b -> Maybe a)
Data/Piso/TH.hs view
@@ -25,9 +25,9 @@ info <- reify name routers <- case info of- TyConI (DataD _ _ _ cons _) ->+ TyConI (DataD _ _ _ _ cons _) -> mapM (derivePiso (length cons /= 1)) cons- TyConI (NewtypeD _ _ _ con _) ->+ TyConI (NewtypeD _ _ _ _ con _) -> (:[]) <$> derivePiso False con _ -> fail $ show name ++ " is not a datatype."
Piso.cabal view
@@ -1,5 +1,5 @@ Name: Piso-Version: 0.1+Version: 0.2 Synopsis: Partial isomorphisms Description: Partial isomorphisms @@ -7,12 +7,13 @@ Author: Martijn van Steenbergen Maintainer: martijn@van.steenbergen.nl Stability: Experimental-Copyright: Some Rights Reserved (CC) 2013 Martijn van Steenbergen+Copyright: Some Rights Reserved (CC) 2013-2017 Martijn van Steenbergen Homepage: https://github.com/MedeaMelana/Piso Bug-reports: https://github.com/MedeaMelana/Piso/issues Cabal-Version: >= 1.6+Tested-With: GHC == 8.0.2 License: BSD3 License-file: LICENSE Category: Data@@ -25,7 +26,7 @@ Data.Piso.TH, Data.Piso.Generic Build-Depends: base >= 3.0 && < 5,- template-haskell+ template-haskell >= 2.11 && < 2.12 Source-Repository head Type: git