conversion 1.1.0.1 → 1.1.1
raw patch · 2 files changed
+22/−2 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Conversion: convert1 :: Conversion (a x) (b x) => a x -> b x
+ Conversion: convert2 :: Conversion (a x1 x2) (b x1 x2) => a x1 x2 -> b x1 x2
Files
- conversion.cabal +1/−1
- library/Conversion.hs +21/−1
conversion.cabal view
@@ -1,7 +1,7 @@ name: conversion version:- 1.1.0.1+ 1.1.1 synopsis: Universal converter between values of different types category:
library/Conversion.hs view
@@ -1,4 +1,10 @@-module Conversion (Conversion(..)) where+module Conversion+(+ Conversion(..), + convert1, + convert2,+) +where import BasePrelude @@ -543,3 +549,17 @@ checkedFromIntegral :: (Alternative f, Integral a, Integral b) => a -> f b checkedFromIntegral = \a -> fromIntegral a & \b -> if fromIntegral b == a then pure b else empty++-- |+-- A utility, which helps the compiler resolve the type in case of conversion of types of kind @* -> *@.+{-# INLINE convert1 #-}+convert1 :: Conversion (a x) (b x) => a x -> b x+convert1 = + convert++-- |+-- A utility, which helps the compiler resolve the type in case of conversion of types of kind @* -> * -> *@.+{-# INLINE convert2 #-}+convert2 :: Conversion (a x1 x2) (b x1 x2) => a x1 x2 -> b x1 x2+convert2 = + convert