Fin 0.2.8.0 → 0.2.9.0
raw patch · 2 files changed
+12/−4 lines, 2 filesdep ~universe-basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: universe-base
API changes (from Hackage documentation)
+ Data.Fin.List: findIndex :: Alternative p => (a -> Bool) -> List n a -> p (Fin n)
Files
- Data/Fin/List.hs +11/−3
- Fin.cabal +1/−1
Data/Fin/List.hs view
@@ -1,6 +1,14 @@ module Data.Fin.List (Peano, List (..),- fromList, uncons, head, tail, init, last, reverse, rotate, at, swap, (!!)) where+ fromList, uncons, head, tail, init, last, reverse, rotate, at, swap, (!!), findIndex) where import Prelude ()-import Data.Fin.Private-import Data.Peano+import Data.Bool (Bool, bool)+import Control.Applicative+import Control.Category (id)+import Data.Fin.Private as Fin+import Data.Peano (Peano)++findIndex :: Alternative p => (a -> Bool) -> List n a -> p (Fin n)+findIndex p = \ case+ Nil -> empty+ a:.as -> bool id (pure Zero <|>) (p a) (Succ <$> findIndex p as)
Fin.cabal view
@@ -1,5 +1,5 @@ name: Fin-version: 0.2.8.0+version: 0.2.9.0 synopsis: Finite totally-ordered sets -- description: license: BSD3