mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Rephrase in terms of Applicative primitives.
This commit is contained in:
parent
ee80e76c1d
commit
64b491345e
@ -24,7 +24,7 @@ type Algorithm term diff = Ap (AlgorithmF term diff)
|
||||
iterAp :: Functor g => (g a -> a) -> Ap g a -> a
|
||||
iterAp algebra = go
|
||||
where go (Pure a) = a
|
||||
go (Ap wrapped apply) = algebra (go . (<$> apply) . (&) <$> wrapped)
|
||||
go (Ap wrapped apply) = algebra (go . (apply <*>) . pure <$> wrapped)
|
||||
|
||||
|
||||
-- DSL
|
||||
|
Loading…
Reference in New Issue
Block a user