mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-17 08:11:45 +03:00
Move hand specialised foldlC into Core.Core
This commit is contained in:
parent
881a5e7fbc
commit
1afece45c5
@ -566,6 +566,11 @@ Catchable Core Error where
|
||||
Right val => pure (Right val))
|
||||
throw = coreFail
|
||||
|
||||
-- Prelude.Monad.foldlM hand specialised for Core
|
||||
export
|
||||
foldlC : Foldable t => (a -> b -> Core a) -> a -> t b -> Core a
|
||||
foldlC fm a0 = foldl (\ma,b => ma >>= flip fm b) (pure a0)
|
||||
|
||||
-- Traversable (specialised)
|
||||
traverse' : (a -> Core b) -> List a -> List b -> Core (List b)
|
||||
traverse' f [] acc = pure (reverse acc)
|
||||
|
@ -415,10 +415,6 @@ bitraverseC f g (This a) = [| This (f a) |]
|
||||
bitraverseC f g (That b) = [| That (g b) |]
|
||||
bitraverseC f g (Both a b) = [| Both (f a) (g b) |]
|
||||
|
||||
-- Prelude.Monad.foldlM hand specialised for Core
|
||||
foldlC : Foldable t => (a -> b -> Core a) -> a -> t b -> Core a
|
||||
foldlC fm a0 = foldl (\ma,b => ma >>= flip fm b) (pure a0)
|
||||
|
||||
-- Data.StringTrie.foldWithKeysM hand specialised for Core
|
||||
foldWithKeysC : Monoid b => (List String -> Core b) -> (List String -> a -> Core b) -> StringTrie a -> Core b
|
||||
foldWithKeysC {a} {b} fk fv = go []
|
||||
|
Loading…
Reference in New Issue
Block a user