Fin 0.2.2.0 → 0.2.3.0
raw patch · 2 files changed
+6/−7 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Fin: toFinMay :: (Natural n, Integral a) => a -> Maybe (Fin (Succ n))
+ Data.Fin: toFinMay :: (Natural n, Integral a) => a -> Maybe (Fin n)
Files
- Data/Fin/Private.hs +5/−6
- Fin.cabal +1/−1
Data/Fin/Private.hs view
@@ -93,12 +93,11 @@ toFin :: ∀ n a . (Natural n, Integral a) => a -> Fin (P.Succ n) toFin = fromJust . toFinMay . (`mod` getConst (iterate @n (+1) 1)) -toFinMay :: (Natural n, Integral a) => a -> Maybe (Fin (P.Succ n))-toFinMay = getCompose . getCompose . getCompose $- natural (Compose . Compose . Compose $ \ case 0 -> Just Zero- _ -> Nothing)- (Compose . Compose . Compose $ \ case 0 -> Just Zero- n -> Succ <$> toFinMay (n-1))+toFinMay :: (Natural n, Integral a) => a -> Maybe (Fin n)+toFinMay = getCompose . getCompose $+ natural (Compose . Compose $ pure Nothing)+ (Compose . Compose $ \ case 0 -> Just Zero+ n -> Succ <$> toFinMay (n-1)) infixr 5 :. data List n a where
Fin.cabal view
@@ -1,5 +1,5 @@ name: Fin-version: 0.2.2.0+version: 0.2.3.0 synopsis: Finite totally-ordered sets -- description: license: BSD3