mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-11 06:05:12 +03:00
Merge pull request #3203 from unisonweb/one-less-abt2
PR feedback from #3113
This commit is contained in:
commit
97c6ae6d4b
@ -76,7 +76,7 @@ instance (forall a. Show a => Show (f a), Show v) => Show (Term f v a) where
|
||||
Abs v body -> showParen True $ (show v ++) . showString ". " . showsPrec p body
|
||||
Tm f -> showsPrec p f
|
||||
|
||||
amap :: (Functor f, Foldable f) => (a -> a') -> Term f v a -> Term f v a'
|
||||
amap :: Functor f => (a -> a') -> Term f v a -> Term f v a'
|
||||
amap = fmap
|
||||
|
||||
vmap :: (Functor f, Foldable f, Ord v') => (v -> v') -> Term f v a -> Term f v' a
|
||||
|
@ -200,13 +200,6 @@ amap' f t@(Term _ a out) = case out of
|
||||
Cycle r -> cycle' (f t a) (amap' f r)
|
||||
Abs v body -> abs' (f t a) v (amap' f body)
|
||||
|
||||
-- amap :: (Functor f, Foldable f) => (a -> a') -> Term f v a -> Term f v a'
|
||||
-- amap f (Term fv a out) = Term fv (f a) $ case out of
|
||||
-- Var v -> Var v
|
||||
-- Tm fa -> Tm (amap f <$> fa)
|
||||
-- Cycle r -> Cycle (amap f r)
|
||||
-- Abs v body -> Abs v (amap f body)
|
||||
|
||||
extraMap :: Functor g => (forall k. f k -> g k) -> Term f v a -> Term g v a
|
||||
extraMap p (Term fvs a sub) = Term fvs a (go p sub)
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user