Skip to content

Commit

Permalink
add a monomorphic hoistScope for Bound.Scope.Simple
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmett committed Apr 5, 2014
1 parent 91212c5 commit f21bde2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Bound/Scope/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module Bound.Scope.Simple
, mapMScope
, serializeScope
, deserializeScope
, hoistScope
) where

import Bound.Class
Expand Down Expand Up @@ -232,6 +233,10 @@ instantiate1 :: Monad f => f a -> Scope n f a -> f a
instantiate1 e = instantiate (const e)
{-# INLINE instantiate1 #-}

hoistScope :: Monad f => (f (Var b a) -> g (Var b a)) -> Scope b f a -> Scope b g a
hoistScope f = Scope . f . unscope
{-# INLINE hoistScope #-}

-------------------------------------------------------------------------------
-- Compatibility with Bound.Scope
-------------------------------------------------------------------------------
Expand Down

0 comments on commit f21bde2

Please sign in to comment.