~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to src/full/Agda/TypeChecking/Monad/Sharing.hs

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{-# LANGUAGE CPP #-}
 
2
 
2
3
module Agda.TypeChecking.Monad.Sharing where
3
4
 
4
5
import Control.Monad.Reader
10
11
import Agda.TypeChecking.Monad.Base
11
12
import Agda.TypeChecking.Monad.Options
12
13
import Agda.Utils.Monad
 
14
 
 
15
#include "../../undefined.h"
13
16
import Agda.Utils.Impossible
14
17
 
15
 
#include "../../undefined.h"
16
 
 
17
18
updateSharedTerm :: MonadTCM tcm => (Term -> tcm Term) -> Term -> tcm Term
18
19
updateSharedTerm f v =
19
20
  ifM (liftTCM $ asks envAllowDestructiveUpdate)
52
53
 
53
54
disableDestructiveUpdate :: TCM a -> TCM a
54
55
disableDestructiveUpdate = local $ \e -> e { envAllowDestructiveUpdate = False }
55