{-# LANGUAGE DeriveDataTypeable #-}

{-| The concrete syntax is a raw representation of the program text
    without any desugaring at all.  This is what the parser produces.
    The idea is that if we figure out how to keep the concrete syntax
    around, it can be printed exactly as the user wrote it.
-}
module Agda.Syntax.Concrete
  ( -- * Expressions
    Expr(..)
  , OpApp(..), fromOrdinary
  , module Agda.Syntax.Concrete.Name
  , appView, AppView(..)
  , isSingleIdentifierP, removeSingletonRawAppP
  , isPattern, isAbsurdP, isBinderP
    -- * Bindings
  , Binder'(..)
  , Binder
  , mkBinder_
  , mkBinder
  , LamBinding
  , LamBinding'(..)
  , TypedBinding
  , TypedBinding'(..)
  , RecordAssignment
  , RecordAssignments
  , FieldAssignment, FieldAssignment'(..), nameFieldA, exprFieldA
  , ModuleAssignment(..)
  , BoundName(..), mkBoundName_, mkBoundName
  , TacticAttribute
  , Telescope -- (..)
  , countTelVars
  , lamBindingsToTelescope
  , makePi
    -- * Declarations
  , Declaration(..)
  , ModuleApplication(..)
  , TypeSignature
  , TypeSignatureOrInstanceBlock
  , ImportDirective, Using, ImportedName
  , Renaming
  , AsName'(..), AsName
  , OpenShortHand(..), RewriteEqn, WithExpr
  , LHS(..), Pattern(..), LHSCore(..)
  , observeHiding
  , LamClause(..)
  , RHS, RHS'(..), WhereClause, WhereClause'(..), ExprWhere(..)
  , DoStmt(..)
  , Pragma(..)
  , Module
  , ThingWithFixity(..)
  , HoleContent, HoleContent'(..)
  , topLevelModuleName
  , spanAllowedBeforeModule
  )
  where

import Prelude hiding (null)

import Control.DeepSeq
import Data.Foldable (Foldable)
import Data.Traversable (Traversable, forM, mapM)
import Data.List hiding (null)
import Data.Set (Set)

import Data.Data (Data)

import Agda.Syntax.Position
import Agda.Syntax.Common
import Agda.Syntax.Fixity
import Agda.Syntax.Notation
import Agda.Syntax.Literal

import Agda.Syntax.Concrete.Name
import qualified Agda.Syntax.Abstract.Name as A

import Agda.TypeChecking.Positivity.Occurrence

import Agda.Utils.Either ( maybeLeft )
import Agda.Utils.Lens
import Agda.Utils.Null

import Agda.Utils.Impossible

data OpApp e
  = SyntaxBindingLambda Range [LamBinding] e
    -- ^ An abstraction inside a special syntax declaration
    --   (see Issue 358 why we introduce this).
  | Ordinary e
  deriving (Typeable (OpApp e)
DataType
Constr
Typeable (OpApp e)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OpApp e -> c (OpApp e))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (OpApp e))
-> (OpApp e -> Constr)
-> (OpApp e -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (OpApp e)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OpApp e)))
-> ((forall b. Data b => b -> b) -> OpApp e -> OpApp e)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OpApp e -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OpApp e -> r)
-> (forall u. (forall d. Data d => d -> u) -> OpApp e -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> OpApp e -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e))
-> Data (OpApp e)
OpApp e -> DataType
OpApp e -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (OpApp e))
(forall b. Data b => b -> b) -> OpApp e -> OpApp e
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpApp e -> c (OpApp e)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (OpApp e)
forall e. Data e => Typeable (OpApp e)
forall e. Data e => OpApp e -> DataType
forall e. Data e => OpApp e -> Constr
forall e.
Data e =>
(forall b. Data b => b -> b) -> OpApp e -> OpApp e
forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> OpApp e -> u
forall e u.
Data e =>
(forall d. Data d => d -> u) -> OpApp e -> [u]
forall e r r'.
Data e =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
forall e r r'.
Data e =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (OpApp e)
forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpApp e -> c (OpApp e)
forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (OpApp e))
forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OpApp e))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> OpApp e -> u
forall u. (forall d. Data d => d -> u) -> OpApp e -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (OpApp e)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpApp e -> c (OpApp e)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (OpApp e))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OpApp e))
$cOrdinary :: Constr
$cSyntaxBindingLambda :: Constr
$tOpApp :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
$cgmapMo :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
gmapMp :: (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
$cgmapMp :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
gmapM :: (forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
$cgmapM :: forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d) -> OpApp e -> m (OpApp e)
gmapQi :: Int -> (forall d. Data d => d -> u) -> OpApp e -> u
$cgmapQi :: forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> OpApp e -> u
gmapQ :: (forall d. Data d => d -> u) -> OpApp e -> [u]
$cgmapQ :: forall e u.
Data e =>
(forall d. Data d => d -> u) -> OpApp e -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
$cgmapQr :: forall e r r'.
Data e =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
$cgmapQl :: forall e r r'.
Data e =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpApp e -> r
gmapT :: (forall b. Data b => b -> b) -> OpApp e -> OpApp e
$cgmapT :: forall e.
Data e =>
(forall b. Data b => b -> b) -> OpApp e -> OpApp e
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OpApp e))
$cdataCast2 :: forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OpApp e))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (OpApp e))
$cdataCast1 :: forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (OpApp e))
dataTypeOf :: OpApp e -> DataType
$cdataTypeOf :: forall e. Data e => OpApp e -> DataType
toConstr :: OpApp e -> Constr
$ctoConstr :: forall e. Data e => OpApp e -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (OpApp e)
$cgunfold :: forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (OpApp e)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpApp e -> c (OpApp e)
$cgfoldl :: forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpApp e -> c (OpApp e)
$cp1Data :: forall e. Data e => Typeable (OpApp e)
Data, a -> OpApp b -> OpApp a
(a -> b) -> OpApp a -> OpApp b
(forall a b. (a -> b) -> OpApp a -> OpApp b)
-> (forall a b. a -> OpApp b -> OpApp a) -> Functor OpApp
forall a b. a -> OpApp b -> OpApp a
forall a b. (a -> b) -> OpApp a -> OpApp b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> OpApp b -> OpApp a
$c<$ :: forall a b. a -> OpApp b -> OpApp a
fmap :: (a -> b) -> OpApp a -> OpApp b
$cfmap :: forall a b. (a -> b) -> OpApp a -> OpApp b
Functor, OpApp a -> Bool
(a -> m) -> OpApp a -> m
(a -> b -> b) -> b -> OpApp a -> b
(forall m. Monoid m => OpApp m -> m)
-> (forall m a. Monoid m => (a -> m) -> OpApp a -> m)
-> (forall m a. Monoid m => (a -> m) -> OpApp a -> m)
-> (forall a b. (a -> b -> b) -> b -> OpApp a -> b)
-> (forall a b. (a -> b -> b) -> b -> OpApp a -> b)
-> (forall b a. (b -> a -> b) -> b -> OpApp a -> b)
-> (forall b a. (b -> a -> b) -> b -> OpApp a -> b)
-> (forall a. (a -> a -> a) -> OpApp a -> a)
-> (forall a. (a -> a -> a) -> OpApp a -> a)
-> (forall a. OpApp a -> [a])
-> (forall a. OpApp a -> Bool)
-> (forall a. OpApp a -> Int)
-> (forall a. Eq a => a -> OpApp a -> Bool)
-> (forall a. Ord a => OpApp a -> a)
-> (forall a. Ord a => OpApp a -> a)
-> (forall a. Num a => OpApp a -> a)
-> (forall a. Num a => OpApp a -> a)
-> Foldable OpApp
forall a. Eq a => a -> OpApp a -> Bool
forall a. Num a => OpApp a -> a
forall a. Ord a => OpApp a -> a
forall m. Monoid m => OpApp m -> m
forall a. OpApp a -> Bool
forall a. OpApp a -> Int
forall a. OpApp a -> [a]
forall a. (a -> a -> a) -> OpApp a -> a
forall m a. Monoid m => (a -> m) -> OpApp a -> m
forall b a. (b -> a -> b) -> b -> OpApp a -> b
forall a b. (a -> b -> b) -> b -> OpApp a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: OpApp a -> a
$cproduct :: forall a. Num a => OpApp a -> a
sum :: OpApp a -> a
$csum :: forall a. Num a => OpApp a -> a
minimum :: OpApp a -> a
$cminimum :: forall a. Ord a => OpApp a -> a
maximum :: OpApp a -> a
$cmaximum :: forall a. Ord a => OpApp a -> a
elem :: a -> OpApp a -> Bool
$celem :: forall a. Eq a => a -> OpApp a -> Bool
length :: OpApp a -> Int
$clength :: forall a. OpApp a -> Int
null :: OpApp a -> Bool
$cnull :: forall a. OpApp a -> Bool
toList :: OpApp a -> [a]
$ctoList :: forall a. OpApp a -> [a]
foldl1 :: (a -> a -> a) -> OpApp a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> OpApp a -> a
foldr1 :: (a -> a -> a) -> OpApp a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> OpApp a -> a
foldl' :: (b -> a -> b) -> b -> OpApp a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> OpApp a -> b
foldl :: (b -> a -> b) -> b -> OpApp a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> OpApp a -> b
foldr' :: (a -> b -> b) -> b -> OpApp a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> OpApp a -> b
foldr :: (a -> b -> b) -> b -> OpApp a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> OpApp a -> b
foldMap' :: (a -> m) -> OpApp a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> OpApp a -> m
foldMap :: (a -> m) -> OpApp a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> OpApp a -> m
fold :: OpApp m -> m
$cfold :: forall m. Monoid m => OpApp m -> m
Foldable, Functor OpApp
Foldable OpApp
Functor OpApp
-> Foldable OpApp
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> OpApp a -> f (OpApp b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    OpApp (f a) -> f (OpApp a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> OpApp a -> m (OpApp b))
-> (forall (m :: * -> *) a. Monad m => OpApp (m a) -> m (OpApp a))
-> Traversable OpApp
(a -> f b) -> OpApp a -> f (OpApp b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => OpApp (m a) -> m (OpApp a)
forall (f :: * -> *) a. Applicative f => OpApp (f a) -> f (OpApp a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> OpApp a -> m (OpApp b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> OpApp a -> f (OpApp b)
sequence :: OpApp (m a) -> m (OpApp a)
$csequence :: forall (m :: * -> *) a. Monad m => OpApp (m a) -> m (OpApp a)
mapM :: (a -> m b) -> OpApp a -> m (OpApp b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> OpApp a -> m (OpApp b)
sequenceA :: OpApp (f a) -> f (OpApp a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => OpApp (f a) -> f (OpApp a)
traverse :: (a -> f b) -> OpApp a -> f (OpApp b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> OpApp a -> f (OpApp b)
$cp2Traversable :: Foldable OpApp
$cp1Traversable :: Functor OpApp
Traversable, OpApp e -> OpApp e -> Bool
(OpApp e -> OpApp e -> Bool)
-> (OpApp e -> OpApp e -> Bool) -> Eq (OpApp e)
forall e. Eq e => OpApp e -> OpApp e -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpApp e -> OpApp e -> Bool
$c/= :: forall e. Eq e => OpApp e -> OpApp e -> Bool
== :: OpApp e -> OpApp e -> Bool
$c== :: forall e. Eq e => OpApp e -> OpApp e -> Bool
Eq)

fromOrdinary :: e -> OpApp e -> e
fromOrdinary :: e -> OpApp e -> e
fromOrdinary e
d (Ordinary e
e) = e
e
fromOrdinary e
d OpApp e
_            = e
d

data FieldAssignment' a = FieldAssignment { FieldAssignment' a -> Name
_nameFieldA :: Name, FieldAssignment' a -> a
_exprFieldA :: a }
  deriving (Typeable (FieldAssignment' a)
DataType
Constr
Typeable (FieldAssignment' a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> FieldAssignment' a
    -> c (FieldAssignment' a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a))
-> (FieldAssignment' a -> Constr)
-> (FieldAssignment' a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (FieldAssignment' a)))
-> ((forall b. Data b => b -> b)
    -> FieldAssignment' a -> FieldAssignment' a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> FieldAssignment' a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FieldAssignment' a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> FieldAssignment' a -> m (FieldAssignment' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FieldAssignment' a -> m (FieldAssignment' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FieldAssignment' a -> m (FieldAssignment' a))
-> Data (FieldAssignment' a)
FieldAssignment' a -> DataType
FieldAssignment' a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a))
(forall b. Data b => b -> b)
-> FieldAssignment' a -> FieldAssignment' a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> FieldAssignment' a
-> c (FieldAssignment' a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a)
forall a. Data a => Typeable (FieldAssignment' a)
forall a. Data a => FieldAssignment' a -> DataType
forall a. Data a => FieldAssignment' a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b)
-> FieldAssignment' a -> FieldAssignment' a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FieldAssignment' a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> FieldAssignment' a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> FieldAssignment' a
-> c (FieldAssignment' a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FieldAssignment' a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> FieldAssignment' a -> u
forall u. (forall d. Data d => d -> u) -> FieldAssignment' a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> FieldAssignment' a
-> c (FieldAssignment' a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FieldAssignment' a))
$cFieldAssignment :: Constr
$tFieldAssignment' :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
gmapMp :: (forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
gmapM :: (forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> FieldAssignment' a -> m (FieldAssignment' a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldAssignment' a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FieldAssignment' a -> u
gmapQ :: (forall d. Data d => d -> u) -> FieldAssignment' a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> FieldAssignment' a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FieldAssignment' a -> r
gmapT :: (forall b. Data b => b -> b)
-> FieldAssignment' a -> FieldAssignment' a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b)
-> FieldAssignment' a -> FieldAssignment' a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FieldAssignment' a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FieldAssignment' a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FieldAssignment' a))
dataTypeOf :: FieldAssignment' a -> DataType
$cdataTypeOf :: forall a. Data a => FieldAssignment' a -> DataType
toConstr :: FieldAssignment' a -> Constr
$ctoConstr :: forall a. Data a => FieldAssignment' a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FieldAssignment' a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> FieldAssignment' a
-> c (FieldAssignment' a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> FieldAssignment' a
-> c (FieldAssignment' a)
$cp1Data :: forall a. Data a => Typeable (FieldAssignment' a)
Data, a -> FieldAssignment' b -> FieldAssignment' a
(a -> b) -> FieldAssignment' a -> FieldAssignment' b
(forall a b. (a -> b) -> FieldAssignment' a -> FieldAssignment' b)
-> (forall a b. a -> FieldAssignment' b -> FieldAssignment' a)
-> Functor FieldAssignment'
forall a b. a -> FieldAssignment' b -> FieldAssignment' a
forall a b. (a -> b) -> FieldAssignment' a -> FieldAssignment' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> FieldAssignment' b -> FieldAssignment' a
$c<$ :: forall a b. a -> FieldAssignment' b -> FieldAssignment' a
fmap :: (a -> b) -> FieldAssignment' a -> FieldAssignment' b
$cfmap :: forall a b. (a -> b) -> FieldAssignment' a -> FieldAssignment' b
Functor, FieldAssignment' a -> Bool
(a -> m) -> FieldAssignment' a -> m
(a -> b -> b) -> b -> FieldAssignment' a -> b
(forall m. Monoid m => FieldAssignment' m -> m)
-> (forall m a. Monoid m => (a -> m) -> FieldAssignment' a -> m)
-> (forall m a. Monoid m => (a -> m) -> FieldAssignment' a -> m)
-> (forall a b. (a -> b -> b) -> b -> FieldAssignment' a -> b)
-> (forall a b. (a -> b -> b) -> b -> FieldAssignment' a -> b)
-> (forall b a. (b -> a -> b) -> b -> FieldAssignment' a -> b)
-> (forall b a. (b -> a -> b) -> b -> FieldAssignment' a -> b)
-> (forall a. (a -> a -> a) -> FieldAssignment' a -> a)
-> (forall a. (a -> a -> a) -> FieldAssignment' a -> a)
-> (forall a. FieldAssignment' a -> [a])
-> (forall a. FieldAssignment' a -> Bool)
-> (forall a. FieldAssignment' a -> Int)
-> (forall a. Eq a => a -> FieldAssignment' a -> Bool)
-> (forall a. Ord a => FieldAssignment' a -> a)
-> (forall a. Ord a => FieldAssignment' a -> a)
-> (forall a. Num a => FieldAssignment' a -> a)
-> (forall a. Num a => FieldAssignment' a -> a)
-> Foldable FieldAssignment'
forall a. Eq a => a -> FieldAssignment' a -> Bool
forall a. Num a => FieldAssignment' a -> a
forall a. Ord a => FieldAssignment' a -> a
forall m. Monoid m => FieldAssignment' m -> m
forall a. FieldAssignment' a -> Bool
forall a. FieldAssignment' a -> Int
forall a. FieldAssignment' a -> [a]
forall a. (a -> a -> a) -> FieldAssignment' a -> a
forall m a. Monoid m => (a -> m) -> FieldAssignment' a -> m
forall b a. (b -> a -> b) -> b -> FieldAssignment' a -> b
forall a b. (a -> b -> b) -> b -> FieldAssignment' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: FieldAssignment' a -> a
$cproduct :: forall a. Num a => FieldAssignment' a -> a
sum :: FieldAssignment' a -> a
$csum :: forall a. Num a => FieldAssignment' a -> a
minimum :: FieldAssignment' a -> a
$cminimum :: forall a. Ord a => FieldAssignment' a -> a
maximum :: FieldAssignment' a -> a
$cmaximum :: forall a. Ord a => FieldAssignment' a -> a
elem :: a -> FieldAssignment' a -> Bool
$celem :: forall a. Eq a => a -> FieldAssignment' a -> Bool
length :: FieldAssignment' a -> Int
$clength :: forall a. FieldAssignment' a -> Int
null :: FieldAssignment' a -> Bool
$cnull :: forall a. FieldAssignment' a -> Bool
toList :: FieldAssignment' a -> [a]
$ctoList :: forall a. FieldAssignment' a -> [a]
foldl1 :: (a -> a -> a) -> FieldAssignment' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> FieldAssignment' a -> a
foldr1 :: (a -> a -> a) -> FieldAssignment' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> FieldAssignment' a -> a
foldl' :: (b -> a -> b) -> b -> FieldAssignment' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> FieldAssignment' a -> b
foldl :: (b -> a -> b) -> b -> FieldAssignment' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> FieldAssignment' a -> b
foldr' :: (a -> b -> b) -> b -> FieldAssignment' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> FieldAssignment' a -> b
foldr :: (a -> b -> b) -> b -> FieldAssignment' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> FieldAssignment' a -> b
foldMap' :: (a -> m) -> FieldAssignment' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> FieldAssignment' a -> m
foldMap :: (a -> m) -> FieldAssignment' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> FieldAssignment' a -> m
fold :: FieldAssignment' m -> m
$cfold :: forall m. Monoid m => FieldAssignment' m -> m
Foldable, Functor FieldAssignment'
Foldable FieldAssignment'
Functor FieldAssignment'
-> Foldable FieldAssignment'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> FieldAssignment' a -> f (FieldAssignment' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    FieldAssignment' (f a) -> f (FieldAssignment' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> FieldAssignment' a -> m (FieldAssignment' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    FieldAssignment' (m a) -> m (FieldAssignment' a))
-> Traversable FieldAssignment'
(a -> f b) -> FieldAssignment' a -> f (FieldAssignment' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
FieldAssignment' (m a) -> m (FieldAssignment' a)
forall (f :: * -> *) a.
Applicative f =>
FieldAssignment' (f a) -> f (FieldAssignment' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> FieldAssignment' a -> m (FieldAssignment' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> FieldAssignment' a -> f (FieldAssignment' b)
sequence :: FieldAssignment' (m a) -> m (FieldAssignment' a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
FieldAssignment' (m a) -> m (FieldAssignment' a)
mapM :: (a -> m b) -> FieldAssignment' a -> m (FieldAssignment' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> FieldAssignment' a -> m (FieldAssignment' b)
sequenceA :: FieldAssignment' (f a) -> f (FieldAssignment' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
FieldAssignment' (f a) -> f (FieldAssignment' a)
traverse :: (a -> f b) -> FieldAssignment' a -> f (FieldAssignment' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> FieldAssignment' a -> f (FieldAssignment' b)
$cp2Traversable :: Foldable FieldAssignment'
$cp1Traversable :: Functor FieldAssignment'
Traversable, Int -> FieldAssignment' a -> ShowS
[FieldAssignment' a] -> ShowS
FieldAssignment' a -> String
(Int -> FieldAssignment' a -> ShowS)
-> (FieldAssignment' a -> String)
-> ([FieldAssignment' a] -> ShowS)
-> Show (FieldAssignment' a)
forall a. Show a => Int -> FieldAssignment' a -> ShowS
forall a. Show a => [FieldAssignment' a] -> ShowS
forall a. Show a => FieldAssignment' a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldAssignment' a] -> ShowS
$cshowList :: forall a. Show a => [FieldAssignment' a] -> ShowS
show :: FieldAssignment' a -> String
$cshow :: forall a. Show a => FieldAssignment' a -> String
showsPrec :: Int -> FieldAssignment' a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> FieldAssignment' a -> ShowS
Show, FieldAssignment' a -> FieldAssignment' a -> Bool
(FieldAssignment' a -> FieldAssignment' a -> Bool)
-> (FieldAssignment' a -> FieldAssignment' a -> Bool)
-> Eq (FieldAssignment' a)
forall a. Eq a => FieldAssignment' a -> FieldAssignment' a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldAssignment' a -> FieldAssignment' a -> Bool
$c/= :: forall a. Eq a => FieldAssignment' a -> FieldAssignment' a -> Bool
== :: FieldAssignment' a -> FieldAssignment' a -> Bool
$c== :: forall a. Eq a => FieldAssignment' a -> FieldAssignment' a -> Bool
Eq)

type FieldAssignment = FieldAssignment' Expr

data ModuleAssignment  = ModuleAssignment
                           { ModuleAssignment -> QName
_qnameModA     :: QName
                           , ModuleAssignment -> [Expr]
_exprModA      :: [Expr]
                           , ModuleAssignment -> ImportDirective
_importDirModA :: ImportDirective
                           }
  deriving (Typeable ModuleAssignment
DataType
Constr
Typeable ModuleAssignment
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ModuleAssignment -> c ModuleAssignment)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ModuleAssignment)
-> (ModuleAssignment -> Constr)
-> (ModuleAssignment -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ModuleAssignment))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ModuleAssignment))
-> ((forall b. Data b => b -> b)
    -> ModuleAssignment -> ModuleAssignment)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ModuleAssignment -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ModuleAssignment -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ModuleAssignment -> m ModuleAssignment)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ModuleAssignment -> m ModuleAssignment)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ModuleAssignment -> m ModuleAssignment)
-> Data ModuleAssignment
ModuleAssignment -> DataType
ModuleAssignment -> Constr
(forall b. Data b => b -> b)
-> ModuleAssignment -> ModuleAssignment
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleAssignment -> c ModuleAssignment
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleAssignment
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ModuleAssignment -> u
forall u. (forall d. Data d => d -> u) -> ModuleAssignment -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleAssignment
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleAssignment -> c ModuleAssignment
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleAssignment)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleAssignment)
$cModuleAssignment :: Constr
$tModuleAssignment :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
gmapMp :: (forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
gmapM :: (forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleAssignment -> m ModuleAssignment
gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleAssignment -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ModuleAssignment -> u
gmapQ :: (forall d. Data d => d -> u) -> ModuleAssignment -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModuleAssignment -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleAssignment -> r
gmapT :: (forall b. Data b => b -> b)
-> ModuleAssignment -> ModuleAssignment
$cgmapT :: (forall b. Data b => b -> b)
-> ModuleAssignment -> ModuleAssignment
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleAssignment)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleAssignment)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ModuleAssignment)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleAssignment)
dataTypeOf :: ModuleAssignment -> DataType
$cdataTypeOf :: ModuleAssignment -> DataType
toConstr :: ModuleAssignment -> Constr
$ctoConstr :: ModuleAssignment -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleAssignment
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleAssignment
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleAssignment -> c ModuleAssignment
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleAssignment -> c ModuleAssignment
$cp1Data :: Typeable ModuleAssignment
Data, ModuleAssignment -> ModuleAssignment -> Bool
(ModuleAssignment -> ModuleAssignment -> Bool)
-> (ModuleAssignment -> ModuleAssignment -> Bool)
-> Eq ModuleAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModuleAssignment -> ModuleAssignment -> Bool
$c/= :: ModuleAssignment -> ModuleAssignment -> Bool
== :: ModuleAssignment -> ModuleAssignment -> Bool
$c== :: ModuleAssignment -> ModuleAssignment -> Bool
Eq)

type RecordAssignment  = Either FieldAssignment ModuleAssignment
type RecordAssignments = [RecordAssignment]

nameFieldA :: Lens' Name (FieldAssignment' a)
nameFieldA :: (Name -> f Name) -> FieldAssignment' a -> f (FieldAssignment' a)
nameFieldA Name -> f Name
f FieldAssignment' a
r = Name -> f Name
f (FieldAssignment' a -> Name
forall a. FieldAssignment' a -> Name
_nameFieldA FieldAssignment' a
r) f Name -> (Name -> FieldAssignment' a) -> f (FieldAssignment' a)
forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \Name
x -> FieldAssignment' a
r { _nameFieldA :: Name
_nameFieldA = Name
x }

exprFieldA :: Lens' a (FieldAssignment' a)
exprFieldA :: (a -> f a) -> FieldAssignment' a -> f (FieldAssignment' a)
exprFieldA a -> f a
f FieldAssignment' a
r = a -> f a
f (FieldAssignment' a -> a
forall a. FieldAssignment' a -> a
_exprFieldA FieldAssignment' a
r) f a -> (a -> FieldAssignment' a) -> f (FieldAssignment' a)
forall (m :: * -> *) a b. Functor m => m a -> (a -> b) -> m b
<&> \a
x -> FieldAssignment' a
r { _exprFieldA :: a
_exprFieldA = a
x }

-- UNUSED Liang-Ting Chen 2019-07-16
--qnameModA :: Lens' QName ModuleAssignment
--qnameModA f r = f (_qnameModA r) <&> \x -> r { _qnameModA = x }
--
--exprModA :: Lens' [Expr] ModuleAssignment
--exprModA f r = f (_exprModA r) <&> \x -> r { _exprModA = x }
--
--importDirModA :: Lens' ImportDirective ModuleAssignment
--importDirModA f r = f (_importDirModA r) <&> \x -> r { _importDirModA = x }

-- | Concrete expressions. Should represent exactly what the user wrote.
data Expr
  = Ident QName                                -- ^ ex: @x@
  | Lit Literal                                -- ^ ex: @1@ or @\"foo\"@
  | QuestionMark Range (Maybe Nat)             -- ^ ex: @?@ or @{! ... !}@
  | Underscore Range (Maybe String)            -- ^ ex: @_@ or @_A_5@
  | RawApp Range [Expr]                        -- ^ before parsing operators
  | App Range Expr (NamedArg Expr)             -- ^ ex: @e e@, @e {e}@, or @e {x = e}@
  | OpApp Range QName (Set A.Name)
          [NamedArg
             (MaybePlaceholder (OpApp Expr))]  -- ^ ex: @e + e@
                                               -- The 'QName' is
                                               -- possibly ambiguous,
                                               -- but it must
                                               -- correspond to one of
                                               -- the names in the
                                               -- set.
  | WithApp Range Expr [Expr]                  -- ^ ex: @e | e1 | .. | en@
  | HiddenArg Range (Named_ Expr)              -- ^ ex: @{e}@ or @{x=e}@
  | InstanceArg Range (Named_ Expr)            -- ^ ex: @{{e}}@ or @{{x=e}}@
  | Lam Range [LamBinding] Expr                -- ^ ex: @\\x {y} -> e@ or @\\(x:A){y:B} -> e@
  | AbsurdLam Range Hiding                     -- ^ ex: @\\ ()@
  | ExtendedLam Range [LamClause]              -- ^ ex: @\\ { p11 .. p1a -> e1 ; .. ; pn1 .. pnz -> en }@
  | Fun Range (Arg Expr) Expr                  -- ^ ex: @e -> e@ or @.e -> e@ (NYI: @{e} -> e@)
  | Pi Telescope Expr                          -- ^ ex: @(xs:e) -> e@ or @{xs:e} -> e@
  | Set Range                                  -- ^ ex: @Set@
  | Prop Range                                 -- ^ ex: @Prop@
  | SetN Range Integer                         -- ^ ex: @Set0, Set1, ..@
  | PropN Range Integer                        -- ^ ex: @Prop0, Prop1, ..@
  | Rec Range RecordAssignments                -- ^ ex: @record {x = a; y = b}@, or @record { x = a; M1; M2 }@
  | RecUpdate Range Expr [FieldAssignment]     -- ^ ex: @record e {x = a; y = b}@
  | Let Range [Declaration] (Maybe Expr)       -- ^ ex: @let Ds in e@, missing body when parsing do-notation let
  | Paren Range Expr                           -- ^ ex: @(e)@
  | IdiomBrackets Range [Expr]                 -- ^ ex: @(| e1 | e2 | .. | en |)@ or @(|)@
  | DoBlock Range [DoStmt]                     -- ^ ex: @do x <- m1; m2@
  | Absurd Range                               -- ^ ex: @()@ or @{}@, only in patterns
  | As Range Name Expr                         -- ^ ex: @x\@p@, only in patterns
  | Dot Range Expr                             -- ^ ex: @.p@, only in patterns
  | DoubleDot Range Expr                       -- ^ ex: @..A@, used for parsing @..A -> B@
  | ETel Telescope                             -- ^ only used for printing telescopes
  | Quote Range                                -- ^ ex: @quote@, should be applied to a name
  | QuoteTerm Range                            -- ^ ex: @quoteTerm@, should be applied to a term
  | Tactic Range Expr                          -- ^ ex: @\@(tactic t)@, used to declare tactic arguments
  | Unquote Range                              -- ^ ex: @unquote@, should be applied to a term of type @Term@
  | DontCare Expr                              -- ^ to print irrelevant things
  | Equal Range Expr Expr                      -- ^ ex: @a = b@, used internally in the parser
  | Ellipsis Range                             -- ^ @...@, used internally to parse patterns.
  | Generalized Expr
  deriving (Typeable Expr
DataType
Constr
Typeable Expr
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Expr -> c Expr)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Expr)
-> (Expr -> Constr)
-> (Expr -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Expr))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expr))
-> ((forall b. Data b => b -> b) -> Expr -> Expr)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r)
-> (forall u. (forall d. Data d => d -> u) -> Expr -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Expr -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Expr -> m Expr)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expr -> m Expr)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expr -> m Expr)
-> Data Expr
Expr -> DataType
Expr -> Constr
(forall b. Data b => b -> b) -> Expr -> Expr
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr -> c Expr
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expr
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Expr -> u
forall u. (forall d. Data d => d -> u) -> Expr -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Expr -> m Expr
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expr -> m Expr
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expr
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr -> c Expr
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Expr)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expr)
$cGeneralized :: Constr
$cEllipsis :: Constr
$cEqual :: Constr
$cDontCare :: Constr
$cUnquote :: Constr
$cTactic :: Constr
$cQuoteTerm :: Constr
$cQuote :: Constr
$cETel :: Constr
$cDoubleDot :: Constr
$cDot :: Constr
$cAs :: Constr
$cAbsurd :: Constr
$cDoBlock :: Constr
$cIdiomBrackets :: Constr
$cParen :: Constr
$cLet :: Constr
$cRecUpdate :: Constr
$cRec :: Constr
$cPropN :: Constr
$cSetN :: Constr
$cProp :: Constr
$cSet :: Constr
$cPi :: Constr
$cFun :: Constr
$cExtendedLam :: Constr
$cAbsurdLam :: Constr
$cLam :: Constr
$cInstanceArg :: Constr
$cHiddenArg :: Constr
$cWithApp :: Constr
$cOpApp :: Constr
$cApp :: Constr
$cRawApp :: Constr
$cUnderscore :: Constr
$cQuestionMark :: Constr
$cLit :: Constr
$cIdent :: Constr
$tExpr :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Expr -> m Expr
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expr -> m Expr
gmapMp :: (forall d. Data d => d -> m d) -> Expr -> m Expr
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expr -> m Expr
gmapM :: (forall d. Data d => d -> m d) -> Expr -> m Expr
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Expr -> m Expr
gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Expr -> u
gmapQ :: (forall d. Data d => d -> u) -> Expr -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Expr -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr -> r
gmapT :: (forall b. Data b => b -> b) -> Expr -> Expr
$cgmapT :: (forall b. Data b => b -> b) -> Expr -> Expr
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expr)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expr)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Expr)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Expr)
dataTypeOf :: Expr -> DataType
$cdataTypeOf :: Expr -> DataType
toConstr :: Expr -> Constr
$ctoConstr :: Expr -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expr
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expr
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr -> c Expr
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr -> c Expr
$cp1Data :: Typeable Expr
Data, Expr -> Expr -> Bool
(Expr -> Expr -> Bool) -> (Expr -> Expr -> Bool) -> Eq Expr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Expr -> Expr -> Bool
$c/= :: Expr -> Expr -> Bool
== :: Expr -> Expr -> Bool
$c== :: Expr -> Expr -> Bool
Eq)

-- | Concrete patterns. No literals in patterns at the moment.
data Pattern
  = IdentP QName                           -- ^ @c@ or @x@
  | QuoteP Range                           -- ^ @quote@
  | AppP Pattern (NamedArg Pattern)        -- ^ @p p'@ or @p {x = p'}@
  | RawAppP Range [Pattern]                -- ^ @p1..pn@ before parsing operators
  | OpAppP Range QName (Set A.Name)
           [NamedArg Pattern]              -- ^ eg: @p => p'@ for operator @_=>_@
                                           -- The 'QName' is possibly
                                           -- ambiguous, but it must
                                           -- correspond to one of
                                           -- the names in the set.
  | HiddenP Range (Named_ Pattern)         -- ^ @{p}@ or @{x = p}@
  | InstanceP Range (Named_ Pattern)       -- ^ @{{p}}@ or @{{x = p}}@
  | ParenP Range Pattern                   -- ^ @(p)@
  | WildP Range                            -- ^ @_@
  | AbsurdP Range                          -- ^ @()@
  | AsP Range Name Pattern                 -- ^ @x\@p@ unused
  | DotP Range Expr                        -- ^ @.e@
  | LitP Literal                           -- ^ @0@, @1@, etc.
  | RecP Range [FieldAssignment' Pattern]  -- ^ @record {x = p; y = q}@
  | EqualP Range [(Expr,Expr)]             -- ^ @i = i1@ i.e. cubical face lattice generator
  | EllipsisP Range                        -- ^ @...@, only as left-most pattern.
  | WithP Range Pattern                    -- ^ @| p@, for with-patterns.
  deriving (Typeable Pattern
DataType
Constr
Typeable Pattern
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Pattern -> c Pattern)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Pattern)
-> (Pattern -> Constr)
-> (Pattern -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Pattern))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern))
-> ((forall b. Data b => b -> b) -> Pattern -> Pattern)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Pattern -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Pattern -> r)
-> (forall u. (forall d. Data d => d -> u) -> Pattern -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Pattern -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> Data Pattern
Pattern -> DataType
Pattern -> Constr
(forall b. Data b => b -> b) -> Pattern -> Pattern
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Pattern -> u
forall u. (forall d. Data d => d -> u) -> Pattern -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pattern)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
$cWithP :: Constr
$cEllipsisP :: Constr
$cEqualP :: Constr
$cRecP :: Constr
$cLitP :: Constr
$cDotP :: Constr
$cAsP :: Constr
$cAbsurdP :: Constr
$cWildP :: Constr
$cParenP :: Constr
$cInstanceP :: Constr
$cHiddenP :: Constr
$cOpAppP :: Constr
$cRawAppP :: Constr
$cAppP :: Constr
$cQuoteP :: Constr
$cIdentP :: Constr
$tPattern :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapMp :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapM :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapQi :: Int -> (forall d. Data d => d -> u) -> Pattern -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pattern -> u
gmapQ :: (forall d. Data d => d -> u) -> Pattern -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Pattern -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
gmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern
$cgmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Pattern)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pattern)
dataTypeOf :: Pattern -> DataType
$cdataTypeOf :: Pattern -> DataType
toConstr :: Pattern -> Constr
$ctoConstr :: Pattern -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
$cp1Data :: Typeable Pattern
Data, Pattern -> Pattern -> Bool
(Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool) -> Eq Pattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pattern -> Pattern -> Bool
$c/= :: Pattern -> Pattern -> Bool
== :: Pattern -> Pattern -> Bool
$c== :: Pattern -> Pattern -> Bool
Eq)

data DoStmt
  = DoBind Range Pattern Expr [LamClause]   -- ^ @p ← e where cs@
  | DoThen Expr
  | DoLet Range [Declaration]
  deriving (Typeable DoStmt
DataType
Constr
Typeable DoStmt
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> DoStmt -> c DoStmt)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DoStmt)
-> (DoStmt -> Constr)
-> (DoStmt -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DoStmt))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DoStmt))
-> ((forall b. Data b => b -> b) -> DoStmt -> DoStmt)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DoStmt -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DoStmt -> r)
-> (forall u. (forall d. Data d => d -> u) -> DoStmt -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DoStmt -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt)
-> Data DoStmt
DoStmt -> DataType
DoStmt -> Constr
(forall b. Data b => b -> b) -> DoStmt -> DoStmt
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DoStmt -> c DoStmt
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DoStmt
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DoStmt -> u
forall u. (forall d. Data d => d -> u) -> DoStmt -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DoStmt
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DoStmt -> c DoStmt
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DoStmt)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DoStmt)
$cDoLet :: Constr
$cDoThen :: Constr
$cDoBind :: Constr
$tDoStmt :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
gmapMp :: (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
gmapM :: (forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DoStmt -> m DoStmt
gmapQi :: Int -> (forall d. Data d => d -> u) -> DoStmt -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DoStmt -> u
gmapQ :: (forall d. Data d => d -> u) -> DoStmt -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DoStmt -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DoStmt -> r
gmapT :: (forall b. Data b => b -> b) -> DoStmt -> DoStmt
$cgmapT :: (forall b. Data b => b -> b) -> DoStmt -> DoStmt
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DoStmt)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DoStmt)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c DoStmt)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DoStmt)
dataTypeOf :: DoStmt -> DataType
$cdataTypeOf :: DoStmt -> DataType
toConstr :: DoStmt -> Constr
$ctoConstr :: DoStmt -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DoStmt
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DoStmt
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DoStmt -> c DoStmt
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DoStmt -> c DoStmt
$cp1Data :: Typeable DoStmt
Data, DoStmt -> DoStmt -> Bool
(DoStmt -> DoStmt -> Bool)
-> (DoStmt -> DoStmt -> Bool) -> Eq DoStmt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DoStmt -> DoStmt -> Bool
$c/= :: DoStmt -> DoStmt -> Bool
== :: DoStmt -> DoStmt -> Bool
$c== :: DoStmt -> DoStmt -> Bool
Eq)

-- | A Binder @x\@p@, the pattern is optional
data Binder' a = Binder
  { Binder' a -> Maybe Pattern
binderPattern :: Maybe Pattern
  , Binder' a -> a
binderName    :: a
  } deriving (Typeable (Binder' a)
DataType
Constr
Typeable (Binder' a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Binder' a -> c (Binder' a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Binder' a))
-> (Binder' a -> Constr)
-> (Binder' a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Binder' a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Binder' a)))
-> ((forall b. Data b => b -> b) -> Binder' a -> Binder' a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Binder' a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Binder' a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Binder' a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Binder' a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a))
-> Data (Binder' a)
Binder' a -> DataType
Binder' a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Binder' a))
(forall b. Data b => b -> b) -> Binder' a -> Binder' a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Binder' a -> c (Binder' a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Binder' a)
forall a. Data a => Typeable (Binder' a)
forall a. Data a => Binder' a -> DataType
forall a. Data a => Binder' a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Binder' a -> Binder' a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Binder' a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Binder' a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Binder' a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Binder' a -> c (Binder' a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Binder' a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Binder' a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Binder' a -> u
forall u. (forall d. Data d => d -> u) -> Binder' a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Binder' a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Binder' a -> c (Binder' a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Binder' a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Binder' a))
$cBinder :: Constr
$tBinder' :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
gmapMp :: (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
gmapM :: (forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Binder' a -> m (Binder' a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Binder' a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Binder' a -> u
gmapQ :: (forall d. Data d => d -> u) -> Binder' a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Binder' a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Binder' a -> r
gmapT :: (forall b. Data b => b -> b) -> Binder' a -> Binder' a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Binder' a -> Binder' a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Binder' a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Binder' a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Binder' a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Binder' a))
dataTypeOf :: Binder' a -> DataType
$cdataTypeOf :: forall a. Data a => Binder' a -> DataType
toConstr :: Binder' a -> Constr
$ctoConstr :: forall a. Data a => Binder' a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Binder' a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Binder' a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Binder' a -> c (Binder' a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Binder' a -> c (Binder' a)
$cp1Data :: forall a. Data a => Typeable (Binder' a)
Data, Binder' a -> Binder' a -> Bool
(Binder' a -> Binder' a -> Bool)
-> (Binder' a -> Binder' a -> Bool) -> Eq (Binder' a)
forall a. Eq a => Binder' a -> Binder' a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Binder' a -> Binder' a -> Bool
$c/= :: forall a. Eq a => Binder' a -> Binder' a -> Bool
== :: Binder' a -> Binder' a -> Bool
$c== :: forall a. Eq a => Binder' a -> Binder' a -> Bool
Eq, a -> Binder' b -> Binder' a
(a -> b) -> Binder' a -> Binder' b
(forall a b. (a -> b) -> Binder' a -> Binder' b)
-> (forall a b. a -> Binder' b -> Binder' a) -> Functor Binder'
forall a b. a -> Binder' b -> Binder' a
forall a b. (a -> b) -> Binder' a -> Binder' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Binder' b -> Binder' a
$c<$ :: forall a b. a -> Binder' b -> Binder' a
fmap :: (a -> b) -> Binder' a -> Binder' b
$cfmap :: forall a b. (a -> b) -> Binder' a -> Binder' b
Functor, Binder' a -> Bool
(a -> m) -> Binder' a -> m
(a -> b -> b) -> b -> Binder' a -> b
(forall m. Monoid m => Binder' m -> m)
-> (forall m a. Monoid m => (a -> m) -> Binder' a -> m)
-> (forall m a. Monoid m => (a -> m) -> Binder' a -> m)
-> (forall a b. (a -> b -> b) -> b -> Binder' a -> b)
-> (forall a b. (a -> b -> b) -> b -> Binder' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Binder' a -> b)
-> (forall b a. (b -> a -> b) -> b -> Binder' a -> b)
-> (forall a. (a -> a -> a) -> Binder' a -> a)
-> (forall a. (a -> a -> a) -> Binder' a -> a)
-> (forall a. Binder' a -> [a])
-> (forall a. Binder' a -> Bool)
-> (forall a. Binder' a -> Int)
-> (forall a. Eq a => a -> Binder' a -> Bool)
-> (forall a. Ord a => Binder' a -> a)
-> (forall a. Ord a => Binder' a -> a)
-> (forall a. Num a => Binder' a -> a)
-> (forall a. Num a => Binder' a -> a)
-> Foldable Binder'
forall a. Eq a => a -> Binder' a -> Bool
forall a. Num a => Binder' a -> a
forall a. Ord a => Binder' a -> a
forall m. Monoid m => Binder' m -> m
forall a. Binder' a -> Bool
forall a. Binder' a -> Int
forall a. Binder' a -> [a]
forall a. (a -> a -> a) -> Binder' a -> a
forall m a. Monoid m => (a -> m) -> Binder' a -> m
forall b a. (b -> a -> b) -> b -> Binder' a -> b
forall a b. (a -> b -> b) -> b -> Binder' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: Binder' a -> a
$cproduct :: forall a. Num a => Binder' a -> a
sum :: Binder' a -> a
$csum :: forall a. Num a => Binder' a -> a
minimum :: Binder' a -> a
$cminimum :: forall a. Ord a => Binder' a -> a
maximum :: Binder' a -> a
$cmaximum :: forall a. Ord a => Binder' a -> a
elem :: a -> Binder' a -> Bool
$celem :: forall a. Eq a => a -> Binder' a -> Bool
length :: Binder' a -> Int
$clength :: forall a. Binder' a -> Int
null :: Binder' a -> Bool
$cnull :: forall a. Binder' a -> Bool
toList :: Binder' a -> [a]
$ctoList :: forall a. Binder' a -> [a]
foldl1 :: (a -> a -> a) -> Binder' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Binder' a -> a
foldr1 :: (a -> a -> a) -> Binder' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Binder' a -> a
foldl' :: (b -> a -> b) -> b -> Binder' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Binder' a -> b
foldl :: (b -> a -> b) -> b -> Binder' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Binder' a -> b
foldr' :: (a -> b -> b) -> b -> Binder' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Binder' a -> b
foldr :: (a -> b -> b) -> b -> Binder' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Binder' a -> b
foldMap' :: (a -> m) -> Binder' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Binder' a -> m
foldMap :: (a -> m) -> Binder' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Binder' a -> m
fold :: Binder' m -> m
$cfold :: forall m. Monoid m => Binder' m -> m
Foldable, Functor Binder'
Foldable Binder'
Functor Binder'
-> Foldable Binder'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Binder' a -> f (Binder' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Binder' (f a) -> f (Binder' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Binder' a -> m (Binder' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Binder' (m a) -> m (Binder' a))
-> Traversable Binder'
(a -> f b) -> Binder' a -> f (Binder' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Binder' (m a) -> m (Binder' a)
forall (f :: * -> *) a.
Applicative f =>
Binder' (f a) -> f (Binder' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Binder' a -> m (Binder' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Binder' a -> f (Binder' b)
sequence :: Binder' (m a) -> m (Binder' a)
$csequence :: forall (m :: * -> *) a. Monad m => Binder' (m a) -> m (Binder' a)
mapM :: (a -> m b) -> Binder' a -> m (Binder' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Binder' a -> m (Binder' b)
sequenceA :: Binder' (f a) -> f (Binder' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Binder' (f a) -> f (Binder' a)
traverse :: (a -> f b) -> Binder' a -> f (Binder' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Binder' a -> f (Binder' b)
$cp2Traversable :: Foldable Binder'
$cp1Traversable :: Functor Binder'
Traversable)

type Binder = Binder' BoundName

mkBinder_ :: Name -> Binder
mkBinder_ :: Name -> Binder
mkBinder_ = BoundName -> Binder
forall a. a -> Binder' a
mkBinder (BoundName -> Binder) -> (Name -> BoundName) -> Name -> Binder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Name -> BoundName
mkBoundName_

mkBinder :: a -> Binder' a
mkBinder :: a -> Binder' a
mkBinder = Maybe Pattern -> a -> Binder' a
forall a. Maybe Pattern -> a -> Binder' a
Binder Maybe Pattern
forall a. Maybe a
Nothing

-- | A lambda binding is either domain free or typed.

type LamBinding = LamBinding' TypedBinding
data LamBinding' a
  = DomainFree (NamedArg Binder)
    -- ^ . @x@ or @{x}@ or @.x@ or @.{x}@ or @{.x}@ or @x\@p@ or @(p)@
  | DomainFull a
    -- ^ . @(xs : e)@ or @{xs : e}@
  deriving (Typeable (LamBinding' a)
DataType
Constr
Typeable (LamBinding' a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (LamBinding' a))
-> (LamBinding' a -> Constr)
-> (LamBinding' a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (LamBinding' a)))
-> ((forall b. Data b => b -> b) -> LamBinding' a -> LamBinding' a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r)
-> (forall u. (forall d. Data d => d -> u) -> LamBinding' a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> LamBinding' a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> LamBinding' a -> m (LamBinding' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> LamBinding' a -> m (LamBinding' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> LamBinding' a -> m (LamBinding' a))
-> Data (LamBinding' a)
LamBinding' a -> DataType
LamBinding' a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a))
(forall b. Data b => b -> b) -> LamBinding' a -> LamBinding' a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LamBinding' a)
forall a. Data a => Typeable (LamBinding' a)
forall a. Data a => LamBinding' a -> DataType
forall a. Data a => LamBinding' a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> LamBinding' a -> LamBinding' a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> LamBinding' a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> LamBinding' a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LamBinding' a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (LamBinding' a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LamBinding' a -> u
forall u. (forall d. Data d => d -> u) -> LamBinding' a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LamBinding' a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (LamBinding' a))
$cDomainFull :: Constr
$cDomainFree :: Constr
$tLamBinding' :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
gmapMp :: (forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
gmapM :: (forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> LamBinding' a -> m (LamBinding' a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> LamBinding' a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> LamBinding' a -> u
gmapQ :: (forall d. Data d => d -> u) -> LamBinding' a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> LamBinding' a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamBinding' a -> r
gmapT :: (forall b. Data b => b -> b) -> LamBinding' a -> LamBinding' a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> LamBinding' a -> LamBinding' a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (LamBinding' a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (LamBinding' a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (LamBinding' a))
dataTypeOf :: LamBinding' a -> DataType
$cdataTypeOf :: forall a. Data a => LamBinding' a -> DataType
toConstr :: LamBinding' a -> Constr
$ctoConstr :: forall a. Data a => LamBinding' a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LamBinding' a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LamBinding' a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamBinding' a -> c (LamBinding' a)
$cp1Data :: forall a. Data a => Typeable (LamBinding' a)
Data, a -> LamBinding' b -> LamBinding' a
(a -> b) -> LamBinding' a -> LamBinding' b
(forall a b. (a -> b) -> LamBinding' a -> LamBinding' b)
-> (forall a b. a -> LamBinding' b -> LamBinding' a)
-> Functor LamBinding'
forall a b. a -> LamBinding' b -> LamBinding' a
forall a b. (a -> b) -> LamBinding' a -> LamBinding' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> LamBinding' b -> LamBinding' a
$c<$ :: forall a b. a -> LamBinding' b -> LamBinding' a
fmap :: (a -> b) -> LamBinding' a -> LamBinding' b
$cfmap :: forall a b. (a -> b) -> LamBinding' a -> LamBinding' b
Functor, LamBinding' a -> Bool
(a -> m) -> LamBinding' a -> m
(a -> b -> b) -> b -> LamBinding' a -> b
(forall m. Monoid m => LamBinding' m -> m)
-> (forall m a. Monoid m => (a -> m) -> LamBinding' a -> m)
-> (forall m a. Monoid m => (a -> m) -> LamBinding' a -> m)
-> (forall a b. (a -> b -> b) -> b -> LamBinding' a -> b)
-> (forall a b. (a -> b -> b) -> b -> LamBinding' a -> b)
-> (forall b a. (b -> a -> b) -> b -> LamBinding' a -> b)
-> (forall b a. (b -> a -> b) -> b -> LamBinding' a -> b)
-> (forall a. (a -> a -> a) -> LamBinding' a -> a)
-> (forall a. (a -> a -> a) -> LamBinding' a -> a)
-> (forall a. LamBinding' a -> [a])
-> (forall a. LamBinding' a -> Bool)
-> (forall a. LamBinding' a -> Int)
-> (forall a. Eq a => a -> LamBinding' a -> Bool)
-> (forall a. Ord a => LamBinding' a -> a)
-> (forall a. Ord a => LamBinding' a -> a)
-> (forall a. Num a => LamBinding' a -> a)
-> (forall a. Num a => LamBinding' a -> a)
-> Foldable LamBinding'
forall a. Eq a => a -> LamBinding' a -> Bool
forall a. Num a => LamBinding' a -> a
forall a. Ord a => LamBinding' a -> a
forall m. Monoid m => LamBinding' m -> m
forall a. LamBinding' a -> Bool
forall a. LamBinding' a -> Int
forall a. LamBinding' a -> [a]
forall a. (a -> a -> a) -> LamBinding' a -> a
forall m a. Monoid m => (a -> m) -> LamBinding' a -> m
forall b a. (b -> a -> b) -> b -> LamBinding' a -> b
forall a b. (a -> b -> b) -> b -> LamBinding' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: LamBinding' a -> a
$cproduct :: forall a. Num a => LamBinding' a -> a
sum :: LamBinding' a -> a
$csum :: forall a. Num a => LamBinding' a -> a
minimum :: LamBinding' a -> a
$cminimum :: forall a. Ord a => LamBinding' a -> a
maximum :: LamBinding' a -> a
$cmaximum :: forall a. Ord a => LamBinding' a -> a
elem :: a -> LamBinding' a -> Bool
$celem :: forall a. Eq a => a -> LamBinding' a -> Bool
length :: LamBinding' a -> Int
$clength :: forall a. LamBinding' a -> Int
null :: LamBinding' a -> Bool
$cnull :: forall a. LamBinding' a -> Bool
toList :: LamBinding' a -> [a]
$ctoList :: forall a. LamBinding' a -> [a]
foldl1 :: (a -> a -> a) -> LamBinding' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> LamBinding' a -> a
foldr1 :: (a -> a -> a) -> LamBinding' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> LamBinding' a -> a
foldl' :: (b -> a -> b) -> b -> LamBinding' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> LamBinding' a -> b
foldl :: (b -> a -> b) -> b -> LamBinding' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> LamBinding' a -> b
foldr' :: (a -> b -> b) -> b -> LamBinding' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> LamBinding' a -> b
foldr :: (a -> b -> b) -> b -> LamBinding' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> LamBinding' a -> b
foldMap' :: (a -> m) -> LamBinding' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> LamBinding' a -> m
foldMap :: (a -> m) -> LamBinding' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> LamBinding' a -> m
fold :: LamBinding' m -> m
$cfold :: forall m. Monoid m => LamBinding' m -> m
Foldable, Functor LamBinding'
Foldable LamBinding'
Functor LamBinding'
-> Foldable LamBinding'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> LamBinding' a -> f (LamBinding' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    LamBinding' (f a) -> f (LamBinding' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> LamBinding' a -> m (LamBinding' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    LamBinding' (m a) -> m (LamBinding' a))
-> Traversable LamBinding'
(a -> f b) -> LamBinding' a -> f (LamBinding' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
LamBinding' (m a) -> m (LamBinding' a)
forall (f :: * -> *) a.
Applicative f =>
LamBinding' (f a) -> f (LamBinding' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LamBinding' a -> m (LamBinding' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LamBinding' a -> f (LamBinding' b)
sequence :: LamBinding' (m a) -> m (LamBinding' a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
LamBinding' (m a) -> m (LamBinding' a)
mapM :: (a -> m b) -> LamBinding' a -> m (LamBinding' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> LamBinding' a -> m (LamBinding' b)
sequenceA :: LamBinding' (f a) -> f (LamBinding' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
LamBinding' (f a) -> f (LamBinding' a)
traverse :: (a -> f b) -> LamBinding' a -> f (LamBinding' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> LamBinding' a -> f (LamBinding' b)
$cp2Traversable :: Foldable LamBinding'
$cp1Traversable :: Functor LamBinding'
Traversable, LamBinding' a -> LamBinding' a -> Bool
(LamBinding' a -> LamBinding' a -> Bool)
-> (LamBinding' a -> LamBinding' a -> Bool) -> Eq (LamBinding' a)
forall a. Eq a => LamBinding' a -> LamBinding' a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LamBinding' a -> LamBinding' a -> Bool
$c/= :: forall a. Eq a => LamBinding' a -> LamBinding' a -> Bool
== :: LamBinding' a -> LamBinding' a -> Bool
$c== :: forall a. Eq a => LamBinding' a -> LamBinding' a -> Bool
Eq)

data BoundName = BName
  { BoundName -> Name
boundName   :: Name
  , BoundName -> Fixity'
bnameFixity :: Fixity'
  , BoundName -> TacticAttribute
bnameTactic :: TacticAttribute -- From @tactic attribute
  }
  deriving (Typeable BoundName
DataType
Constr
Typeable BoundName
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> BoundName -> c BoundName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BoundName)
-> (BoundName -> Constr)
-> (BoundName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BoundName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BoundName))
-> ((forall b. Data b => b -> b) -> BoundName -> BoundName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BoundName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BoundName -> r)
-> (forall u. (forall d. Data d => d -> u) -> BoundName -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> BoundName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> BoundName -> m BoundName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BoundName -> m BoundName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BoundName -> m BoundName)
-> Data BoundName
BoundName -> DataType
BoundName -> Constr
(forall b. Data b => b -> b) -> BoundName -> BoundName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BoundName -> c BoundName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BoundName
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> BoundName -> u
forall u. (forall d. Data d => d -> u) -> BoundName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BoundName -> m BoundName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BoundName -> m BoundName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BoundName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BoundName -> c BoundName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BoundName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BoundName)
$cBName :: Constr
$tBoundName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> BoundName -> m BoundName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BoundName -> m BoundName
gmapMp :: (forall d. Data d => d -> m d) -> BoundName -> m BoundName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BoundName -> m BoundName
gmapM :: (forall d. Data d => d -> m d) -> BoundName -> m BoundName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BoundName -> m BoundName
gmapQi :: Int -> (forall d. Data d => d -> u) -> BoundName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BoundName -> u
gmapQ :: (forall d. Data d => d -> u) -> BoundName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> BoundName -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BoundName -> r
gmapT :: (forall b. Data b => b -> b) -> BoundName -> BoundName
$cgmapT :: (forall b. Data b => b -> b) -> BoundName -> BoundName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BoundName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BoundName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c BoundName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BoundName)
dataTypeOf :: BoundName -> DataType
$cdataTypeOf :: BoundName -> DataType
toConstr :: BoundName -> Constr
$ctoConstr :: BoundName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BoundName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BoundName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BoundName -> c BoundName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BoundName -> c BoundName
$cp1Data :: Typeable BoundName
Data, BoundName -> BoundName -> Bool
(BoundName -> BoundName -> Bool)
-> (BoundName -> BoundName -> Bool) -> Eq BoundName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoundName -> BoundName -> Bool
$c/= :: BoundName -> BoundName -> Bool
== :: BoundName -> BoundName -> Bool
$c== :: BoundName -> BoundName -> Bool
Eq)

type TacticAttribute = Maybe Expr

mkBoundName_ :: Name -> BoundName
mkBoundName_ :: Name -> BoundName
mkBoundName_ Name
x = Name -> Fixity' -> BoundName
mkBoundName Name
x Fixity'
noFixity'

mkBoundName :: Name -> Fixity' -> BoundName
mkBoundName :: Name -> Fixity' -> BoundName
mkBoundName Name
x Fixity'
f = Name -> Fixity' -> TacticAttribute -> BoundName
BName Name
x Fixity'
f TacticAttribute
forall a. Maybe a
Nothing

-- | A typed binding.

type TypedBinding = TypedBinding' Expr

data TypedBinding' e
  = TBind Range [NamedArg Binder] e
    -- ^ Binding @(x1\@p1 ... xn\@pn : A)@.
  | TLet  Range [Declaration]
    -- ^ Let binding @(let Ds)@ or @(open M args)@.
  deriving (Typeable (TypedBinding' e)
DataType
Constr
Typeable (TypedBinding' e)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (TypedBinding' e))
-> (TypedBinding' e -> Constr)
-> (TypedBinding' e -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (TypedBinding' e)))
-> ((forall b. Data b => b -> b)
    -> TypedBinding' e -> TypedBinding' e)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> TypedBinding' e -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TypedBinding' e -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> TypedBinding' e -> m (TypedBinding' e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TypedBinding' e -> m (TypedBinding' e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TypedBinding' e -> m (TypedBinding' e))
-> Data (TypedBinding' e)
TypedBinding' e -> DataType
TypedBinding' e -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e))
(forall b. Data b => b -> b) -> TypedBinding' e -> TypedBinding' e
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TypedBinding' e)
forall e. Data e => Typeable (TypedBinding' e)
forall e. Data e => TypedBinding' e -> DataType
forall e. Data e => TypedBinding' e -> Constr
forall e.
Data e =>
(forall b. Data b => b -> b) -> TypedBinding' e -> TypedBinding' e
forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> TypedBinding' e -> u
forall e u.
Data e =>
(forall d. Data d => d -> u) -> TypedBinding' e -> [u]
forall e r r'.
Data e =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
forall e r r'.
Data e =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TypedBinding' e)
forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e)
forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e))
forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TypedBinding' e))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> TypedBinding' e -> u
forall u. (forall d. Data d => d -> u) -> TypedBinding' e -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TypedBinding' e)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TypedBinding' e))
$cTLet :: Constr
$cTBind :: Constr
$tTypedBinding' :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
$cgmapMo :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
gmapMp :: (forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
$cgmapMp :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
gmapM :: (forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
$cgmapM :: forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d)
-> TypedBinding' e -> m (TypedBinding' e)
gmapQi :: Int -> (forall d. Data d => d -> u) -> TypedBinding' e -> u
$cgmapQi :: forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> TypedBinding' e -> u
gmapQ :: (forall d. Data d => d -> u) -> TypedBinding' e -> [u]
$cgmapQ :: forall e u.
Data e =>
(forall d. Data d => d -> u) -> TypedBinding' e -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
$cgmapQr :: forall e r r'.
Data e =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
$cgmapQl :: forall e r r'.
Data e =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypedBinding' e -> r
gmapT :: (forall b. Data b => b -> b) -> TypedBinding' e -> TypedBinding' e
$cgmapT :: forall e.
Data e =>
(forall b. Data b => b -> b) -> TypedBinding' e -> TypedBinding' e
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TypedBinding' e))
$cdataCast2 :: forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TypedBinding' e))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e))
$cdataCast1 :: forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TypedBinding' e))
dataTypeOf :: TypedBinding' e -> DataType
$cdataTypeOf :: forall e. Data e => TypedBinding' e -> DataType
toConstr :: TypedBinding' e -> Constr
$ctoConstr :: forall e. Data e => TypedBinding' e -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TypedBinding' e)
$cgunfold :: forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TypedBinding' e)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e)
$cgfoldl :: forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypedBinding' e -> c (TypedBinding' e)
$cp1Data :: forall e. Data e => Typeable (TypedBinding' e)
Data, a -> TypedBinding' b -> TypedBinding' a
(a -> b) -> TypedBinding' a -> TypedBinding' b
(forall a b. (a -> b) -> TypedBinding' a -> TypedBinding' b)
-> (forall a b. a -> TypedBinding' b -> TypedBinding' a)
-> Functor TypedBinding'
forall a b. a -> TypedBinding' b -> TypedBinding' a
forall a b. (a -> b) -> TypedBinding' a -> TypedBinding' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> TypedBinding' b -> TypedBinding' a
$c<$ :: forall a b. a -> TypedBinding' b -> TypedBinding' a
fmap :: (a -> b) -> TypedBinding' a -> TypedBinding' b
$cfmap :: forall a b. (a -> b) -> TypedBinding' a -> TypedBinding' b
Functor, TypedBinding' a -> Bool
(a -> m) -> TypedBinding' a -> m
(a -> b -> b) -> b -> TypedBinding' a -> b
(forall m. Monoid m => TypedBinding' m -> m)
-> (forall m a. Monoid m => (a -> m) -> TypedBinding' a -> m)
-> (forall m a. Monoid m => (a -> m) -> TypedBinding' a -> m)
-> (forall a b. (a -> b -> b) -> b -> TypedBinding' a -> b)
-> (forall a b. (a -> b -> b) -> b -> TypedBinding' a -> b)
-> (forall b a. (b -> a -> b) -> b -> TypedBinding' a -> b)
-> (forall b a. (b -> a -> b) -> b -> TypedBinding' a -> b)
-> (forall a. (a -> a -> a) -> TypedBinding' a -> a)
-> (forall a. (a -> a -> a) -> TypedBinding' a -> a)
-> (forall a. TypedBinding' a -> [a])
-> (forall a. TypedBinding' a -> Bool)
-> (forall a. TypedBinding' a -> Int)
-> (forall a. Eq a => a -> TypedBinding' a -> Bool)
-> (forall a. Ord a => TypedBinding' a -> a)
-> (forall a. Ord a => TypedBinding' a -> a)
-> (forall a. Num a => TypedBinding' a -> a)
-> (forall a. Num a => TypedBinding' a -> a)
-> Foldable TypedBinding'
forall a. Eq a => a -> TypedBinding' a -> Bool
forall a. Num a => TypedBinding' a -> a
forall a. Ord a => TypedBinding' a -> a
forall m. Monoid m => TypedBinding' m -> m
forall a. TypedBinding' a -> Bool
forall a. TypedBinding' a -> Int
forall a. TypedBinding' a -> [a]
forall a. (a -> a -> a) -> TypedBinding' a -> a
forall m a. Monoid m => (a -> m) -> TypedBinding' a -> m
forall b a. (b -> a -> b) -> b -> TypedBinding' a -> b
forall a b. (a -> b -> b) -> b -> TypedBinding' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: TypedBinding' a -> a
$cproduct :: forall a. Num a => TypedBinding' a -> a
sum :: TypedBinding' a -> a
$csum :: forall a. Num a => TypedBinding' a -> a
minimum :: TypedBinding' a -> a
$cminimum :: forall a. Ord a => TypedBinding' a -> a
maximum :: TypedBinding' a -> a
$cmaximum :: forall a. Ord a => TypedBinding' a -> a
elem :: a -> TypedBinding' a -> Bool
$celem :: forall a. Eq a => a -> TypedBinding' a -> Bool
length :: TypedBinding' a -> Int
$clength :: forall a. TypedBinding' a -> Int
null :: TypedBinding' a -> Bool
$cnull :: forall a. TypedBinding' a -> Bool
toList :: TypedBinding' a -> [a]
$ctoList :: forall a. TypedBinding' a -> [a]
foldl1 :: (a -> a -> a) -> TypedBinding' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> TypedBinding' a -> a
foldr1 :: (a -> a -> a) -> TypedBinding' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> TypedBinding' a -> a
foldl' :: (b -> a -> b) -> b -> TypedBinding' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> TypedBinding' a -> b
foldl :: (b -> a -> b) -> b -> TypedBinding' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> TypedBinding' a -> b
foldr' :: (a -> b -> b) -> b -> TypedBinding' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> TypedBinding' a -> b
foldr :: (a -> b -> b) -> b -> TypedBinding' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> TypedBinding' a -> b
foldMap' :: (a -> m) -> TypedBinding' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> TypedBinding' a -> m
foldMap :: (a -> m) -> TypedBinding' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> TypedBinding' a -> m
fold :: TypedBinding' m -> m
$cfold :: forall m. Monoid m => TypedBinding' m -> m
Foldable, Functor TypedBinding'
Foldable TypedBinding'
Functor TypedBinding'
-> Foldable TypedBinding'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> TypedBinding' a -> f (TypedBinding' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TypedBinding' (f a) -> f (TypedBinding' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TypedBinding' a -> m (TypedBinding' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TypedBinding' (m a) -> m (TypedBinding' a))
-> Traversable TypedBinding'
(a -> f b) -> TypedBinding' a -> f (TypedBinding' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TypedBinding' (m a) -> m (TypedBinding' a)
forall (f :: * -> *) a.
Applicative f =>
TypedBinding' (f a) -> f (TypedBinding' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TypedBinding' a -> m (TypedBinding' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TypedBinding' a -> f (TypedBinding' b)
sequence :: TypedBinding' (m a) -> m (TypedBinding' a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
TypedBinding' (m a) -> m (TypedBinding' a)
mapM :: (a -> m b) -> TypedBinding' a -> m (TypedBinding' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TypedBinding' a -> m (TypedBinding' b)
sequenceA :: TypedBinding' (f a) -> f (TypedBinding' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
TypedBinding' (f a) -> f (TypedBinding' a)
traverse :: (a -> f b) -> TypedBinding' a -> f (TypedBinding' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TypedBinding' a -> f (TypedBinding' b)
$cp2Traversable :: Foldable TypedBinding'
$cp1Traversable :: Functor TypedBinding'
Traversable, TypedBinding' e -> TypedBinding' e -> Bool
(TypedBinding' e -> TypedBinding' e -> Bool)
-> (TypedBinding' e -> TypedBinding' e -> Bool)
-> Eq (TypedBinding' e)
forall e. Eq e => TypedBinding' e -> TypedBinding' e -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedBinding' e -> TypedBinding' e -> Bool
$c/= :: forall e. Eq e => TypedBinding' e -> TypedBinding' e -> Bool
== :: TypedBinding' e -> TypedBinding' e -> Bool
$c== :: forall e. Eq e => TypedBinding' e -> TypedBinding' e -> Bool
Eq)

-- | A telescope is a sequence of typed bindings. Bound variables are in scope
--   in later types.
type Telescope = [TypedBinding]

countTelVars :: Telescope -> Nat
countTelVars :: Telescope -> Int
countTelVars Telescope
tel =
  [Int] -> Int
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum [ case TypedBinding
b of
          TBind Range
_ [NamedArg Binder]
xs Expr
_ -> [NamedArg Binder] -> Int
forall i a. Num i => [a] -> i
genericLength [NamedArg Binder]
xs
          TLet{}       -> Int
0
      | TypedBinding
b <- Telescope
tel ]

-- | We can try to get a @Telescope@ from a @[LamBinding]@.
--   If we have a type annotation already, we're happy.
--   Otherwise we manufacture a binder with an underscore for the type.
lamBindingsToTelescope :: Range -> [LamBinding] -> Telescope
lamBindingsToTelescope :: Range -> [LamBinding] -> Telescope
lamBindingsToTelescope Range
r = (LamBinding -> TypedBinding) -> [LamBinding] -> Telescope
forall a b. (a -> b) -> [a] -> [b]
map ((LamBinding -> TypedBinding) -> [LamBinding] -> Telescope)
-> (LamBinding -> TypedBinding) -> [LamBinding] -> Telescope
forall a b. (a -> b) -> a -> b
$ \case
  DomainFull TypedBinding
ty -> TypedBinding
ty
  DomainFree NamedArg Binder
nm -> Range -> [NamedArg Binder] -> Expr -> TypedBinding
forall e. Range -> [NamedArg Binder] -> e -> TypedBinding' e
TBind Range
r [NamedArg Binder
nm] (Expr -> TypedBinding) -> Expr -> TypedBinding
forall a b. (a -> b) -> a -> b
$ Range -> Maybe String -> Expr
Underscore Range
r Maybe String
forall a. Maybe a
Nothing

-- | Smart constructor for @Pi@: check whether the @Telescope@ is empty

makePi :: Telescope -> Expr -> Expr
makePi :: Telescope -> Expr -> Expr
makePi [] Expr
e = Expr
e
makePi Telescope
bs Expr
e = Telescope -> Expr -> Expr
Pi Telescope
bs Expr
e

{-| Left hand sides can be written in infix style. For example:

    > n + suc m = suc (n + m)
    > (f ∘ g) x = f (g x)

   We use fixity information to see which name is actually defined.
-}
data LHS = LHS
  { LHS -> Pattern
lhsOriginalPattern :: Pattern               -- ^ e.g. @f ps | wps@
  , LHS -> [RewriteEqn]
lhsRewriteEqn      :: [RewriteEqn]          -- ^ @(rewrite e | with p <- e)@ (many)
  , LHS -> [WithHiding Expr]
lhsWithExpr        :: [WithHiding WithExpr] -- ^ @with e1 | {e2} | ...@ (many)
  , LHS -> ExpandedEllipsis
lhsExpandedEllipsis :: ExpandedEllipsis     -- ^ Did we expand an ellipsis?
  } -- ^ Original pattern (including with-patterns), rewrite equations and with-expressions.
  deriving (Typeable LHS
DataType
Constr
Typeable LHS
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LHS -> c LHS)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LHS)
-> (LHS -> Constr)
-> (LHS -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LHS))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHS))
-> ((forall b. Data b => b -> b) -> LHS -> LHS)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r)
-> (forall u. (forall d. Data d => d -> u) -> LHS -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> LHS -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LHS -> m LHS)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHS -> m LHS)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHS -> m LHS)
-> Data LHS
LHS -> DataType
LHS -> Constr
(forall b. Data b => b -> b) -> LHS -> LHS
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHS -> c LHS
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHS
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LHS -> u
forall u. (forall d. Data d => d -> u) -> LHS -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHS -> m LHS
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHS -> m LHS
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHS
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHS -> c LHS
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHS)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHS)
$cLHS :: Constr
$tLHS :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LHS -> m LHS
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHS -> m LHS
gmapMp :: (forall d. Data d => d -> m d) -> LHS -> m LHS
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHS -> m LHS
gmapM :: (forall d. Data d => d -> m d) -> LHS -> m LHS
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHS -> m LHS
gmapQi :: Int -> (forall d. Data d => d -> u) -> LHS -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LHS -> u
gmapQ :: (forall d. Data d => d -> u) -> LHS -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LHS -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LHS -> r
gmapT :: (forall b. Data b => b -> b) -> LHS -> LHS
$cgmapT :: (forall b. Data b => b -> b) -> LHS -> LHS
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHS)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHS)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LHS)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHS)
dataTypeOf :: LHS -> DataType
$cdataTypeOf :: LHS -> DataType
toConstr :: LHS -> Constr
$ctoConstr :: LHS -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHS
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHS
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHS -> c LHS
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHS -> c LHS
$cp1Data :: Typeable LHS
Data, LHS -> LHS -> Bool
(LHS -> LHS -> Bool) -> (LHS -> LHS -> Bool) -> Eq LHS
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LHS -> LHS -> Bool
$c/= :: LHS -> LHS -> Bool
== :: LHS -> LHS -> Bool
$c== :: LHS -> LHS -> Bool
Eq)

type RewriteEqn = RewriteEqn' () Pattern Expr

type WithExpr   = Expr

-- | Processed (operator-parsed) intermediate form of the core @f ps@ of 'LHS'.
--   Corresponds to 'lhsOriginalPattern'.
data LHSCore
  = LHSHead  { LHSCore -> QName
lhsDefName      :: QName               -- ^ @f@
             , LHSCore -> [NamedArg Pattern]
lhsPats         :: [NamedArg Pattern]  -- ^ @ps@
             }
  | LHSProj  { LHSCore -> QName
lhsDestructor   :: QName               -- ^ Record projection.
             , LHSCore -> [NamedArg Pattern]
lhsPatsLeft     :: [NamedArg Pattern]  -- ^ Patterns for record indices (currently none).
             , LHSCore -> NamedArg LHSCore
lhsFocus        :: NamedArg LHSCore    -- ^ Main argument.
             , lhsPats         :: [NamedArg Pattern]  -- ^ More application patterns.
             }
  | LHSWith  { LHSCore -> LHSCore
lhsHead         :: LHSCore
             , LHSCore -> [Pattern]
lhsWithPatterns :: [Pattern]          -- ^ Non-empty; at least one @(| p)@.
             , lhsPats         :: [NamedArg Pattern] -- ^ More application patterns.
             }
  deriving (Typeable LHSCore
DataType
Constr
Typeable LHSCore
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LHSCore -> c LHSCore)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LHSCore)
-> (LHSCore -> Constr)
-> (LHSCore -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LHSCore))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSCore))
-> ((forall b. Data b => b -> b) -> LHSCore -> LHSCore)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LHSCore -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LHSCore -> r)
-> (forall u. (forall d. Data d => d -> u) -> LHSCore -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> LHSCore -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore)
-> Data LHSCore
LHSCore -> DataType
LHSCore -> Constr
(forall b. Data b => b -> b) -> LHSCore -> LHSCore
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSCore -> c LHSCore
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSCore
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LHSCore -> u
forall u. (forall d. Data d => d -> u) -> LHSCore -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSCore
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSCore -> c LHSCore
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHSCore)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSCore)
$cLHSWith :: Constr
$cLHSProj :: Constr
$cLHSHead :: Constr
$tLHSCore :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
gmapMp :: (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
gmapM :: (forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LHSCore -> m LHSCore
gmapQi :: Int -> (forall d. Data d => d -> u) -> LHSCore -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LHSCore -> u
gmapQ :: (forall d. Data d => d -> u) -> LHSCore -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LHSCore -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LHSCore -> r
gmapT :: (forall b. Data b => b -> b) -> LHSCore -> LHSCore
$cgmapT :: (forall b. Data b => b -> b) -> LHSCore -> LHSCore
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSCore)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LHSCore)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LHSCore)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LHSCore)
dataTypeOf :: LHSCore -> DataType
$cdataTypeOf :: LHSCore -> DataType
toConstr :: LHSCore -> Constr
$ctoConstr :: LHSCore -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSCore
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LHSCore
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSCore -> c LHSCore
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LHSCore -> c LHSCore
$cp1Data :: Typeable LHSCore
Data, LHSCore -> LHSCore -> Bool
(LHSCore -> LHSCore -> Bool)
-> (LHSCore -> LHSCore -> Bool) -> Eq LHSCore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LHSCore -> LHSCore -> Bool
$c/= :: LHSCore -> LHSCore -> Bool
== :: LHSCore -> LHSCore -> Bool
$c== :: LHSCore -> LHSCore -> Bool
Eq)

type RHS = RHS' Expr
data RHS' e
  = AbsurdRHS -- ^ No right hand side because of absurd match.
  | RHS e
  deriving (Typeable (RHS' e)
DataType
Constr
Typeable (RHS' e)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> RHS' e -> c (RHS' e))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (RHS' e))
-> (RHS' e -> Constr)
-> (RHS' e -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (RHS' e)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RHS' e)))
-> ((forall b. Data b => b -> b) -> RHS' e -> RHS' e)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RHS' e -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RHS' e -> r)
-> (forall u. (forall d. Data d => d -> u) -> RHS' e -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> RHS' e -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e))
-> Data (RHS' e)
RHS' e -> DataType
RHS' e -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (RHS' e))
(forall b. Data b => b -> b) -> RHS' e -> RHS' e
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RHS' e -> c (RHS' e)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RHS' e)
forall e. Data e => Typeable (RHS' e)
forall e. Data e => RHS' e -> DataType
forall e. Data e => RHS' e -> Constr
forall e.
Data e =>
(forall b. Data b => b -> b) -> RHS' e -> RHS' e
forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> RHS' e -> u
forall e u. Data e => (forall d. Data d => d -> u) -> RHS' e -> [u]
forall e r r'.
Data e =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
forall e r r'.
Data e =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RHS' e)
forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RHS' e -> c (RHS' e)
forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RHS' e))
forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RHS' e))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> RHS' e -> u
forall u. (forall d. Data d => d -> u) -> RHS' e -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RHS' e)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RHS' e -> c (RHS' e)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RHS' e))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RHS' e))
$cRHS :: Constr
$cAbsurdRHS :: Constr
$tRHS' :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
$cgmapMo :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
gmapMp :: (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
$cgmapMp :: forall e (m :: * -> *).
(Data e, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
gmapM :: (forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
$cgmapM :: forall e (m :: * -> *).
(Data e, Monad m) =>
(forall d. Data d => d -> m d) -> RHS' e -> m (RHS' e)
gmapQi :: Int -> (forall d. Data d => d -> u) -> RHS' e -> u
$cgmapQi :: forall e u.
Data e =>
Int -> (forall d. Data d => d -> u) -> RHS' e -> u
gmapQ :: (forall d. Data d => d -> u) -> RHS' e -> [u]
$cgmapQ :: forall e u. Data e => (forall d. Data d => d -> u) -> RHS' e -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
$cgmapQr :: forall e r r'.
Data e =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
$cgmapQl :: forall e r r'.
Data e =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RHS' e -> r
gmapT :: (forall b. Data b => b -> b) -> RHS' e -> RHS' e
$cgmapT :: forall e.
Data e =>
(forall b. Data b => b -> b) -> RHS' e -> RHS' e
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RHS' e))
$cdataCast2 :: forall e (t :: * -> * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RHS' e))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (RHS' e))
$cdataCast1 :: forall e (t :: * -> *) (c :: * -> *).
(Data e, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RHS' e))
dataTypeOf :: RHS' e -> DataType
$cdataTypeOf :: forall e. Data e => RHS' e -> DataType
toConstr :: RHS' e -> Constr
$ctoConstr :: forall e. Data e => RHS' e -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RHS' e)
$cgunfold :: forall e (c :: * -> *).
Data e =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RHS' e)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RHS' e -> c (RHS' e)
$cgfoldl :: forall e (c :: * -> *).
Data e =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RHS' e -> c (RHS' e)
$cp1Data :: forall e. Data e => Typeable (RHS' e)
Data, a -> RHS' b -> RHS' a
(a -> b) -> RHS' a -> RHS' b
(forall a b. (a -> b) -> RHS' a -> RHS' b)
-> (forall a b. a -> RHS' b -> RHS' a) -> Functor RHS'
forall a b. a -> RHS' b -> RHS' a
forall a b. (a -> b) -> RHS' a -> RHS' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> RHS' b -> RHS' a
$c<$ :: forall a b. a -> RHS' b -> RHS' a
fmap :: (a -> b) -> RHS' a -> RHS' b
$cfmap :: forall a b. (a -> b) -> RHS' a -> RHS' b
Functor, RHS' a -> Bool
(a -> m) -> RHS' a -> m
(a -> b -> b) -> b -> RHS' a -> b
(forall m. Monoid m => RHS' m -> m)
-> (forall m a. Monoid m => (a -> m) -> RHS' a -> m)
-> (forall m a. Monoid m => (a -> m) -> RHS' a -> m)
-> (forall a b. (a -> b -> b) -> b -> RHS' a -> b)
-> (forall a b. (a -> b -> b) -> b -> RHS' a -> b)
-> (forall b a. (b -> a -> b) -> b -> RHS' a -> b)
-> (forall b a. (b -> a -> b) -> b -> RHS' a -> b)
-> (forall a. (a -> a -> a) -> RHS' a -> a)
-> (forall a. (a -> a -> a) -> RHS' a -> a)
-> (forall a. RHS' a -> [a])
-> (forall a. RHS' a -> Bool)
-> (forall a. RHS' a -> Int)
-> (forall a. Eq a => a -> RHS' a -> Bool)
-> (forall a. Ord a => RHS' a -> a)
-> (forall a. Ord a => RHS' a -> a)
-> (forall a. Num a => RHS' a -> a)
-> (forall a. Num a => RHS' a -> a)
-> Foldable RHS'
forall a. Eq a => a -> RHS' a -> Bool
forall a. Num a => RHS' a -> a
forall a. Ord a => RHS' a -> a
forall m. Monoid m => RHS' m -> m
forall a. RHS' a -> Bool
forall a. RHS' a -> Int
forall a. RHS' a -> [a]
forall a. (a -> a -> a) -> RHS' a -> a
forall m a. Monoid m => (a -> m) -> RHS' a -> m
forall b a. (b -> a -> b) -> b -> RHS' a -> b
forall a b. (a -> b -> b) -> b -> RHS' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: RHS' a -> a
$cproduct :: forall a. Num a => RHS' a -> a
sum :: RHS' a -> a
$csum :: forall a. Num a => RHS' a -> a
minimum :: RHS' a -> a
$cminimum :: forall a. Ord a => RHS' a -> a
maximum :: RHS' a -> a
$cmaximum :: forall a. Ord a => RHS' a -> a
elem :: a -> RHS' a -> Bool
$celem :: forall a. Eq a => a -> RHS' a -> Bool
length :: RHS' a -> Int
$clength :: forall a. RHS' a -> Int
null :: RHS' a -> Bool
$cnull :: forall a. RHS' a -> Bool
toList :: RHS' a -> [a]
$ctoList :: forall a. RHS' a -> [a]
foldl1 :: (a -> a -> a) -> RHS' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> RHS' a -> a
foldr1 :: (a -> a -> a) -> RHS' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> RHS' a -> a
foldl' :: (b -> a -> b) -> b -> RHS' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> RHS' a -> b
foldl :: (b -> a -> b) -> b -> RHS' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> RHS' a -> b
foldr' :: (a -> b -> b) -> b -> RHS' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> RHS' a -> b
foldr :: (a -> b -> b) -> b -> RHS' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> RHS' a -> b
foldMap' :: (a -> m) -> RHS' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> RHS' a -> m
foldMap :: (a -> m) -> RHS' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> RHS' a -> m
fold :: RHS' m -> m
$cfold :: forall m. Monoid m => RHS' m -> m
Foldable, Functor RHS'
Foldable RHS'
Functor RHS'
-> Foldable RHS'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> RHS' a -> f (RHS' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    RHS' (f a) -> f (RHS' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> RHS' a -> m (RHS' b))
-> (forall (m :: * -> *) a. Monad m => RHS' (m a) -> m (RHS' a))
-> Traversable RHS'
(a -> f b) -> RHS' a -> f (RHS' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => RHS' (m a) -> m (RHS' a)
forall (f :: * -> *) a. Applicative f => RHS' (f a) -> f (RHS' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RHS' a -> m (RHS' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RHS' a -> f (RHS' b)
sequence :: RHS' (m a) -> m (RHS' a)
$csequence :: forall (m :: * -> *) a. Monad m => RHS' (m a) -> m (RHS' a)
mapM :: (a -> m b) -> RHS' a -> m (RHS' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RHS' a -> m (RHS' b)
sequenceA :: RHS' (f a) -> f (RHS' a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => RHS' (f a) -> f (RHS' a)
traverse :: (a -> f b) -> RHS' a -> f (RHS' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RHS' a -> f (RHS' b)
$cp2Traversable :: Foldable RHS'
$cp1Traversable :: Functor RHS'
Traversable, RHS' e -> RHS' e -> Bool
(RHS' e -> RHS' e -> Bool)
-> (RHS' e -> RHS' e -> Bool) -> Eq (RHS' e)
forall e. Eq e => RHS' e -> RHS' e -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RHS' e -> RHS' e -> Bool
$c/= :: forall e. Eq e => RHS' e -> RHS' e -> Bool
== :: RHS' e -> RHS' e -> Bool
$c== :: forall e. Eq e => RHS' e -> RHS' e -> Bool
Eq)


type WhereClause = WhereClause' [Declaration]
data WhereClause' decls
  = NoWhere               -- ^ No @where@ clauses.
  | AnyWhere decls        -- ^ Ordinary @where@.
  | SomeWhere Name Access decls
    -- ^ Named where: @module M where@.
    --   The 'Access' flag applies to the 'Name' (not the module contents!)
    --   and is propagated from the parent function.
  deriving (Typeable (WhereClause' decls)
DataType
Constr
Typeable (WhereClause' decls)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> WhereClause' decls
    -> c (WhereClause' decls))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (WhereClause' decls))
-> (WhereClause' decls -> Constr)
-> (WhereClause' decls -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (WhereClause' decls)))
-> ((forall b. Data b => b -> b)
    -> WhereClause' decls -> WhereClause' decls)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> WhereClause' decls -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> WhereClause' decls -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> WhereClause' decls -> m (WhereClause' decls))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> WhereClause' decls -> m (WhereClause' decls))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> WhereClause' decls -> m (WhereClause' decls))
-> Data (WhereClause' decls)
WhereClause' decls -> DataType
WhereClause' decls -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls))
(forall b. Data b => b -> b)
-> WhereClause' decls -> WhereClause' decls
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> WhereClause' decls
-> c (WhereClause' decls)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (WhereClause' decls)
forall decls. Data decls => Typeable (WhereClause' decls)
forall decls. Data decls => WhereClause' decls -> DataType
forall decls. Data decls => WhereClause' decls -> Constr
forall decls.
Data decls =>
(forall b. Data b => b -> b)
-> WhereClause' decls -> WhereClause' decls
forall decls u.
Data decls =>
Int -> (forall d. Data d => d -> u) -> WhereClause' decls -> u
forall decls u.
Data decls =>
(forall d. Data d => d -> u) -> WhereClause' decls -> [u]
forall decls r r'.
Data decls =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
forall decls r r'.
Data decls =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
forall decls (m :: * -> *).
(Data decls, Monad m) =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
forall decls (m :: * -> *).
(Data decls, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
forall decls (c :: * -> *).
Data decls =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (WhereClause' decls)
forall decls (c :: * -> *).
Data decls =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> WhereClause' decls
-> c (WhereClause' decls)
forall decls (t :: * -> *) (c :: * -> *).
(Data decls, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls))
forall decls (t :: * -> * -> *) (c :: * -> *).
(Data decls, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (WhereClause' decls))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> WhereClause' decls -> u
forall u. (forall d. Data d => d -> u) -> WhereClause' decls -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (WhereClause' decls)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> WhereClause' decls
-> c (WhereClause' decls)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (WhereClause' decls))
$cSomeWhere :: Constr
$cAnyWhere :: Constr
$cNoWhere :: Constr
$tWhereClause' :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
$cgmapMo :: forall decls (m :: * -> *).
(Data decls, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
gmapMp :: (forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
$cgmapMp :: forall decls (m :: * -> *).
(Data decls, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
gmapM :: (forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
$cgmapM :: forall decls (m :: * -> *).
(Data decls, Monad m) =>
(forall d. Data d => d -> m d)
-> WhereClause' decls -> m (WhereClause' decls)
gmapQi :: Int -> (forall d. Data d => d -> u) -> WhereClause' decls -> u
$cgmapQi :: forall decls u.
Data decls =>
Int -> (forall d. Data d => d -> u) -> WhereClause' decls -> u
gmapQ :: (forall d. Data d => d -> u) -> WhereClause' decls -> [u]
$cgmapQ :: forall decls u.
Data decls =>
(forall d. Data d => d -> u) -> WhereClause' decls -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
$cgmapQr :: forall decls r r'.
Data decls =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
$cgmapQl :: forall decls r r'.
Data decls =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> WhereClause' decls -> r
gmapT :: (forall b. Data b => b -> b)
-> WhereClause' decls -> WhereClause' decls
$cgmapT :: forall decls.
Data decls =>
(forall b. Data b => b -> b)
-> WhereClause' decls -> WhereClause' decls
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (WhereClause' decls))
$cdataCast2 :: forall decls (t :: * -> * -> *) (c :: * -> *).
(Data decls, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (WhereClause' decls))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls))
$cdataCast1 :: forall decls (t :: * -> *) (c :: * -> *).
(Data decls, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (WhereClause' decls))
dataTypeOf :: WhereClause' decls -> DataType
$cdataTypeOf :: forall decls. Data decls => WhereClause' decls -> DataType
toConstr :: WhereClause' decls -> Constr
$ctoConstr :: forall decls. Data decls => WhereClause' decls -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (WhereClause' decls)
$cgunfold :: forall decls (c :: * -> *).
Data decls =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (WhereClause' decls)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> WhereClause' decls
-> c (WhereClause' decls)
$cgfoldl :: forall decls (c :: * -> *).
Data decls =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> WhereClause' decls
-> c (WhereClause' decls)
$cp1Data :: forall decls. Data decls => Typeable (WhereClause' decls)
Data, a -> WhereClause' b -> WhereClause' a
(a -> b) -> WhereClause' a -> WhereClause' b
(forall a b. (a -> b) -> WhereClause' a -> WhereClause' b)
-> (forall a b. a -> WhereClause' b -> WhereClause' a)
-> Functor WhereClause'
forall a b. a -> WhereClause' b -> WhereClause' a
forall a b. (a -> b) -> WhereClause' a -> WhereClause' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> WhereClause' b -> WhereClause' a
$c<$ :: forall a b. a -> WhereClause' b -> WhereClause' a
fmap :: (a -> b) -> WhereClause' a -> WhereClause' b
$cfmap :: forall a b. (a -> b) -> WhereClause' a -> WhereClause' b
Functor, WhereClause' a -> Bool
(a -> m) -> WhereClause' a -> m
(a -> b -> b) -> b -> WhereClause' a -> b
(forall m. Monoid m => WhereClause' m -> m)
-> (forall m a. Monoid m => (a -> m) -> WhereClause' a -> m)
-> (forall m a. Monoid m => (a -> m) -> WhereClause' a -> m)
-> (forall a b. (a -> b -> b) -> b -> WhereClause' a -> b)
-> (forall a b. (a -> b -> b) -> b -> WhereClause' a -> b)
-> (forall b a. (b -> a -> b) -> b -> WhereClause' a -> b)
-> (forall b a. (b -> a -> b) -> b -> WhereClause' a -> b)
-> (forall a. (a -> a -> a) -> WhereClause' a -> a)
-> (forall a. (a -> a -> a) -> WhereClause' a -> a)
-> (forall a. WhereClause' a -> [a])
-> (forall a. WhereClause' a -> Bool)
-> (forall a. WhereClause' a -> Int)
-> (forall a. Eq a => a -> WhereClause' a -> Bool)
-> (forall a. Ord a => WhereClause' a -> a)
-> (forall a. Ord a => WhereClause' a -> a)
-> (forall a. Num a => WhereClause' a -> a)
-> (forall a. Num a => WhereClause' a -> a)
-> Foldable WhereClause'
forall a. Eq a => a -> WhereClause' a -> Bool
forall a. Num a => WhereClause' a -> a
forall a. Ord a => WhereClause' a -> a
forall m. Monoid m => WhereClause' m -> m
forall a. WhereClause' a -> Bool
forall a. WhereClause' a -> Int
forall a. WhereClause' a -> [a]
forall a. (a -> a -> a) -> WhereClause' a -> a
forall m a. Monoid m => (a -> m) -> WhereClause' a -> m
forall b a. (b -> a -> b) -> b -> WhereClause' a -> b
forall a b. (a -> b -> b) -> b -> WhereClause' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: WhereClause' a -> a
$cproduct :: forall a. Num a => WhereClause' a -> a
sum :: WhereClause' a -> a
$csum :: forall a. Num a => WhereClause' a -> a
minimum :: WhereClause' a -> a
$cminimum :: forall a. Ord a => WhereClause' a -> a
maximum :: WhereClause' a -> a
$cmaximum :: forall a. Ord a => WhereClause' a -> a
elem :: a -> WhereClause' a -> Bool
$celem :: forall a. Eq a => a -> WhereClause' a -> Bool
length :: WhereClause' a -> Int
$clength :: forall a. WhereClause' a -> Int
null :: WhereClause' a -> Bool
$cnull :: forall a. WhereClause' a -> Bool
toList :: WhereClause' a -> [a]
$ctoList :: forall a. WhereClause' a -> [a]
foldl1 :: (a -> a -> a) -> WhereClause' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> WhereClause' a -> a
foldr1 :: (a -> a -> a) -> WhereClause' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> WhereClause' a -> a
foldl' :: (b -> a -> b) -> b -> WhereClause' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> WhereClause' a -> b
foldl :: (b -> a -> b) -> b -> WhereClause' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> WhereClause' a -> b
foldr' :: (a -> b -> b) -> b -> WhereClause' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> WhereClause' a -> b
foldr :: (a -> b -> b) -> b -> WhereClause' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> WhereClause' a -> b
foldMap' :: (a -> m) -> WhereClause' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> WhereClause' a -> m
foldMap :: (a -> m) -> WhereClause' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> WhereClause' a -> m
fold :: WhereClause' m -> m
$cfold :: forall m. Monoid m => WhereClause' m -> m
Foldable, Functor WhereClause'
Foldable WhereClause'
Functor WhereClause'
-> Foldable WhereClause'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> WhereClause' a -> f (WhereClause' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    WhereClause' (f a) -> f (WhereClause' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> WhereClause' a -> m (WhereClause' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    WhereClause' (m a) -> m (WhereClause' a))
-> Traversable WhereClause'
(a -> f b) -> WhereClause' a -> f (WhereClause' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
WhereClause' (m a) -> m (WhereClause' a)
forall (f :: * -> *) a.
Applicative f =>
WhereClause' (f a) -> f (WhereClause' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> WhereClause' a -> m (WhereClause' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> WhereClause' a -> f (WhereClause' b)
sequence :: WhereClause' (m a) -> m (WhereClause' a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
WhereClause' (m a) -> m (WhereClause' a)
mapM :: (a -> m b) -> WhereClause' a -> m (WhereClause' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> WhereClause' a -> m (WhereClause' b)
sequenceA :: WhereClause' (f a) -> f (WhereClause' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
WhereClause' (f a) -> f (WhereClause' a)
traverse :: (a -> f b) -> WhereClause' a -> f (WhereClause' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> WhereClause' a -> f (WhereClause' b)
$cp2Traversable :: Foldable WhereClause'
$cp1Traversable :: Functor WhereClause'
Traversable, WhereClause' decls -> WhereClause' decls -> Bool
(WhereClause' decls -> WhereClause' decls -> Bool)
-> (WhereClause' decls -> WhereClause' decls -> Bool)
-> Eq (WhereClause' decls)
forall decls.
Eq decls =>
WhereClause' decls -> WhereClause' decls -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WhereClause' decls -> WhereClause' decls -> Bool
$c/= :: forall decls.
Eq decls =>
WhereClause' decls -> WhereClause' decls -> Bool
== :: WhereClause' decls -> WhereClause' decls -> Bool
$c== :: forall decls.
Eq decls =>
WhereClause' decls -> WhereClause' decls -> Bool
Eq)

data LamClause = LamClause { LamClause -> LHS
lamLHS      :: LHS
                           , LamClause -> RHS
lamRHS      :: RHS
                           , LamClause -> WhereClause
lamWhere    :: WhereClause -- ^ always 'NoWhere' (see parser)
                           , LamClause -> Bool
lamCatchAll :: Bool }
  deriving (Typeable LamClause
DataType
Constr
Typeable LamClause
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LamClause -> c LamClause)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LamClause)
-> (LamClause -> Constr)
-> (LamClause -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LamClause))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LamClause))
-> ((forall b. Data b => b -> b) -> LamClause -> LamClause)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LamClause -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LamClause -> r)
-> (forall u. (forall d. Data d => d -> u) -> LamClause -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> LamClause -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LamClause -> m LamClause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LamClause -> m LamClause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LamClause -> m LamClause)
-> Data LamClause
LamClause -> DataType
LamClause -> Constr
(forall b. Data b => b -> b) -> LamClause -> LamClause
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamClause -> c LamClause
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamClause
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LamClause -> u
forall u. (forall d. Data d => d -> u) -> LamClause -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LamClause -> m LamClause
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LamClause -> m LamClause
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamClause
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamClause -> c LamClause
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LamClause)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LamClause)
$cLamClause :: Constr
$tLamClause :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> LamClause -> m LamClause
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LamClause -> m LamClause
gmapMp :: (forall d. Data d => d -> m d) -> LamClause -> m LamClause
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LamClause -> m LamClause
gmapM :: (forall d. Data d => d -> m d) -> LamClause -> m LamClause
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LamClause -> m LamClause
gmapQi :: Int -> (forall d. Data d => d -> u) -> LamClause -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LamClause -> u
gmapQ :: (forall d. Data d => d -> u) -> LamClause -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LamClause -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LamClause -> r
gmapT :: (forall b. Data b => b -> b) -> LamClause -> LamClause
$cgmapT :: (forall b. Data b => b -> b) -> LamClause -> LamClause
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LamClause)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LamClause)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LamClause)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LamClause)
dataTypeOf :: LamClause -> DataType
$cdataTypeOf :: LamClause -> DataType
toConstr :: LamClause -> Constr
$ctoConstr :: LamClause -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamClause
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LamClause
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamClause -> c LamClause
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LamClause -> c LamClause
$cp1Data :: Typeable LamClause
Data, LamClause -> LamClause -> Bool
(LamClause -> LamClause -> Bool)
-> (LamClause -> LamClause -> Bool) -> Eq LamClause
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LamClause -> LamClause -> Bool
$c/= :: LamClause -> LamClause -> Bool
== :: LamClause -> LamClause -> Bool
$c== :: LamClause -> LamClause -> Bool
Eq)

-- | An expression followed by a where clause.
--   Currently only used to give better a better error message in interaction.
data ExprWhere = ExprWhere Expr WhereClause

-- | The things you are allowed to say when you shuffle names between name
--   spaces (i.e. in @import@, @namespace@, or @open@ declarations).
type ImportDirective = ImportDirective' Name Name
type Using           = Using'           Name Name
type Renaming        = Renaming'        Name Name

-- | An imported name can be a module or a defined name.
type ImportedName = ImportedName' Name Name

-- | The content of the @as@-clause of the import statement.
data AsName' a = AsName
  { AsName' a -> a
asName  :: a
    -- ^ The \"as\" name.
  , AsName' a -> Range
asRange :: Range
    -- ^ The range of the \"as\" keyword.  Retained for highlighting purposes.
  }
  deriving (Typeable (AsName' a)
DataType
Constr
Typeable (AsName' a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> AsName' a -> c (AsName' a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (AsName' a))
-> (AsName' a -> Constr)
-> (AsName' a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (AsName' a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (AsName' a)))
-> ((forall b. Data b => b -> b) -> AsName' a -> AsName' a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AsName' a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AsName' a -> r)
-> (forall u. (forall d. Data d => d -> u) -> AsName' a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> AsName' a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a))
-> Data (AsName' a)
AsName' a -> DataType
AsName' a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (AsName' a))
(forall b. Data b => b -> b) -> AsName' a -> AsName' a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AsName' a -> c (AsName' a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AsName' a)
forall a. Data a => Typeable (AsName' a)
forall a. Data a => AsName' a -> DataType
forall a. Data a => AsName' a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> AsName' a -> AsName' a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> AsName' a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> AsName' a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AsName' a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AsName' a -> c (AsName' a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AsName' a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AsName' a))
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> AsName' a -> u
forall u. (forall d. Data d => d -> u) -> AsName' a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AsName' a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AsName' a -> c (AsName' a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AsName' a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AsName' a))
$cAsName :: Constr
$tAsName' :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
gmapMp :: (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
gmapM :: (forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> AsName' a -> m (AsName' a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> AsName' a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> AsName' a -> u
gmapQ :: (forall d. Data d => d -> u) -> AsName' a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> AsName' a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AsName' a -> r
gmapT :: (forall b. Data b => b -> b) -> AsName' a -> AsName' a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> AsName' a -> AsName' a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AsName' a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AsName' a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (AsName' a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AsName' a))
dataTypeOf :: AsName' a -> DataType
$cdataTypeOf :: forall a. Data a => AsName' a -> DataType
toConstr :: AsName' a -> Constr
$ctoConstr :: forall a. Data a => AsName' a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AsName' a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AsName' a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AsName' a -> c (AsName' a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AsName' a -> c (AsName' a)
$cp1Data :: forall a. Data a => Typeable (AsName' a)
Data, Int -> AsName' a -> ShowS
[AsName' a] -> ShowS
AsName' a -> String
(Int -> AsName' a -> ShowS)
-> (AsName' a -> String)
-> ([AsName' a] -> ShowS)
-> Show (AsName' a)
forall a. Show a => Int -> AsName' a -> ShowS
forall a. Show a => [AsName' a] -> ShowS
forall a. Show a => AsName' a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AsName' a] -> ShowS
$cshowList :: forall a. Show a => [AsName' a] -> ShowS
show :: AsName' a -> String
$cshow :: forall a. Show a => AsName' a -> String
showsPrec :: Int -> AsName' a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> AsName' a -> ShowS
Show, a -> AsName' b -> AsName' a
(a -> b) -> AsName' a -> AsName' b
(forall a b. (a -> b) -> AsName' a -> AsName' b)
-> (forall a b. a -> AsName' b -> AsName' a) -> Functor AsName'
forall a b. a -> AsName' b -> AsName' a
forall a b. (a -> b) -> AsName' a -> AsName' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> AsName' b -> AsName' a
$c<$ :: forall a b. a -> AsName' b -> AsName' a
fmap :: (a -> b) -> AsName' a -> AsName' b
$cfmap :: forall a b. (a -> b) -> AsName' a -> AsName' b
Functor, AsName' a -> Bool
(a -> m) -> AsName' a -> m
(a -> b -> b) -> b -> AsName' a -> b
(forall m. Monoid m => AsName' m -> m)
-> (forall m a. Monoid m => (a -> m) -> AsName' a -> m)
-> (forall m a. Monoid m => (a -> m) -> AsName' a -> m)
-> (forall a b. (a -> b -> b) -> b -> AsName' a -> b)
-> (forall a b. (a -> b -> b) -> b -> AsName' a -> b)
-> (forall b a. (b -> a -> b) -> b -> AsName' a -> b)
-> (forall b a. (b -> a -> b) -> b -> AsName' a -> b)
-> (forall a. (a -> a -> a) -> AsName' a -> a)
-> (forall a. (a -> a -> a) -> AsName' a -> a)
-> (forall a. AsName' a -> [a])
-> (forall a. AsName' a -> Bool)
-> (forall a. AsName' a -> Int)
-> (forall a. Eq a => a -> AsName' a -> Bool)
-> (forall a. Ord a => AsName' a -> a)
-> (forall a. Ord a => AsName' a -> a)
-> (forall a. Num a => AsName' a -> a)
-> (forall a. Num a => AsName' a -> a)
-> Foldable AsName'
forall a. Eq a => a -> AsName' a -> Bool
forall a. Num a => AsName' a -> a
forall a. Ord a => AsName' a -> a
forall m. Monoid m => AsName' m -> m
forall a. AsName' a -> Bool
forall a. AsName' a -> Int
forall a. AsName' a -> [a]
forall a. (a -> a -> a) -> AsName' a -> a
forall m a. Monoid m => (a -> m) -> AsName' a -> m
forall b a. (b -> a -> b) -> b -> AsName' a -> b
forall a b. (a -> b -> b) -> b -> AsName' a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: AsName' a -> a
$cproduct :: forall a. Num a => AsName' a -> a
sum :: AsName' a -> a
$csum :: forall a. Num a => AsName' a -> a
minimum :: AsName' a -> a
$cminimum :: forall a. Ord a => AsName' a -> a
maximum :: AsName' a -> a
$cmaximum :: forall a. Ord a => AsName' a -> a
elem :: a -> AsName' a -> Bool
$celem :: forall a. Eq a => a -> AsName' a -> Bool
length :: AsName' a -> Int
$clength :: forall a. AsName' a -> Int
null :: AsName' a -> Bool
$cnull :: forall a. AsName' a -> Bool
toList :: AsName' a -> [a]
$ctoList :: forall a. AsName' a -> [a]
foldl1 :: (a -> a -> a) -> AsName' a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> AsName' a -> a
foldr1 :: (a -> a -> a) -> AsName' a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> AsName' a -> a
foldl' :: (b -> a -> b) -> b -> AsName' a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> AsName' a -> b
foldl :: (b -> a -> b) -> b -> AsName' a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> AsName' a -> b
foldr' :: (a -> b -> b) -> b -> AsName' a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> AsName' a -> b
foldr :: (a -> b -> b) -> b -> AsName' a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> AsName' a -> b
foldMap' :: (a -> m) -> AsName' a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> AsName' a -> m
foldMap :: (a -> m) -> AsName' a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> AsName' a -> m
fold :: AsName' m -> m
$cfold :: forall m. Monoid m => AsName' m -> m
Foldable, Functor AsName'
Foldable AsName'
Functor AsName'
-> Foldable AsName'
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AsName' a -> f (AsName' b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AsName' (f a) -> f (AsName' a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AsName' a -> m (AsName' b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AsName' (m a) -> m (AsName' a))
-> Traversable AsName'
(a -> f b) -> AsName' a -> f (AsName' b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => AsName' (m a) -> m (AsName' a)
forall (f :: * -> *) a.
Applicative f =>
AsName' (f a) -> f (AsName' a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AsName' a -> m (AsName' b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AsName' a -> f (AsName' b)
sequence :: AsName' (m a) -> m (AsName' a)
$csequence :: forall (m :: * -> *) a. Monad m => AsName' (m a) -> m (AsName' a)
mapM :: (a -> m b) -> AsName' a -> m (AsName' b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AsName' a -> m (AsName' b)
sequenceA :: AsName' (f a) -> f (AsName' a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
AsName' (f a) -> f (AsName' a)
traverse :: (a -> f b) -> AsName' a -> f (AsName' b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AsName' a -> f (AsName' b)
$cp2Traversable :: Foldable AsName'
$cp1Traversable :: Functor AsName'
Traversable, AsName' a -> AsName' a -> Bool
(AsName' a -> AsName' a -> Bool)
-> (AsName' a -> AsName' a -> Bool) -> Eq (AsName' a)
forall a. Eq a => AsName' a -> AsName' a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AsName' a -> AsName' a -> Bool
$c/= :: forall a. Eq a => AsName' a -> AsName' a -> Bool
== :: AsName' a -> AsName' a -> Bool
$c== :: forall a. Eq a => AsName' a -> AsName' a -> Bool
Eq)

-- | From the parser, we get an expression for the @as@-'Name', which
--   we have to parse into a 'Name'.
type AsName = AsName' (Either Expr Name)

{--------------------------------------------------------------------------
    Declarations
 --------------------------------------------------------------------------}

-- | Just type signatures.
type TypeSignature = Declaration

-- | Just field signatures
type FieldSignature = Declaration

-- | Just type signatures or instance blocks.
type TypeSignatureOrInstanceBlock = Declaration

{-| The representation type of a declaration. The comments indicate
    which type in the intended family the constructor targets.
-}

data Declaration
  = TypeSig ArgInfo TacticAttribute Name Expr
  | FieldSig IsInstance TacticAttribute Name (Arg Expr)
  -- ^ Axioms and functions can be irrelevant. (Hiding should be NotHidden)
  | Generalize Range [TypeSignature] -- ^ Variables to be generalized, can be hidden and/or irrelevant.
  | Field Range [FieldSignature]
  | FunClause LHS RHS WhereClause Bool
  | DataSig     Range Name [LamBinding] Expr -- ^ lone data signature in mutual block
  | Data        Range Name [LamBinding] Expr [TypeSignatureOrInstanceBlock]
  | DataDef     Range Name [LamBinding] [TypeSignatureOrInstanceBlock]
  | RecordSig   Range Name [LamBinding] Expr -- ^ lone record signature in mutual block
  | RecordDef   Range Name (Maybe (Ranged Induction)) (Maybe HasEta) (Maybe (Name, IsInstance)) [LamBinding] [Declaration]
  | Record      Range Name (Maybe (Ranged Induction)) (Maybe HasEta) (Maybe (Name, IsInstance)) [LamBinding] Expr [Declaration]
    -- ^ The optional name is a name for the record constructor.
  | Infix Fixity [Name]
  | Syntax      Name Notation -- ^ notation declaration for a name
  | PatternSyn  Range Name [Arg Name] Pattern
  | Mutual      Range [Declaration]  -- @Range@ of the whole @mutual@ block.
  | Abstract    Range [Declaration]
  | Private     Range Origin [Declaration]
    -- ^ In "Agda.Syntax.Concrete.Definitions" we generate private blocks
    --   temporarily, which should be treated different that user-declared
    --   private blocks.  Thus the 'Origin'.
  | InstanceB   Range [Declaration]
    -- ^ The 'Range' here (exceptionally) only refers to the range of the
    --   @instance@ keyword.  The range of the whole block @InstanceB r ds@
    --   is @fuseRange r ds@.
  | Macro       Range [Declaration]
  | Postulate   Range [TypeSignatureOrInstanceBlock]
  | Primitive   Range [TypeSignature]
  | Open        Range QName ImportDirective
  | Import      Range QName (Maybe AsName) !OpenShortHand ImportDirective
  | ModuleMacro Range  Name ModuleApplication !OpenShortHand ImportDirective
  | Module      Range QName Telescope [Declaration]
  | UnquoteDecl Range [Name] Expr
  | UnquoteDef  Range [Name] Expr
  | Pragma      Pragma
  deriving (Typeable Declaration
DataType
Constr
Typeable Declaration
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Declaration -> c Declaration)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Declaration)
-> (Declaration -> Constr)
-> (Declaration -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Declaration))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Declaration))
-> ((forall b. Data b => b -> b) -> Declaration -> Declaration)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Declaration -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Declaration -> r)
-> (forall u. (forall d. Data d => d -> u) -> Declaration -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Declaration -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Declaration -> m Declaration)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Declaration -> m Declaration)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Declaration -> m Declaration)
-> Data Declaration
Declaration -> DataType
Declaration -> Constr
(forall b. Data b => b -> b) -> Declaration -> Declaration
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Declaration -> c Declaration
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Declaration
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Declaration -> u
forall u. (forall d. Data d => d -> u) -> Declaration -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Declaration -> m Declaration
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Declaration -> m Declaration
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Declaration
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Declaration -> c Declaration
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Declaration)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Declaration)
$cPragma :: Constr
$cUnquoteDef :: Constr
$cUnquoteDecl :: Constr
$cModule :: Constr
$cModuleMacro :: Constr
$cImport :: Constr
$cOpen :: Constr
$cPrimitive :: Constr
$cPostulate :: Constr
$cMacro :: Constr
$cInstanceB :: Constr
$cPrivate :: Constr
$cAbstract :: Constr
$cMutual :: Constr
$cPatternSyn :: Constr
$cSyntax :: Constr
$cInfix :: Constr
$cRecord :: Constr
$cRecordDef :: Constr
$cRecordSig :: Constr
$cDataDef :: Constr
$cData :: Constr
$cDataSig :: Constr
$cFunClause :: Constr
$cField :: Constr
$cGeneralize :: Constr
$cFieldSig :: Constr
$cTypeSig :: Constr
$tDeclaration :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Declaration -> m Declaration
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Declaration -> m Declaration
gmapMp :: (forall d. Data d => d -> m d) -> Declaration -> m Declaration
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Declaration -> m Declaration
gmapM :: (forall d. Data d => d -> m d) -> Declaration -> m Declaration
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Declaration -> m Declaration
gmapQi :: Int -> (forall d. Data d => d -> u) -> Declaration -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Declaration -> u
gmapQ :: (forall d. Data d => d -> u) -> Declaration -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Declaration -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Declaration -> r
gmapT :: (forall b. Data b => b -> b) -> Declaration -> Declaration
$cgmapT :: (forall b. Data b => b -> b) -> Declaration -> Declaration
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Declaration)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Declaration)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Declaration)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Declaration)
dataTypeOf :: Declaration -> DataType
$cdataTypeOf :: Declaration -> DataType
toConstr :: Declaration -> Constr
$ctoConstr :: Declaration -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Declaration
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Declaration
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Declaration -> c Declaration
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Declaration -> c Declaration
$cp1Data :: Typeable Declaration
Data, Declaration -> Declaration -> Bool
(Declaration -> Declaration -> Bool)
-> (Declaration -> Declaration -> Bool) -> Eq Declaration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Declaration -> Declaration -> Bool
$c/= :: Declaration -> Declaration -> Bool
== :: Declaration -> Declaration -> Bool
$c== :: Declaration -> Declaration -> Bool
Eq)

data ModuleApplication
  = SectionApp Range Telescope Expr
    -- ^ @tel. M args@
  | RecordModuleInstance Range QName
    -- ^ @M {{...}}@
  deriving (Typeable ModuleApplication
DataType
Constr
Typeable ModuleApplication
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> ModuleApplication
    -> c ModuleApplication)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ModuleApplication)
-> (ModuleApplication -> Constr)
-> (ModuleApplication -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ModuleApplication))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ModuleApplication))
-> ((forall b. Data b => b -> b)
    -> ModuleApplication -> ModuleApplication)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ModuleApplication -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ModuleApplication -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ModuleApplication -> m ModuleApplication)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ModuleApplication -> m ModuleApplication)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ModuleApplication -> m ModuleApplication)
-> Data ModuleApplication
ModuleApplication -> DataType
ModuleApplication -> Constr
(forall b. Data b => b -> b)
-> ModuleApplication -> ModuleApplication
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleApplication -> c ModuleApplication
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleApplication
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ModuleApplication -> u
forall u. (forall d. Data d => d -> u) -> ModuleApplication -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleApplication
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleApplication -> c ModuleApplication
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleApplication)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleApplication)
$cRecordModuleInstance :: Constr
$cSectionApp :: Constr
$tModuleApplication :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
gmapMp :: (forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
gmapM :: (forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModuleApplication -> m ModuleApplication
gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleApplication -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ModuleApplication -> u
gmapQ :: (forall d. Data d => d -> u) -> ModuleApplication -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModuleApplication -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleApplication -> r
gmapT :: (forall b. Data b => b -> b)
-> ModuleApplication -> ModuleApplication
$cgmapT :: (forall b. Data b => b -> b)
-> ModuleApplication -> ModuleApplication
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleApplication)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModuleApplication)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ModuleApplication)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleApplication)
dataTypeOf :: ModuleApplication -> DataType
$cdataTypeOf :: ModuleApplication -> DataType
toConstr :: ModuleApplication -> Constr
$ctoConstr :: ModuleApplication -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleApplication
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleApplication
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleApplication -> c ModuleApplication
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleApplication -> c ModuleApplication
$cp1Data :: Typeable ModuleApplication
Data, ModuleApplication -> ModuleApplication -> Bool
(ModuleApplication -> ModuleApplication -> Bool)
-> (ModuleApplication -> ModuleApplication -> Bool)
-> Eq ModuleApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModuleApplication -> ModuleApplication -> Bool
$c/= :: ModuleApplication -> ModuleApplication -> Bool
== :: ModuleApplication -> ModuleApplication -> Bool
$c== :: ModuleApplication -> ModuleApplication -> Bool
Eq)

data OpenShortHand = DoOpen | DontOpen
  deriving (Typeable OpenShortHand
DataType
Constr
Typeable OpenShortHand
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> OpenShortHand -> c OpenShortHand)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c OpenShortHand)
-> (OpenShortHand -> Constr)
-> (OpenShortHand -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c OpenShortHand))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c OpenShortHand))
-> ((forall b. Data b => b -> b) -> OpenShortHand -> OpenShortHand)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r)
-> (forall u. (forall d. Data d => d -> u) -> OpenShortHand -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> OpenShortHand -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand)
-> Data OpenShortHand
OpenShortHand -> DataType
OpenShortHand -> Constr
(forall b. Data b => b -> b) -> OpenShortHand -> OpenShortHand
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpenShortHand -> c OpenShortHand
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OpenShortHand
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> OpenShortHand -> u
forall u. (forall d. Data d => d -> u) -> OpenShortHand -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OpenShortHand
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpenShortHand -> c OpenShortHand
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OpenShortHand)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OpenShortHand)
$cDontOpen :: Constr
$cDoOpen :: Constr
$tOpenShortHand :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
gmapMp :: (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
gmapM :: (forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OpenShortHand -> m OpenShortHand
gmapQi :: Int -> (forall d. Data d => d -> u) -> OpenShortHand -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OpenShortHand -> u
gmapQ :: (forall d. Data d => d -> u) -> OpenShortHand -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> OpenShortHand -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OpenShortHand -> r
gmapT :: (forall b. Data b => b -> b) -> OpenShortHand -> OpenShortHand
$cgmapT :: (forall b. Data b => b -> b) -> OpenShortHand -> OpenShortHand
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OpenShortHand)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OpenShortHand)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c OpenShortHand)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OpenShortHand)
dataTypeOf :: OpenShortHand -> DataType
$cdataTypeOf :: OpenShortHand -> DataType
toConstr :: OpenShortHand -> Constr
$ctoConstr :: OpenShortHand -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OpenShortHand
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OpenShortHand
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpenShortHand -> c OpenShortHand
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OpenShortHand -> c OpenShortHand
$cp1Data :: Typeable OpenShortHand
Data, OpenShortHand -> OpenShortHand -> Bool
(OpenShortHand -> OpenShortHand -> Bool)
-> (OpenShortHand -> OpenShortHand -> Bool) -> Eq OpenShortHand
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpenShortHand -> OpenShortHand -> Bool
$c/= :: OpenShortHand -> OpenShortHand -> Bool
== :: OpenShortHand -> OpenShortHand -> Bool
$c== :: OpenShortHand -> OpenShortHand -> Bool
Eq, Int -> OpenShortHand -> ShowS
[OpenShortHand] -> ShowS
OpenShortHand -> String
(Int -> OpenShortHand -> ShowS)
-> (OpenShortHand -> String)
-> ([OpenShortHand] -> ShowS)
-> Show OpenShortHand
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpenShortHand] -> ShowS
$cshowList :: [OpenShortHand] -> ShowS
show :: OpenShortHand -> String
$cshow :: OpenShortHand -> String
showsPrec :: Int -> OpenShortHand -> ShowS
$cshowsPrec :: Int -> OpenShortHand -> ShowS
Show)

-- Pragmas ----------------------------------------------------------------

data Pragma
  = OptionsPragma             Range [String]
  | BuiltinPragma             Range RString QName
  | RewritePragma             Range Range [QName]        -- ^ Second Range is for REWRITE keyword.
  | ForeignPragma             Range RString String       -- ^ first string is backend name
  | CompilePragma             Range RString QName String -- ^ first string is backend name
  | StaticPragma              Range QName
  | InlinePragma              Range Bool QName  -- ^ INLINE or NOINLINE

  | ImpossiblePragma          Range
    -- ^ Throws an internal error in the scope checker.
  | EtaPragma                 Range QName
    -- ^ For coinductive records, use pragma instead of regular
    --   @eta-equality@ definition (as it is might make Agda loop).
  | WarningOnUsage            Range QName String
    -- ^ Applies to the named function
  | WarningOnImport           Range String
    -- ^ Applies to the current module
  | InjectivePragma           Range QName
    -- ^ Mark a definition as injective for the pattern matching unifier.
  | DisplayPragma             Range Pattern Expr
    -- ^ Display lhs as rhs (modifies the printer).

  -- Attached (more or less) pragmas handled in the nicifier (Concrete.Definitions):
  | CatchallPragma            Range
    -- ^ Applies to the following function clause.
  | TerminationCheckPragma    Range (TerminationCheck Name)
    -- ^ Applies to the following function (and all that are mutually recursive with it)
    --   or to the functions in the following mutual block.
  | NoCoverageCheckPragma     Range
    -- ^ Applies to the following function (and all that are mutually recursive with it)
    --   or to the functions in the following mutual block.
  | NoPositivityCheckPragma   Range
    -- ^ Applies to the following data/record type or mutual block.
  | PolarityPragma            Range Name [Occurrence]
  | NoUniverseCheckPragma     Range
    -- ^ Applies to the following data/record type.
  deriving (Typeable Pragma
DataType
Constr
Typeable Pragma
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Pragma -> c Pragma)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Pragma)
-> (Pragma -> Constr)
-> (Pragma -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Pragma))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma))
-> ((forall b. Data b => b -> b) -> Pragma -> Pragma)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Pragma -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Pragma -> r)
-> (forall u. (forall d. Data d => d -> u) -> Pragma -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> Data Pragma
Pragma -> DataType
Pragma -> Constr
(forall b. Data b => b -> b) -> Pragma -> Pragma
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u
forall u. (forall d. Data d => d -> u) -> Pragma -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pragma)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
$cNoUniverseCheckPragma :: Constr
$cPolarityPragma :: Constr
$cNoPositivityCheckPragma :: Constr
$cNoCoverageCheckPragma :: Constr
$cTerminationCheckPragma :: Constr
$cCatchallPragma :: Constr
$cDisplayPragma :: Constr
$cInjectivePragma :: Constr
$cWarningOnImport :: Constr
$cWarningOnUsage :: Constr
$cEtaPragma :: Constr
$cImpossiblePragma :: Constr
$cInlinePragma :: Constr
$cStaticPragma :: Constr
$cCompilePragma :: Constr
$cForeignPragma :: Constr
$cRewritePragma :: Constr
$cBuiltinPragma :: Constr
$cOptionsPragma :: Constr
$tPragma :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Pragma -> m Pragma
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapMp :: (forall d. Data d => d -> m d) -> Pragma -> m Pragma
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapM :: (forall d. Data d => d -> m d) -> Pragma -> m Pragma
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapQi :: Int -> (forall d. Data d => d -> u) -> Pragma -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u
gmapQ :: (forall d. Data d => d -> u) -> Pragma -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Pragma -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
gmapT :: (forall b. Data b => b -> b) -> Pragma -> Pragma
$cgmapT :: (forall b. Data b => b -> b) -> Pragma -> Pragma
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Pragma)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pragma)
dataTypeOf :: Pragma -> DataType
$cdataTypeOf :: Pragma -> DataType
toConstr :: Pragma -> Constr
$ctoConstr :: Pragma -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
$cp1Data :: Typeable Pragma
Data, Pragma -> Pragma -> Bool
(Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Bool) -> Eq Pragma
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pragma -> Pragma -> Bool
$c/= :: Pragma -> Pragma -> Bool
== :: Pragma -> Pragma -> Bool
$c== :: Pragma -> Pragma -> Bool
Eq)

---------------------------------------------------------------------------

-- | Modules: Top-level pragmas plus other top-level declarations.

type Module = ([Pragma], [Declaration])

-- | Computes the top-level module name.
--
-- Precondition: The 'Module' has to be well-formed.
-- This means that there are only allowed declarations before the
-- first module declaration, typically import declarations.
-- See 'spanAllowedBeforeModule'.

topLevelModuleName :: Module -> TopLevelModuleName
topLevelModuleName :: Module -> TopLevelModuleName
topLevelModuleName ([Pragma]
_, []) = TopLevelModuleName
forall a. HasCallStack => a
__IMPOSSIBLE__
topLevelModuleName ([Pragma]
_, [Declaration]
ds) = case [Declaration] -> ([Declaration], [Declaration])
spanAllowedBeforeModule [Declaration]
ds of
  ([Declaration]
_, Module Range
_ QName
n Telescope
_ [Declaration]
_ : [Declaration]
_) -> QName -> TopLevelModuleName
toTopLevelModuleName QName
n
  ([Declaration], [Declaration])
_ -> TopLevelModuleName
forall a. HasCallStack => a
__IMPOSSIBLE__

-- | Splits off allowed (= import) declarations before the first
--   non-allowed declaration.
--   After successful parsing, the first non-allowed declaration
--   should be a module declaration.
spanAllowedBeforeModule :: [Declaration] -> ([Declaration], [Declaration])
spanAllowedBeforeModule :: [Declaration] -> ([Declaration], [Declaration])
spanAllowedBeforeModule = (Declaration -> Bool)
-> [Declaration] -> ([Declaration], [Declaration])
forall a. (a -> Bool) -> [a] -> ([a], [a])
span Declaration -> Bool
isAllowedBeforeModule
  where
    isAllowedBeforeModule :: Declaration -> Bool
isAllowedBeforeModule (Pragma OptionsPragma{}) = Bool
True
    isAllowedBeforeModule (Pragma BuiltinPragma{}) = Bool
True
    isAllowedBeforeModule (Private Range
_ Origin
_ [Declaration]
ds) = (Declaration -> Bool) -> [Declaration] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all Declaration -> Bool
isAllowedBeforeModule [Declaration]
ds
    isAllowedBeforeModule Import{}       = Bool
True
    isAllowedBeforeModule ModuleMacro{}  = Bool
True
    isAllowedBeforeModule Open{}         = Bool
True
    isAllowedBeforeModule Declaration
_              = Bool
False

{--------------------------------------------------------------------------
    Things we parse but are not part of the Agda file syntax
 --------------------------------------------------------------------------}

-- | Extended content of an interaction hole.
data HoleContent' qn p e
  = HoleContentExpr    e                    -- ^ @e@
  | HoleContentRewrite [RewriteEqn' qn p e] -- ^ @(rewrite | invert) e0 | ... | en@
  deriving (a -> HoleContent' qn p b -> HoleContent' qn p a
(a -> b) -> HoleContent' qn p a -> HoleContent' qn p b
(forall a b.
 (a -> b) -> HoleContent' qn p a -> HoleContent' qn p b)
-> (forall a b. a -> HoleContent' qn p b -> HoleContent' qn p a)
-> Functor (HoleContent' qn p)
forall a b. a -> HoleContent' qn p b -> HoleContent' qn p a
forall a b. (a -> b) -> HoleContent' qn p a -> HoleContent' qn p b
forall qn p a b. a -> HoleContent' qn p b -> HoleContent' qn p a
forall qn p a b.
(a -> b) -> HoleContent' qn p a -> HoleContent' qn p b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> HoleContent' qn p b -> HoleContent' qn p a
$c<$ :: forall qn p a b. a -> HoleContent' qn p b -> HoleContent' qn p a
fmap :: (a -> b) -> HoleContent' qn p a -> HoleContent' qn p b
$cfmap :: forall qn p a b.
(a -> b) -> HoleContent' qn p a -> HoleContent' qn p b
Functor, HoleContent' qn p a -> Bool
(a -> m) -> HoleContent' qn p a -> m
(a -> b -> b) -> b -> HoleContent' qn p a -> b
(forall m. Monoid m => HoleContent' qn p m -> m)
-> (forall m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m)
-> (forall m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m)
-> (forall a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b)
-> (forall a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b)
-> (forall b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b)
-> (forall b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b)
-> (forall a. (a -> a -> a) -> HoleContent' qn p a -> a)
-> (forall a. (a -> a -> a) -> HoleContent' qn p a -> a)
-> (forall a. HoleContent' qn p a -> [a])
-> (forall a. HoleContent' qn p a -> Bool)
-> (forall a. HoleContent' qn p a -> Int)
-> (forall a. Eq a => a -> HoleContent' qn p a -> Bool)
-> (forall a. Ord a => HoleContent' qn p a -> a)
-> (forall a. Ord a => HoleContent' qn p a -> a)
-> (forall a. Num a => HoleContent' qn p a -> a)
-> (forall a. Num a => HoleContent' qn p a -> a)
-> Foldable (HoleContent' qn p)
forall a. Eq a => a -> HoleContent' qn p a -> Bool
forall a. Num a => HoleContent' qn p a -> a
forall a. Ord a => HoleContent' qn p a -> a
forall m. Monoid m => HoleContent' qn p m -> m
forall a. HoleContent' qn p a -> Bool
forall a. HoleContent' qn p a -> Int
forall a. HoleContent' qn p a -> [a]
forall a. (a -> a -> a) -> HoleContent' qn p a -> a
forall m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m
forall b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b
forall a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b
forall qn p a. Eq a => a -> HoleContent' qn p a -> Bool
forall qn p a. Num a => HoleContent' qn p a -> a
forall qn p a. Ord a => HoleContent' qn p a -> a
forall qn p m. Monoid m => HoleContent' qn p m -> m
forall qn p a. HoleContent' qn p a -> Bool
forall qn p a. HoleContent' qn p a -> Int
forall qn p a. HoleContent' qn p a -> [a]
forall qn p a. (a -> a -> a) -> HoleContent' qn p a -> a
forall qn p m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m
forall qn p b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b
forall qn p a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: HoleContent' qn p a -> a
$cproduct :: forall qn p a. Num a => HoleContent' qn p a -> a
sum :: HoleContent' qn p a -> a
$csum :: forall qn p a. Num a => HoleContent' qn p a -> a
minimum :: HoleContent' qn p a -> a
$cminimum :: forall qn p a. Ord a => HoleContent' qn p a -> a
maximum :: HoleContent' qn p a -> a
$cmaximum :: forall qn p a. Ord a => HoleContent' qn p a -> a
elem :: a -> HoleContent' qn p a -> Bool
$celem :: forall qn p a. Eq a => a -> HoleContent' qn p a -> Bool
length :: HoleContent' qn p a -> Int
$clength :: forall qn p a. HoleContent' qn p a -> Int
null :: HoleContent' qn p a -> Bool
$cnull :: forall qn p a. HoleContent' qn p a -> Bool
toList :: HoleContent' qn p a -> [a]
$ctoList :: forall qn p a. HoleContent' qn p a -> [a]
foldl1 :: (a -> a -> a) -> HoleContent' qn p a -> a
$cfoldl1 :: forall qn p a. (a -> a -> a) -> HoleContent' qn p a -> a
foldr1 :: (a -> a -> a) -> HoleContent' qn p a -> a
$cfoldr1 :: forall qn p a. (a -> a -> a) -> HoleContent' qn p a -> a
foldl' :: (b -> a -> b) -> b -> HoleContent' qn p a -> b
$cfoldl' :: forall qn p b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b
foldl :: (b -> a -> b) -> b -> HoleContent' qn p a -> b
$cfoldl :: forall qn p b a. (b -> a -> b) -> b -> HoleContent' qn p a -> b
foldr' :: (a -> b -> b) -> b -> HoleContent' qn p a -> b
$cfoldr' :: forall qn p a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b
foldr :: (a -> b -> b) -> b -> HoleContent' qn p a -> b
$cfoldr :: forall qn p a b. (a -> b -> b) -> b -> HoleContent' qn p a -> b
foldMap' :: (a -> m) -> HoleContent' qn p a -> m
$cfoldMap' :: forall qn p m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m
foldMap :: (a -> m) -> HoleContent' qn p a -> m
$cfoldMap :: forall qn p m a. Monoid m => (a -> m) -> HoleContent' qn p a -> m
fold :: HoleContent' qn p m -> m
$cfold :: forall qn p m. Monoid m => HoleContent' qn p m -> m
Foldable, Functor (HoleContent' qn p)
Foldable (HoleContent' qn p)
Functor (HoleContent' qn p)
-> Foldable (HoleContent' qn p)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    HoleContent' qn p (f a) -> f (HoleContent' qn p a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> HoleContent' qn p a -> m (HoleContent' qn p b))
-> (forall (m :: * -> *) a.
    Monad m =>
    HoleContent' qn p (m a) -> m (HoleContent' qn p a))
-> Traversable (HoleContent' qn p)
(a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b)
forall qn p. Functor (HoleContent' qn p)
forall qn p. Foldable (HoleContent' qn p)
forall qn p (m :: * -> *) a.
Monad m =>
HoleContent' qn p (m a) -> m (HoleContent' qn p a)
forall qn p (f :: * -> *) a.
Applicative f =>
HoleContent' qn p (f a) -> f (HoleContent' qn p a)
forall qn p (m :: * -> *) a b.
Monad m =>
(a -> m b) -> HoleContent' qn p a -> m (HoleContent' qn p b)
forall qn p (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
HoleContent' qn p (m a) -> m (HoleContent' qn p a)
forall (f :: * -> *) a.
Applicative f =>
HoleContent' qn p (f a) -> f (HoleContent' qn p a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> HoleContent' qn p a -> m (HoleContent' qn p b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b)
sequence :: HoleContent' qn p (m a) -> m (HoleContent' qn p a)
$csequence :: forall qn p (m :: * -> *) a.
Monad m =>
HoleContent' qn p (m a) -> m (HoleContent' qn p a)
mapM :: (a -> m b) -> HoleContent' qn p a -> m (HoleContent' qn p b)
$cmapM :: forall qn p (m :: * -> *) a b.
Monad m =>
(a -> m b) -> HoleContent' qn p a -> m (HoleContent' qn p b)
sequenceA :: HoleContent' qn p (f a) -> f (HoleContent' qn p a)
$csequenceA :: forall qn p (f :: * -> *) a.
Applicative f =>
HoleContent' qn p (f a) -> f (HoleContent' qn p a)
traverse :: (a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b)
$ctraverse :: forall qn p (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> HoleContent' qn p a -> f (HoleContent' qn p b)
$cp2Traversable :: forall qn p. Foldable (HoleContent' qn p)
$cp1Traversable :: forall qn p. Functor (HoleContent' qn p)
Traversable)

type HoleContent = HoleContent' () Pattern Expr

{--------------------------------------------------------------------------
    Views
 --------------------------------------------------------------------------}

-- | The 'Expr' is not an application.
data AppView = AppView Expr [NamedArg Expr]

appView :: Expr -> AppView
appView :: Expr -> AppView
appView Expr
e =
  case Expr
e of
    App Range
r Expr
e1 NamedArg Expr
e2     -> AppView -> NamedArg Expr -> AppView
vApp (Expr -> AppView
appView Expr
e1) NamedArg Expr
e2
    RawApp Range
_ (Expr
e:[Expr]
es) -> Expr -> [NamedArg Expr] -> AppView
AppView Expr
e ([NamedArg Expr] -> AppView) -> [NamedArg Expr] -> AppView
forall a b. (a -> b) -> a -> b
$ (Expr -> NamedArg Expr) -> [Expr] -> [NamedArg Expr]
forall a b. (a -> b) -> [a] -> [b]
map Expr -> NamedArg Expr
arg [Expr]
es
    Expr
_               -> Expr -> [NamedArg Expr] -> AppView
AppView Expr
e []
  where
    vApp :: AppView -> NamedArg Expr -> AppView
vApp (AppView Expr
e [NamedArg Expr]
es) NamedArg Expr
arg = Expr -> [NamedArg Expr] -> AppView
AppView Expr
e ([NamedArg Expr]
es [NamedArg Expr] -> [NamedArg Expr] -> [NamedArg Expr]
forall a. [a] -> [a] -> [a]
++ [NamedArg Expr
arg])

    arg :: Expr -> NamedArg Expr
arg (HiddenArg   Range
_ Named_ Expr
e) = NamedArg Expr -> NamedArg Expr
forall a. LensHiding a => a -> a
hide         (NamedArg Expr -> NamedArg Expr) -> NamedArg Expr -> NamedArg Expr
forall a b. (a -> b) -> a -> b
$ Named_ Expr -> NamedArg Expr
forall a. a -> Arg a
defaultArg Named_ Expr
e
    arg (InstanceArg Range
_ Named_ Expr
e) = NamedArg Expr -> NamedArg Expr
forall a. LensHiding a => a -> a
makeInstance (NamedArg Expr -> NamedArg Expr) -> NamedArg Expr -> NamedArg Expr
forall a b. (a -> b) -> a -> b
$ Named_ Expr -> NamedArg Expr
forall a. a -> Arg a
defaultArg Named_ Expr
e
    arg Expr
e                 = Named_ Expr -> NamedArg Expr
forall a. a -> Arg a
defaultArg (Expr -> Named_ Expr
forall a name. a -> Named name a
unnamed Expr
e)

isSingleIdentifierP :: Pattern -> Maybe Name
isSingleIdentifierP :: Pattern -> Maybe Name
isSingleIdentifierP Pattern
p = case Pattern -> Pattern
removeSingletonRawAppP Pattern
p of
  IdentP (QName Name
x) -> Name -> Maybe Name
forall a. a -> Maybe a
Just Name
x
  WildP Range
r          -> Name -> Maybe Name
forall a. a -> Maybe a
Just (Name -> Maybe Name) -> Name -> Maybe Name
forall a b. (a -> b) -> a -> b
$ Range -> Name
noName Range
r
  Pattern
_                -> Maybe Name
forall a. Maybe a
Nothing

removeSingletonRawAppP :: Pattern -> Pattern
removeSingletonRawAppP :: Pattern -> Pattern
removeSingletonRawAppP Pattern
p = case Pattern
p of
    RawAppP Range
_ [Pattern
p'] -> Pattern -> Pattern
removeSingletonRawAppP Pattern
p'
    ParenP Range
_ Pattern
p'    -> Pattern -> Pattern
removeSingletonRawAppP Pattern
p'
    Pattern
_ -> Pattern
p

-- | Observe the hiding status of an expression

observeHiding :: Expr -> WithHiding Expr
observeHiding :: Expr -> WithHiding Expr
observeHiding = \case
  RawApp Range
_ [Expr
e]                    -> Expr -> WithHiding Expr
observeHiding Expr
e
  HiddenArg Range
_   (Named Maybe NamedName
Nothing Expr
e) -> Hiding -> Expr -> WithHiding Expr
forall a. Hiding -> a -> WithHiding a
WithHiding Hiding
Hidden Expr
e
  InstanceArg Range
_ (Named Maybe NamedName
Nothing Expr
e) -> Hiding -> Expr -> WithHiding Expr
forall a. Hiding -> a -> WithHiding a
WithHiding (Overlappable -> Hiding
Instance Overlappable
NoOverlap) Expr
e
  Expr
e                               -> Hiding -> Expr -> WithHiding Expr
forall a. Hiding -> a -> WithHiding a
WithHiding Hiding
NotHidden Expr
e

-- | Turn an expression into a pattern. Fails if the expression is not a
--   valid pattern.

isPattern :: Expr -> Maybe Pattern
isPattern :: Expr -> Maybe Pattern
isPattern = \case
  Ident QName
x         -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ QName -> Pattern
IdentP QName
x
  App Range
_ Expr
e1 NamedArg Expr
e2     -> Pattern -> NamedArg Pattern -> Pattern
AppP (Pattern -> NamedArg Pattern -> Pattern)
-> Maybe Pattern -> Maybe (NamedArg Pattern -> Pattern)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Expr -> Maybe Pattern
isPattern Expr
e1 Maybe (NamedArg Pattern -> Pattern)
-> Maybe (NamedArg Pattern) -> Maybe Pattern
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Named_ Expr -> Maybe (Named NamedName Pattern))
-> NamedArg Expr -> Maybe (NamedArg Pattern)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((Expr -> Maybe Pattern)
-> Named_ Expr -> Maybe (Named NamedName Pattern)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Expr -> Maybe Pattern
isPattern) NamedArg Expr
e2
  Paren Range
r Expr
e       -> Range -> Pattern -> Pattern
ParenP Range
r (Pattern -> Pattern) -> Maybe Pattern -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Expr -> Maybe Pattern
isPattern Expr
e
  Underscore Range
r Maybe String
_  -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> Pattern
WildP Range
r
  Absurd Range
r        -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> Pattern
AbsurdP Range
r
  As Range
r Name
x Expr
e        -> Range -> (Pattern -> Pattern) -> Pattern -> Pattern
pushUnderBracesP Range
r (Range -> Name -> Pattern -> Pattern
AsP Range
r Name
x) (Pattern -> Pattern) -> Maybe Pattern -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Expr -> Maybe Pattern
isPattern Expr
e
  Dot Range
r Expr
e         -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> (Expr -> Pattern) -> Expr -> Pattern
pushUnderBracesE Range
r (Range -> Expr -> Pattern
DotP Range
r) Expr
e
  Lit Literal
l           -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Literal -> Pattern
LitP Literal
l
  HiddenArg Range
r Named_ Expr
e   -> Range -> Named NamedName Pattern -> Pattern
HiddenP Range
r (Named NamedName Pattern -> Pattern)
-> Maybe (Named NamedName Pattern) -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Expr -> Maybe Pattern)
-> Named_ Expr -> Maybe (Named NamedName Pattern)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Expr -> Maybe Pattern
isPattern Named_ Expr
e
  InstanceArg Range
r Named_ Expr
e -> Range -> Named NamedName Pattern -> Pattern
InstanceP Range
r (Named NamedName Pattern -> Pattern)
-> Maybe (Named NamedName Pattern) -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Expr -> Maybe Pattern)
-> Named_ Expr -> Maybe (Named NamedName Pattern)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Expr -> Maybe Pattern
isPattern Named_ Expr
e
  RawApp Range
r [Expr]
es     -> Range -> [Pattern] -> Pattern
RawAppP Range
r ([Pattern] -> Pattern) -> Maybe [Pattern] -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Expr -> Maybe Pattern) -> [Expr] -> Maybe [Pattern]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Expr -> Maybe Pattern
isPattern [Expr]
es
  Quote Range
r         -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> Pattern
QuoteP Range
r
  Equal Range
r Expr
e1 Expr
e2   -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> [(Expr, Expr)] -> Pattern
EqualP Range
r [(Expr
e1, Expr
e2)]
  Ellipsis Range
r      -> Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ Range -> Pattern
EllipsisP Range
r
  Rec Range
r RecordAssignments
es        -> do
    [FieldAssignment]
fs <- (Either FieldAssignment ModuleAssignment -> Maybe FieldAssignment)
-> RecordAssignments -> Maybe [FieldAssignment]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Either FieldAssignment ModuleAssignment -> Maybe FieldAssignment
forall a b. Either a b -> Maybe a
maybeLeft RecordAssignments
es
    Range -> [FieldAssignment' Pattern] -> Pattern
RecP Range
r ([FieldAssignment' Pattern] -> Pattern)
-> Maybe [FieldAssignment' Pattern] -> Maybe Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (FieldAssignment -> Maybe (FieldAssignment' Pattern))
-> [FieldAssignment] -> Maybe [FieldAssignment' Pattern]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((Expr -> Maybe Pattern)
-> FieldAssignment -> Maybe (FieldAssignment' Pattern)
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Expr -> Maybe Pattern
isPattern) [FieldAssignment]
fs
  -- WithApp has already lost the range information of the bars '|'
  WithApp Range
r Expr
e [Expr]
es  -> do
    Pattern
p  <- Expr -> Maybe Pattern
isPattern Expr
e
    [NamedArg Pattern]
ps <- [Expr]
-> (Expr -> Maybe (NamedArg Pattern)) -> Maybe [NamedArg Pattern]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
forM [Expr]
es ((Expr -> Maybe (NamedArg Pattern)) -> Maybe [NamedArg Pattern])
-> (Expr -> Maybe (NamedArg Pattern)) -> Maybe [NamedArg Pattern]
forall a b. (a -> b) -> a -> b
$ \ Expr
e -> do
      Pattern
p <- Expr -> Maybe Pattern
isPattern Expr
e
      NamedArg Pattern -> Maybe (NamedArg Pattern)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (NamedArg Pattern -> Maybe (NamedArg Pattern))
-> NamedArg Pattern -> Maybe (NamedArg Pattern)
forall a b. (a -> b) -> a -> b
$ Pattern -> NamedArg Pattern
forall a. a -> NamedArg a
defaultNamedArg (Pattern -> NamedArg Pattern) -> Pattern -> NamedArg Pattern
forall a b. (a -> b) -> a -> b
$ Range -> Pattern -> Pattern
WithP (Expr -> Range
forall t. HasRange t => t -> Range
getRange Expr
e) Pattern
p   -- TODO #2822: Range!
    Pattern -> Maybe Pattern
forall (m :: * -> *) a. Monad m => a -> m a
return (Pattern -> Maybe Pattern) -> Pattern -> Maybe Pattern
forall a b. (a -> b) -> a -> b
$ (Pattern -> NamedArg Pattern -> Pattern)
-> Pattern -> [NamedArg Pattern] -> Pattern
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl Pattern -> NamedArg Pattern -> Pattern
AppP Pattern
p [NamedArg Pattern]
ps
  Expr
_ -> Maybe Pattern
forall a. Maybe a
Nothing

  where

    pushUnderBracesP :: Range -> (Pattern -> Pattern) -> (Pattern -> Pattern)
    pushUnderBracesP :: Range -> (Pattern -> Pattern) -> Pattern -> Pattern
pushUnderBracesP Range
r Pattern -> Pattern
f = \case
      HiddenP Range
_ Named NamedName Pattern
p   -> Range -> Named NamedName Pattern -> Pattern
HiddenP Range
r ((Pattern -> Pattern)
-> Named NamedName Pattern -> Named NamedName Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Pattern -> Pattern
f Named NamedName Pattern
p)
      InstanceP Range
_ Named NamedName Pattern
p -> Range -> Named NamedName Pattern -> Pattern
InstanceP Range
r ((Pattern -> Pattern)
-> Named NamedName Pattern -> Named NamedName Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Pattern -> Pattern
f Named NamedName Pattern
p)
      Pattern
p             -> Pattern -> Pattern
f Pattern
p

    pushUnderBracesE :: Range -> (Expr -> Pattern) -> (Expr -> Pattern)
    pushUnderBracesE :: Range -> (Expr -> Pattern) -> Expr -> Pattern
pushUnderBracesE Range
r Expr -> Pattern
f = \case
      HiddenArg Range
_ Named_ Expr
p   -> Range -> Named NamedName Pattern -> Pattern
HiddenP Range
r ((Expr -> Pattern) -> Named_ Expr -> Named NamedName Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Expr -> Pattern
f Named_ Expr
p)
      InstanceArg Range
_ Named_ Expr
p -> Range -> Named NamedName Pattern -> Pattern
InstanceP Range
r ((Expr -> Pattern) -> Named_ Expr -> Named NamedName Pattern
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Expr -> Pattern
f Named_ Expr
p)
      Expr
p               -> Expr -> Pattern
f Expr
p

isAbsurdP :: Pattern -> Maybe (Range, Hiding)
isAbsurdP :: Pattern -> Maybe (Range, Hiding)
isAbsurdP = \case
  AbsurdP Range
r      -> (Range, Hiding) -> Maybe (Range, Hiding)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Range
r, Hiding
NotHidden)
  AsP Range
_ Name
_      Pattern
p -> Pattern -> Maybe (Range, Hiding)
isAbsurdP Pattern
p
  ParenP Range
_     Pattern
p -> Pattern -> Maybe (Range, Hiding)
isAbsurdP Pattern
p
  RawAppP Range
_ [Pattern
p]  -> Pattern -> Maybe (Range, Hiding)
isAbsurdP Pattern
p
  HiddenP   Range
_ Named NamedName Pattern
np -> (Hiding
Hidden Hiding -> (Range, Hiding) -> (Range, Hiding)
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$)              ((Range, Hiding) -> (Range, Hiding))
-> Maybe (Range, Hiding) -> Maybe (Range, Hiding)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern -> Maybe (Range, Hiding)
isAbsurdP (Named NamedName Pattern -> Pattern
forall name a. Named name a -> a
namedThing Named NamedName Pattern
np)
  InstanceP Range
_ Named NamedName Pattern
np -> (Overlappable -> Hiding
Instance Overlappable
YesOverlap Hiding -> (Range, Hiding) -> (Range, Hiding)
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$) ((Range, Hiding) -> (Range, Hiding))
-> Maybe (Range, Hiding) -> Maybe (Range, Hiding)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern -> Maybe (Range, Hiding)
isAbsurdP (Named NamedName Pattern -> Pattern
forall name a. Named name a -> a
namedThing Named NamedName Pattern
np)
  Pattern
_ -> Maybe (Range, Hiding)
forall a. Maybe a
Nothing

isBinderP :: Pattern -> Maybe Binder
isBinderP :: Pattern -> Maybe Binder
isBinderP = \case
  IdentP QName
qn  -> Name -> Binder
mkBinder_ (Name -> Binder) -> Maybe Name -> Maybe Binder
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> QName -> Maybe Name
isUnqualified QName
qn
  WildP Range
r    -> Binder -> Maybe Binder
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Binder -> Maybe Binder) -> Binder -> Maybe Binder
forall a b. (a -> b) -> a -> b
$ Name -> Binder
mkBinder_ (Range -> NameInScope -> [NamePart] -> Name
Name Range
r NameInScope
InScope [NamePart
Hole])
  AsP Range
r Name
n Pattern
p  -> Binder -> Maybe Binder
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Binder -> Maybe Binder) -> Binder -> Maybe Binder
forall a b. (a -> b) -> a -> b
$ Maybe Pattern -> BoundName -> Binder
forall a. Maybe Pattern -> a -> Binder' a
Binder (Pattern -> Maybe Pattern
forall a. a -> Maybe a
Just Pattern
p) (Name -> BoundName
mkBoundName_ Name
n)
  ParenP Range
r Pattern
p -> Binder -> Maybe Binder
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Binder -> Maybe Binder) -> Binder -> Maybe Binder
forall a b. (a -> b) -> a -> b
$ Maybe Pattern -> BoundName -> Binder
forall a. Maybe Pattern -> a -> Binder' a
Binder (Pattern -> Maybe Pattern
forall a. a -> Maybe a
Just Pattern
p) (Name -> BoundName
mkBoundName_ (Name -> BoundName) -> Name -> BoundName
forall a b. (a -> b) -> a -> b
$ Range -> NameInScope -> [NamePart] -> Name
Name Range
r NameInScope
InScope [NamePart
Hole])
  Pattern
_ -> Maybe Binder
forall a. Maybe a
Nothing

{--------------------------------------------------------------------------
    Instances
 --------------------------------------------------------------------------}

-- Null
------------------------------------------------------------------------

-- | A 'WhereClause' is 'null' when the @where@ keyword is absent.
--   An empty list of declarations does not count as 'null' here.

instance Null (WhereClause' a) where
  empty :: WhereClause' a
empty = WhereClause' a
forall a. WhereClause' a
NoWhere
  null :: WhereClause' a -> Bool
null WhereClause' a
NoWhere = Bool
True
  null AnyWhere{} = Bool
False
  null SomeWhere{} = Bool
False

-- Lenses
------------------------------------------------------------------------

instance LensHiding LamBinding where
  getHiding :: LamBinding -> Hiding
getHiding   (DomainFree NamedArg Binder
x) = NamedArg Binder -> Hiding
forall a. LensHiding a => a -> Hiding
getHiding NamedArg Binder
x
  getHiding   (DomainFull TypedBinding
a) = TypedBinding -> Hiding
forall a. LensHiding a => a -> Hiding
getHiding TypedBinding
a
  mapHiding :: (Hiding -> Hiding) -> LamBinding -> LamBinding
mapHiding Hiding -> Hiding
f (DomainFree NamedArg Binder
x) = NamedArg Binder -> LamBinding
forall a. NamedArg Binder -> LamBinding' a
DomainFree (NamedArg Binder -> LamBinding) -> NamedArg Binder -> LamBinding
forall a b. (a -> b) -> a -> b
$ (Hiding -> Hiding) -> NamedArg Binder -> NamedArg Binder
forall a. LensHiding a => (Hiding -> Hiding) -> a -> a
mapHiding Hiding -> Hiding
f NamedArg Binder
x
  mapHiding Hiding -> Hiding
f (DomainFull TypedBinding
a) = TypedBinding -> LamBinding
forall a. a -> LamBinding' a
DomainFull (TypedBinding -> LamBinding) -> TypedBinding -> LamBinding
forall a b. (a -> b) -> a -> b
$ (Hiding -> Hiding) -> TypedBinding -> TypedBinding
forall a. LensHiding a => (Hiding -> Hiding) -> a -> a
mapHiding Hiding -> Hiding
f TypedBinding
a

instance LensHiding TypedBinding where
  getHiding :: TypedBinding -> Hiding
getHiding (TBind Range
_ (NamedArg Binder
x : [NamedArg Binder]
_) Expr
_) = NamedArg Binder -> Hiding
forall a. LensHiding a => a -> Hiding
getHiding NamedArg Binder
x   -- Slightly dubious
  getHiding (TBind Range
_ [] Expr
_)      = Hiding
forall a. HasCallStack => a
__IMPOSSIBLE__
  getHiding TLet{}              = Hiding
forall a. Monoid a => a
mempty
  mapHiding :: (Hiding -> Hiding) -> TypedBinding -> TypedBinding
mapHiding Hiding -> Hiding
f (TBind Range
r [NamedArg Binder]
xs Expr
e) = Range -> [NamedArg Binder] -> Expr -> TypedBinding
forall e. Range -> [NamedArg Binder] -> e -> TypedBinding' e
TBind Range
r (((NamedArg Binder -> NamedArg Binder)
-> [NamedArg Binder] -> [NamedArg Binder]
forall a b. (a -> b) -> [a] -> [b]
map ((NamedArg Binder -> NamedArg Binder)
 -> [NamedArg Binder] -> [NamedArg Binder])
-> ((Hiding -> Hiding) -> NamedArg Binder -> NamedArg Binder)
-> (Hiding -> Hiding)
-> [NamedArg Binder]
-> [NamedArg Binder]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Hiding -> Hiding) -> NamedArg Binder -> NamedArg Binder
forall a. LensHiding a => (Hiding -> Hiding) -> a -> a
mapHiding) Hiding -> Hiding
f [NamedArg Binder]
xs) Expr
e
  mapHiding Hiding -> Hiding
f b :: TypedBinding
b@TLet{}       = TypedBinding
b

instance LensRelevance TypedBinding where
  getRelevance :: TypedBinding -> Relevance
getRelevance (TBind Range
_ (NamedArg Binder
x : [NamedArg Binder]
_) Expr
_) = NamedArg Binder -> Relevance
forall a. LensRelevance a => a -> Relevance
getRelevance NamedArg Binder
x   -- Slightly dubious
  getRelevance (TBind Range
_ [] Expr
_)      = Relevance
forall a. HasCallStack => a
__IMPOSSIBLE__
  getRelevance TLet{}              = Relevance
forall a. Monoid a => a
mempty
  mapRelevance :: (Relevance -> Relevance) -> TypedBinding -> TypedBinding
mapRelevance Relevance -> Relevance
f (TBind Range
r [NamedArg Binder]
xs Expr
e) = Range -> [NamedArg Binder] -> Expr -> TypedBinding
forall e. Range -> [NamedArg Binder] -> e -> TypedBinding' e
TBind Range
r (((NamedArg Binder -> NamedArg Binder)
-> [NamedArg Binder] -> [NamedArg Binder]
forall a b. (a -> b) -> [a] -> [b]
map ((NamedArg Binder -> NamedArg Binder)
 -> [NamedArg Binder] -> [NamedArg Binder])
-> ((Relevance -> Relevance) -> NamedArg Binder -> NamedArg Binder)
-> (Relevance -> Relevance)
-> [NamedArg Binder]
-> [NamedArg Binder]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Relevance -> Relevance) -> NamedArg Binder -> NamedArg Binder
forall a. LensRelevance a => (Relevance -> Relevance) -> a -> a
mapRelevance) Relevance -> Relevance
f [NamedArg Binder]
xs) Expr
e
  mapRelevance Relevance -> Relevance
f b :: TypedBinding
b@TLet{}       = TypedBinding
b

-- HasRange instances
------------------------------------------------------------------------

instance HasRange e => HasRange (OpApp e) where
  getRange :: OpApp e -> Range
getRange OpApp e
e = case OpApp e
e of
    Ordinary e
e -> e -> Range
forall t. HasRange t => t -> Range
getRange e
e
    SyntaxBindingLambda Range
r [LamBinding]
_ e
_ -> Range
r

instance HasRange Expr where
  getRange :: Expr -> Range
getRange = \case
      Ident QName
x            -> QName -> Range
forall t. HasRange t => t -> Range
getRange QName
x
      Lit Literal
x              -> Literal -> Range
forall t. HasRange t => t -> Range
getRange Literal
x
      QuestionMark Range
r Maybe Int
_   -> Range
r
      Underscore Range
r Maybe String
_     -> Range
r
      App Range
r Expr
_ NamedArg Expr
_          -> Range
r
      RawApp Range
r [Expr]
_         -> Range
r
      OpApp Range
r QName
_ Set Name
_ [NamedArg (MaybePlaceholder (OpApp Expr))]
_      -> Range
r
      WithApp Range
r Expr
_ [Expr]
_      -> Range
r
      Lam Range
r [LamBinding]
_ Expr
_          -> Range
r
      AbsurdLam Range
r Hiding
_      -> Range
r
      ExtendedLam Range
r [LamClause]
_    -> Range
r
      Fun Range
r Arg Expr
_ Expr
_          -> Range
r
      Pi Telescope
b Expr
e             -> Telescope -> Expr -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Telescope
b Expr
e
      Set Range
r              -> Range
r
      Prop Range
r             -> Range
r
      SetN Range
r Integer
_           -> Range
r
      PropN Range
r Integer
_          -> Range
r
      Let Range
r [Declaration]
_ TacticAttribute
_          -> Range
r
      Paren Range
r Expr
_          -> Range
r
      IdiomBrackets Range
r [Expr]
_  -> Range
r
      DoBlock Range
r [DoStmt]
_        -> Range
r
      As Range
r Name
_ Expr
_           -> Range
r
      Dot Range
r Expr
_            -> Range
r
      DoubleDot Range
r Expr
_      -> Range
r
      Absurd Range
r           -> Range
r
      HiddenArg Range
r Named_ Expr
_      -> Range
r
      InstanceArg Range
r Named_ Expr
_    -> Range
r
      Rec Range
r RecordAssignments
_            -> Range
r
      RecUpdate Range
r Expr
_ [FieldAssignment]
_    -> Range
r
      ETel Telescope
tel           -> Telescope -> Range
forall t. HasRange t => t -> Range
getRange Telescope
tel
      Quote Range
r            -> Range
r
      QuoteTerm Range
r        -> Range
r
      Unquote Range
r          -> Range
r
      Tactic Range
r Expr
_         -> Range
r
      DontCare{}         -> Range
forall a. Range' a
noRange
      Equal Range
r Expr
_ Expr
_        -> Range
r
      Ellipsis Range
r         -> Range
r
      Generalized Expr
e      -> Expr -> Range
forall t. HasRange t => t -> Range
getRange Expr
e

-- instance HasRange Telescope where
--     getRange (TeleBind bs) = getRange bs
--     getRange (TeleFun x y) = fuseRange x y

instance HasRange Binder where
  getRange :: Binder -> Range
getRange (Binder Maybe Pattern
a BoundName
b) = Maybe Pattern -> BoundName -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Maybe Pattern
a BoundName
b

instance HasRange TypedBinding where
  getRange :: TypedBinding -> Range
getRange (TBind Range
r [NamedArg Binder]
_ Expr
_) = Range
r
  getRange (TLet Range
r [Declaration]
_)    = Range
r

instance HasRange LamBinding where
  getRange :: LamBinding -> Range
getRange (DomainFree NamedArg Binder
x) = NamedArg Binder -> Range
forall t. HasRange t => t -> Range
getRange NamedArg Binder
x
  getRange (DomainFull TypedBinding
b) = TypedBinding -> Range
forall t. HasRange t => t -> Range
getRange TypedBinding
b

instance HasRange BoundName where
  getRange :: BoundName -> Range
getRange = Name -> Range
forall t. HasRange t => t -> Range
getRange (Name -> Range) -> (BoundName -> Name) -> BoundName -> Range
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BoundName -> Name
boundName

instance HasRange WhereClause where
  getRange :: WhereClause -> Range
getRange  WhereClause
NoWhere         = Range
forall a. Range' a
noRange
  getRange (AnyWhere [Declaration]
ds)    = [Declaration] -> Range
forall t. HasRange t => t -> Range
getRange [Declaration]
ds
  getRange (SomeWhere Name
_ Access
_ [Declaration]
ds) = [Declaration] -> Range
forall t. HasRange t => t -> Range
getRange [Declaration]
ds

instance HasRange ModuleApplication where
  getRange :: ModuleApplication -> Range
getRange (SectionApp Range
r Telescope
_ Expr
_) = Range
r
  getRange (RecordModuleInstance Range
r QName
_) = Range
r

instance HasRange a => HasRange (FieldAssignment' a) where
  getRange :: FieldAssignment' a -> Range
getRange (FieldAssignment Name
a a
b) = Name -> a -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Name
a a
b

instance HasRange ModuleAssignment where
  getRange :: ModuleAssignment -> Range
getRange (ModuleAssignment QName
a [Expr]
b ImportDirective
c) = QName -> [Expr] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange QName
a [Expr]
b Range -> ImportDirective -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` ImportDirective
c

instance HasRange Declaration where
  getRange :: Declaration -> Range
getRange (TypeSig ArgInfo
_ TacticAttribute
_ Name
x Expr
t)       = Name -> Expr -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Name
x Expr
t
  getRange (FieldSig IsInstance
_ TacticAttribute
_ Name
x Arg Expr
t)      = Name -> Arg Expr -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Name
x Arg Expr
t
  getRange (Field Range
r [Declaration]
_)             = Range
r
  getRange (FunClause LHS
lhs RHS
rhs WhereClause
wh Bool
_) = LHS -> RHS -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange LHS
lhs RHS
rhs Range -> WhereClause -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` WhereClause
wh
  getRange (DataSig Range
r Name
_ [LamBinding]
_ Expr
_)       = Range
r
  getRange (Data Range
r Name
_ [LamBinding]
_ Expr
_ [Declaration]
_)        = Range
r
  getRange (DataDef Range
r Name
_ [LamBinding]
_ [Declaration]
_)       = Range
r
  getRange (RecordSig Range
r Name
_ [LamBinding]
_ Expr
_)     = Range
r
  getRange (RecordDef Range
r Name
_ Maybe (Ranged Induction)
_ Maybe HasEta
_ Maybe (Name, IsInstance)
_ [LamBinding]
_ [Declaration]
_) = Range
r
  getRange (Record Range
r Name
_ Maybe (Ranged Induction)
_ Maybe HasEta
_ Maybe (Name, IsInstance)
_ [LamBinding]
_ Expr
_ [Declaration]
_)  = Range
r
  getRange (Mutual Range
r [Declaration]
_)            = Range
r
  getRange (Abstract Range
r [Declaration]
_)          = Range
r
  getRange (Generalize Range
r [Declaration]
_)        = Range
r
  getRange (Open Range
r QName
_ ImportDirective
_)            = Range
r
  getRange (ModuleMacro Range
r Name
_ ModuleApplication
_ OpenShortHand
_ ImportDirective
_) = Range
r
  getRange (Import Range
r QName
_ Maybe AsName
_ OpenShortHand
_ ImportDirective
_)      = Range
r
  getRange (InstanceB Range
r [Declaration]
_)         = Range
r
  getRange (Macro Range
r [Declaration]
_)             = Range
r
  getRange (Private Range
r Origin
_ [Declaration]
_)         = Range
r
  getRange (Postulate Range
r [Declaration]
_)         = Range
r
  getRange (Primitive Range
r [Declaration]
_)         = Range
r
  getRange (Module Range
r QName
_ Telescope
_ [Declaration]
_)        = Range
r
  getRange (Infix Fixity
f [Name]
_)             = Fixity -> Range
forall t. HasRange t => t -> Range
getRange Fixity
f
  getRange (Syntax Name
n Notation
_)            = Name -> Range
forall t. HasRange t => t -> Range
getRange Name
n
  getRange (PatternSyn Range
r Name
_ [Arg Name]
_ Pattern
_)    = Range
r
  getRange (UnquoteDecl Range
r [Name]
_ Expr
_)     = Range
r
  getRange (UnquoteDef Range
r [Name]
_ Expr
_)      = Range
r
  getRange (Pragma Pragma
p)              = Pragma -> Range
forall t. HasRange t => t -> Range
getRange Pragma
p

instance HasRange LHS where
  getRange :: LHS -> Range
getRange (LHS Pattern
p [RewriteEqn]
eqns [WithHiding Expr]
ws ExpandedEllipsis
ell) = Pattern
p Pattern -> [RewriteEqn] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [RewriteEqn]
eqns Range -> [WithHiding Expr] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [WithHiding Expr]
ws

instance HasRange LHSCore where
  getRange :: LHSCore -> Range
getRange (LHSHead QName
f [NamedArg Pattern]
ps)              = QName -> [NamedArg Pattern] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange QName
f [NamedArg Pattern]
ps
  getRange (LHSProj QName
d [NamedArg Pattern]
ps1 NamedArg LHSCore
lhscore [NamedArg Pattern]
ps2) = QName
d QName -> [NamedArg Pattern] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [NamedArg Pattern]
ps1 Range -> NamedArg LHSCore -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` NamedArg LHSCore
lhscore Range -> [NamedArg Pattern] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [NamedArg Pattern]
ps2
  getRange (LHSWith LHSCore
f [Pattern]
wps [NamedArg Pattern]
ps)          = LHSCore
f LHSCore -> [Pattern] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [Pattern]
wps Range -> [NamedArg Pattern] -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
`fuseRange` [NamedArg Pattern]
ps

instance HasRange RHS where
  getRange :: RHS -> Range
getRange RHS
AbsurdRHS = Range
forall a. Range' a
noRange
  getRange (RHS Expr
e)   = Expr -> Range
forall t. HasRange t => t -> Range
getRange Expr
e

instance HasRange LamClause where
  getRange :: LamClause -> Range
getRange (LamClause LHS
lhs RHS
rhs WhereClause
wh Bool
_) = (LHS, RHS, WhereClause) -> Range
forall t. HasRange t => t -> Range
getRange (LHS
lhs, RHS
rhs, WhereClause
wh)

instance HasRange DoStmt where
  getRange :: DoStmt -> Range
getRange (DoBind Range
r Pattern
_ Expr
_ [LamClause]
_) = Range
r
  getRange (DoThen Expr
e)       = Expr -> Range
forall t. HasRange t => t -> Range
getRange Expr
e
  getRange (DoLet Range
r [Declaration]
_)      = Range
r

instance HasRange Pragma where
  getRange :: Pragma -> Range
getRange (OptionsPragma Range
r [String]
_)               = Range
r
  getRange (BuiltinPragma Range
r RString
_ QName
_)             = Range
r
  getRange (RewritePragma Range
r Range
_ [QName]
_)             = Range
r
  getRange (CompilePragma Range
r RString
_ QName
_ String
_)           = Range
r
  getRange (ForeignPragma Range
r RString
_ String
_)             = Range
r
  getRange (StaticPragma Range
r QName
_)                = Range
r
  getRange (InjectivePragma Range
r QName
_)             = Range
r
  getRange (InlinePragma Range
r Bool
_ QName
_)              = Range
r
  getRange (ImpossiblePragma Range
r)              = Range
r
  getRange (EtaPragma Range
r QName
_)                   = Range
r
  getRange (TerminationCheckPragma Range
r TerminationCheck Name
_)      = Range
r
  getRange (NoCoverageCheckPragma Range
r)         = Range
r
  getRange (WarningOnUsage Range
r QName
_ String
_)            = Range
r
  getRange (WarningOnImport Range
r String
_)             = Range
r
  getRange (CatchallPragma Range
r)                = Range
r
  getRange (DisplayPragma Range
r Pattern
_ Expr
_)             = Range
r
  getRange (NoPositivityCheckPragma Range
r)       = Range
r
  getRange (PolarityPragma Range
r Name
_ [Occurrence]
_)            = Range
r
  getRange (NoUniverseCheckPragma Range
r)         = Range
r

instance HasRange AsName where
  getRange :: AsName -> Range
getRange AsName
a = (Range, Either Expr Name) -> Range
forall t. HasRange t => t -> Range
getRange (AsName -> Range
forall a. AsName' a -> Range
asRange AsName
a, AsName -> Either Expr Name
forall a. AsName' a -> a
asName AsName
a)

instance HasRange Pattern where
  getRange :: Pattern -> Range
getRange (IdentP QName
x)         = QName -> Range
forall t. HasRange t => t -> Range
getRange QName
x
  getRange (AppP Pattern
p NamedArg Pattern
q)         = Pattern -> NamedArg Pattern -> Range
forall u t. (HasRange u, HasRange t) => u -> t -> Range
fuseRange Pattern
p NamedArg Pattern
q
  getRange (OpAppP Range
r QName
_ Set Name
_ [NamedArg Pattern]
_)   = Range
r
  getRange (RawAppP Range
r [Pattern]
_)      = Range
r
  getRange (ParenP Range
r Pattern
_)       = Range
r
  getRange (WildP Range
r)          = Range
r
  getRange (AsP Range
r Name
_ Pattern
_)        = Range
r
  getRange (AbsurdP Range
r)        = Range
r
  getRange (LitP Literal
l)           = Literal -> Range
forall t. HasRange t => t -> Range
getRange Literal
l
  getRange (QuoteP Range
r)         = Range
r
  getRange (HiddenP Range
r Named NamedName Pattern
_)      = Range
r
  getRange (InstanceP Range
r Named NamedName Pattern
_)    = Range
r
  getRange (DotP Range
r Expr
_)         = Range
r
  getRange (RecP Range
r [FieldAssignment' Pattern]
_)         = Range
r
  getRange (EqualP Range
r [(Expr, Expr)]
_)       = Range
r
  getRange (EllipsisP Range
r)      = Range
r
  getRange (WithP Range
r Pattern
_)        = Range
r

-- SetRange instances
------------------------------------------------------------------------

instance SetRange Pattern where
  setRange :: Range -> Pattern -> Pattern
setRange Range
r (IdentP QName
x)         = QName -> Pattern
IdentP (Range -> QName -> QName
forall t. SetRange t => Range -> t -> t
setRange Range
r QName
x)
  setRange Range
r (AppP Pattern
p NamedArg Pattern
q)         = Pattern -> NamedArg Pattern -> Pattern
AppP (Range -> Pattern -> Pattern
forall t. SetRange t => Range -> t -> t
setRange Range
r Pattern
p) (Range -> NamedArg Pattern -> NamedArg Pattern
forall t. SetRange t => Range -> t -> t
setRange Range
r NamedArg Pattern
q)
  setRange Range
r (OpAppP Range
_ QName
x Set Name
ns [NamedArg Pattern]
ps) = Range -> QName -> Set Name -> [NamedArg Pattern] -> Pattern
OpAppP Range
r QName
x Set Name
ns [NamedArg Pattern]
ps
  setRange Range
r (RawAppP Range
_ [Pattern]
ps)     = Range -> [Pattern] -> Pattern
RawAppP Range
r [Pattern]
ps
  setRange Range
r (ParenP Range
_ Pattern
p)       = Range -> Pattern -> Pattern
ParenP Range
r Pattern
p
  setRange Range
r (WildP Range
_)          = Range -> Pattern
WildP Range
r
  setRange Range
r (AsP Range
_ Name
x Pattern
p)        = Range -> Name -> Pattern -> Pattern
AsP Range
r (Range -> Name -> Name
forall t. SetRange t => Range -> t -> t
setRange Range
r Name
x) Pattern
p
  setRange Range
r (AbsurdP Range
_)        = Range -> Pattern
AbsurdP Range
r
  setRange Range
r (LitP Literal
l)           = Literal -> Pattern
LitP (Range -> Literal -> Literal
forall t. SetRange t => Range -> t -> t
setRange Range
r Literal
l)
  setRange Range
r (QuoteP Range
_)         = Range -> Pattern
QuoteP Range
r
  setRange Range
r (HiddenP Range
_ Named NamedName Pattern
p)      = Range -> Named NamedName Pattern -> Pattern
HiddenP Range
r Named NamedName Pattern
p
  setRange Range
r (InstanceP Range
_ Named NamedName Pattern
p)    = Range -> Named NamedName Pattern -> Pattern
InstanceP Range
r Named NamedName Pattern
p
  setRange Range
r (DotP Range
_ Expr
e)         = Range -> Expr -> Pattern
DotP Range
r Expr
e
  setRange Range
r (RecP Range
_ [FieldAssignment' Pattern]
fs)        = Range -> [FieldAssignment' Pattern] -> Pattern
RecP Range
r [FieldAssignment' Pattern]
fs
  setRange Range
r (EqualP Range
_ [(Expr, Expr)]
es)      = Range -> [(Expr, Expr)] -> Pattern
EqualP Range
r [(Expr, Expr)]
es
  setRange Range
r (EllipsisP Range
_)      = Range -> Pattern
EllipsisP Range
r
  setRange Range
r (WithP Range
_ Pattern
p)        = Range -> Pattern -> Pattern
WithP Range
r Pattern
p

instance SetRange TypedBinding where
  setRange :: Range -> TypedBinding -> TypedBinding
setRange Range
r (TBind Range
_ [NamedArg Binder]
xs Expr
e) = Range -> [NamedArg Binder] -> Expr -> TypedBinding
forall e. Range -> [NamedArg Binder] -> e -> TypedBinding' e
TBind Range
r [NamedArg Binder]
xs Expr
e
  setRange Range
r (TLet Range
_ [Declaration]
ds)    = Range -> [Declaration] -> TypedBinding
forall e. Range -> [Declaration] -> TypedBinding' e
TLet Range
r [Declaration]
ds

-- KillRange instances
------------------------------------------------------------------------

instance KillRange a => KillRange (FieldAssignment' a) where
  killRange :: KillRangeT (FieldAssignment' a)
killRange (FieldAssignment Name
a a
b) = (Name -> a -> FieldAssignment' a)
-> Name -> a -> FieldAssignment' a
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Name -> a -> FieldAssignment' a
forall a. Name -> a -> FieldAssignment' a
FieldAssignment Name
a a
b

instance KillRange ModuleAssignment where
  killRange :: ModuleAssignment -> ModuleAssignment
killRange (ModuleAssignment QName
a [Expr]
b ImportDirective
c) = (QName -> [Expr] -> ImportDirective -> ModuleAssignment)
-> QName -> [Expr] -> ImportDirective -> ModuleAssignment
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 QName -> [Expr] -> ImportDirective -> ModuleAssignment
ModuleAssignment QName
a [Expr]
b ImportDirective
c

instance KillRange AsName where
  killRange :: KillRangeT AsName
killRange (AsName Either Expr Name
n Range
_) = (Either Expr Name -> AsName) -> Either Expr Name -> AsName
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 ((Either Expr Name -> Range -> AsName)
-> Range -> Either Expr Name -> AsName
forall a b c. (a -> b -> c) -> b -> a -> c
flip Either Expr Name -> Range -> AsName
forall a. a -> Range -> AsName' a
AsName Range
forall a. Range' a
noRange) Either Expr Name
n

instance KillRange Binder where
  killRange :: KillRangeT Binder
killRange (Binder Maybe Pattern
a BoundName
b) = (Maybe Pattern -> BoundName -> Binder)
-> Maybe Pattern -> BoundName -> Binder
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Maybe Pattern -> BoundName -> Binder
forall a. Maybe Pattern -> a -> Binder' a
Binder Maybe Pattern
a BoundName
b

instance KillRange BoundName where
  killRange :: BoundName -> BoundName
killRange (BName Name
n Fixity'
f TacticAttribute
t) = (Name -> Fixity' -> TacticAttribute -> BoundName)
-> Name -> Fixity' -> TacticAttribute -> BoundName
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 Name -> Fixity' -> TacticAttribute -> BoundName
BName Name
n Fixity'
f TacticAttribute
t

instance KillRange Declaration where
  killRange :: Declaration -> Declaration
killRange (TypeSig ArgInfo
i TacticAttribute
t Name
n Expr
e)       = (TacticAttribute -> Name -> Expr -> Declaration)
-> TacticAttribute -> Name -> Expr -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (ArgInfo -> TacticAttribute -> Name -> Expr -> Declaration
TypeSig ArgInfo
i) TacticAttribute
t Name
n Expr
e
  killRange (FieldSig IsInstance
i TacticAttribute
t Name
n Arg Expr
e)      = (IsInstance -> TacticAttribute -> Name -> Arg Expr -> Declaration)
-> IsInstance -> TacticAttribute -> Name -> Arg Expr -> Declaration
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 IsInstance -> TacticAttribute -> Name -> Arg Expr -> Declaration
FieldSig IsInstance
i TacticAttribute
t Name
n Arg Expr
e
  killRange (Generalize Range
r [Declaration]
ds )      = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Generalize Range
forall a. Range' a
noRange) [Declaration]
ds
  killRange (Field Range
r [Declaration]
fs)            = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Field Range
forall a. Range' a
noRange) [Declaration]
fs
  killRange (FunClause LHS
l RHS
r WhereClause
w Bool
ca)    = (LHS -> RHS -> WhereClause -> Bool -> Declaration)
-> LHS -> RHS -> WhereClause -> Bool -> Declaration
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 LHS -> RHS -> WhereClause -> Bool -> Declaration
FunClause LHS
l RHS
r WhereClause
w Bool
ca
  killRange (DataSig Range
_ Name
n [LamBinding]
l Expr
e)       = (Name -> [LamBinding] -> Expr -> Declaration)
-> Name -> [LamBinding] -> Expr -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> Name -> [LamBinding] -> Expr -> Declaration
DataSig Range
forall a. Range' a
noRange) Name
n [LamBinding]
l Expr
e
  killRange (Data Range
_ Name
n [LamBinding]
l Expr
e [Declaration]
c)        = (Name -> [LamBinding] -> Expr -> [Declaration] -> Declaration)
-> Name -> [LamBinding] -> Expr -> [Declaration] -> Declaration
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 (Range
-> Name -> [LamBinding] -> Expr -> [Declaration] -> Declaration
Data Range
forall a. Range' a
noRange) Name
n [LamBinding]
l Expr
e [Declaration]
c
  killRange (DataDef Range
_ Name
n [LamBinding]
l [Declaration]
c)       = (Name -> [LamBinding] -> [Declaration] -> Declaration)
-> Name -> [LamBinding] -> [Declaration] -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> Name -> [LamBinding] -> [Declaration] -> Declaration
DataDef Range
forall a. Range' a
noRange) Name
n [LamBinding]
l [Declaration]
c
  killRange (RecordSig Range
_ Name
n [LamBinding]
l Expr
e)     = (Name -> [LamBinding] -> Expr -> Declaration)
-> Name -> [LamBinding] -> Expr -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> Name -> [LamBinding] -> Expr -> Declaration
RecordSig Range
forall a. Range' a
noRange) Name
n [LamBinding]
l Expr
e
  killRange (RecordDef Range
_ Name
n Maybe (Ranged Induction)
mi Maybe HasEta
mb Maybe (Name, IsInstance)
mn [LamBinding]
k [Declaration]
d) = (Name
 -> Maybe (Ranged Induction)
 -> Maybe HasEta
 -> Maybe (Name, IsInstance)
 -> [LamBinding]
 -> [Declaration]
 -> Declaration)
-> Name
-> Maybe (Ranged Induction)
-> Maybe HasEta
-> Maybe (Name, IsInstance)
-> [LamBinding]
-> [Declaration]
-> Declaration
forall a b c d e f g.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
 KillRange f) =>
(a -> b -> c -> d -> e -> f -> g)
-> a -> b -> c -> d -> e -> f -> g
killRange6 (Range
-> Name
-> Maybe (Ranged Induction)
-> Maybe HasEta
-> Maybe (Name, IsInstance)
-> [LamBinding]
-> [Declaration]
-> Declaration
RecordDef Range
forall a. Range' a
noRange) Name
n Maybe (Ranged Induction)
mi Maybe HasEta
mb Maybe (Name, IsInstance)
mn [LamBinding]
k [Declaration]
d
  killRange (Record Range
_ Name
n Maybe (Ranged Induction)
mi Maybe HasEta
mb Maybe (Name, IsInstance)
mn [LamBinding]
k Expr
e [Declaration]
d)  = (Name
 -> Maybe (Ranged Induction)
 -> Maybe HasEta
 -> Maybe (Name, IsInstance)
 -> [LamBinding]
 -> Expr
 -> [Declaration]
 -> Declaration)
-> Name
-> Maybe (Ranged Induction)
-> Maybe HasEta
-> Maybe (Name, IsInstance)
-> [LamBinding]
-> Expr
-> [Declaration]
-> Declaration
forall a b c d e f g h.
(KillRange a, KillRange b, KillRange c, KillRange d, KillRange e,
 KillRange f, KillRange g) =>
(a -> b -> c -> d -> e -> f -> g -> h)
-> a -> b -> c -> d -> e -> f -> g -> h
killRange7 (Range
-> Name
-> Maybe (Ranged Induction)
-> Maybe HasEta
-> Maybe (Name, IsInstance)
-> [LamBinding]
-> Expr
-> [Declaration]
-> Declaration
Record Range
forall a. Range' a
noRange) Name
n Maybe (Ranged Induction)
mi Maybe HasEta
mb Maybe (Name, IsInstance)
mn [LamBinding]
k Expr
e [Declaration]
d
  killRange (Infix Fixity
f [Name]
n)             = (Fixity -> [Name] -> Declaration)
-> Fixity -> [Name] -> Declaration
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Fixity -> [Name] -> Declaration
Infix Fixity
f [Name]
n
  killRange (Syntax Name
n Notation
no)           = (Name -> Declaration) -> Name -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (\Name
n -> Name -> Notation -> Declaration
Syntax Name
n Notation
no) Name
n
  killRange (PatternSyn Range
_ Name
n [Arg Name]
ns Pattern
p)   = (Name -> [Arg Name] -> Pattern -> Declaration)
-> Name -> [Arg Name] -> Pattern -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> Name -> [Arg Name] -> Pattern -> Declaration
PatternSyn Range
forall a. Range' a
noRange) Name
n [Arg Name]
ns Pattern
p
  killRange (Mutual Range
_ [Declaration]
d)            = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Mutual Range
forall a. Range' a
noRange) [Declaration]
d
  killRange (Abstract Range
_ [Declaration]
d)          = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Abstract Range
forall a. Range' a
noRange) [Declaration]
d
  killRange (Private Range
_ Origin
o [Declaration]
d)         = (Origin -> [Declaration] -> Declaration)
-> Origin -> [Declaration] -> Declaration
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Origin -> [Declaration] -> Declaration
Private Range
forall a. Range' a
noRange) Origin
o [Declaration]
d
  killRange (InstanceB Range
_ [Declaration]
d)         = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
InstanceB Range
forall a. Range' a
noRange) [Declaration]
d
  killRange (Macro Range
_ [Declaration]
d)             = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Macro Range
forall a. Range' a
noRange) [Declaration]
d
  killRange (Postulate Range
_ [Declaration]
t)         = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Postulate Range
forall a. Range' a
noRange) [Declaration]
t
  killRange (Primitive Range
_ [Declaration]
t)         = ([Declaration] -> Declaration) -> [Declaration] -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Declaration] -> Declaration
Primitive Range
forall a. Range' a
noRange) [Declaration]
t
  killRange (Open Range
_ QName
q ImportDirective
i)            = (QName -> ImportDirective -> Declaration)
-> QName -> ImportDirective -> Declaration
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> QName -> ImportDirective -> Declaration
Open Range
forall a. Range' a
noRange) QName
q ImportDirective
i
  killRange (Import Range
_ QName
q Maybe AsName
a OpenShortHand
o ImportDirective
i)      = (QName -> Maybe AsName -> ImportDirective -> Declaration)
-> QName -> Maybe AsName -> ImportDirective -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (\QName
q Maybe AsName
a -> Range
-> QName
-> Maybe AsName
-> OpenShortHand
-> ImportDirective
-> Declaration
Import Range
forall a. Range' a
noRange QName
q Maybe AsName
a OpenShortHand
o) QName
q Maybe AsName
a ImportDirective
i
  killRange (ModuleMacro Range
_ Name
n ModuleApplication
m OpenShortHand
o ImportDirective
i) = (Name -> ModuleApplication -> ImportDirective -> Declaration)
-> Name -> ModuleApplication -> ImportDirective -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (\Name
n ModuleApplication
m -> Range
-> Name
-> ModuleApplication
-> OpenShortHand
-> ImportDirective
-> Declaration
ModuleMacro Range
forall a. Range' a
noRange Name
n ModuleApplication
m OpenShortHand
o) Name
n ModuleApplication
m ImportDirective
i
  killRange (Module Range
_ QName
q Telescope
t [Declaration]
d)        = (QName -> Telescope -> [Declaration] -> Declaration)
-> QName -> Telescope -> [Declaration] -> Declaration
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> QName -> Telescope -> [Declaration] -> Declaration
Module Range
forall a. Range' a
noRange) QName
q Telescope
t [Declaration]
d
  killRange (UnquoteDecl Range
_ [Name]
x Expr
t)     = ([Name] -> Expr -> Declaration) -> [Name] -> Expr -> Declaration
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [Name] -> Expr -> Declaration
UnquoteDecl Range
forall a. Range' a
noRange) [Name]
x Expr
t
  killRange (UnquoteDef Range
_ [Name]
x Expr
t)      = ([Name] -> Expr -> Declaration) -> [Name] -> Expr -> Declaration
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [Name] -> Expr -> Declaration
UnquoteDef Range
forall a. Range' a
noRange) [Name]
x Expr
t
  killRange (Pragma Pragma
p)              = (Pragma -> Declaration) -> Pragma -> Declaration
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Pragma -> Declaration
Pragma Pragma
p

instance KillRange Expr where
  killRange :: Expr -> Expr
killRange (Ident QName
q)            = (QName -> Expr) -> QName -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 QName -> Expr
Ident QName
q
  killRange (Lit Literal
l)              = (Literal -> Expr) -> Literal -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Literal -> Expr
Lit Literal
l
  killRange (QuestionMark Range
_ Maybe Int
n)   = Range -> Maybe Int -> Expr
QuestionMark Range
forall a. Range' a
noRange Maybe Int
n
  killRange (Underscore Range
_ Maybe String
n)     = Range -> Maybe String -> Expr
Underscore Range
forall a. Range' a
noRange Maybe String
n
  killRange (RawApp Range
_ [Expr]
e)         = ([Expr] -> Expr) -> [Expr] -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Expr] -> Expr
RawApp Range
forall a. Range' a
noRange) [Expr]
e
  killRange (App Range
_ Expr
e NamedArg Expr
a)          = (Expr -> NamedArg Expr -> Expr) -> Expr -> NamedArg Expr -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Expr -> NamedArg Expr -> Expr
App Range
forall a. Range' a
noRange) Expr
e NamedArg Expr
a
  killRange (OpApp Range
_ QName
n Set Name
ns [NamedArg (MaybePlaceholder (OpApp Expr))]
o)     = (QName
 -> Set Name -> [NamedArg (MaybePlaceholder (OpApp Expr))] -> Expr)
-> QName
-> Set Name
-> [NamedArg (MaybePlaceholder (OpApp Expr))]
-> Expr
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range
-> QName
-> Set Name
-> [NamedArg (MaybePlaceholder (OpApp Expr))]
-> Expr
OpApp Range
forall a. Range' a
noRange) QName
n Set Name
ns [NamedArg (MaybePlaceholder (OpApp Expr))]
o
  killRange (WithApp Range
_ Expr
e [Expr]
es)     = (Expr -> [Expr] -> Expr) -> Expr -> [Expr] -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Expr -> [Expr] -> Expr
WithApp Range
forall a. Range' a
noRange) Expr
e [Expr]
es
  killRange (HiddenArg Range
_ Named_ Expr
n)      = (Named_ Expr -> Expr) -> Named_ Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Named_ Expr -> Expr
HiddenArg Range
forall a. Range' a
noRange) Named_ Expr
n
  killRange (InstanceArg Range
_ Named_ Expr
n)    = (Named_ Expr -> Expr) -> Named_ Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Named_ Expr -> Expr
InstanceArg Range
forall a. Range' a
noRange) Named_ Expr
n
  killRange (Lam Range
_ [LamBinding]
l Expr
e)          = ([LamBinding] -> Expr -> Expr) -> [LamBinding] -> Expr -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [LamBinding] -> Expr -> Expr
Lam Range
forall a. Range' a
noRange) [LamBinding]
l Expr
e
  killRange (AbsurdLam Range
_ Hiding
h)      = (Hiding -> Expr) -> Hiding -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Hiding -> Expr
AbsurdLam Range
forall a. Range' a
noRange) Hiding
h
  killRange (ExtendedLam Range
_ [LamClause]
lrw)  = ([LamClause] -> Expr) -> [LamClause] -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [LamClause] -> Expr
ExtendedLam Range
forall a. Range' a
noRange) [LamClause]
lrw
  killRange (Fun Range
_ Arg Expr
e1 Expr
e2)        = (Arg Expr -> Expr -> Expr) -> Arg Expr -> Expr -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Arg Expr -> Expr -> Expr
Fun Range
forall a. Range' a
noRange) Arg Expr
e1 Expr
e2
  killRange (Pi Telescope
t Expr
e)             = (Telescope -> Expr -> Expr) -> Telescope -> Expr -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Telescope -> Expr -> Expr
Pi Telescope
t Expr
e
  killRange (Set Range
_)              = Range -> Expr
Set Range
forall a. Range' a
noRange
  killRange (Prop Range
_)             = Range -> Expr
Prop Range
forall a. Range' a
noRange
  killRange (SetN Range
_ Integer
n)           = Range -> Integer -> Expr
SetN Range
forall a. Range' a
noRange Integer
n
  killRange (PropN Range
_ Integer
n)          = Range -> Integer -> Expr
PropN Range
forall a. Range' a
noRange Integer
n
  killRange (Rec Range
_ RecordAssignments
ne)           = (RecordAssignments -> Expr) -> RecordAssignments -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> RecordAssignments -> Expr
Rec Range
forall a. Range' a
noRange) RecordAssignments
ne
  killRange (RecUpdate Range
_ Expr
e [FieldAssignment]
ne)   = (Expr -> [FieldAssignment] -> Expr)
-> Expr -> [FieldAssignment] -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Expr -> [FieldAssignment] -> Expr
RecUpdate Range
forall a. Range' a
noRange) Expr
e [FieldAssignment]
ne
  killRange (Let Range
_ [Declaration]
d TacticAttribute
e)          = ([Declaration] -> TacticAttribute -> Expr)
-> [Declaration] -> TacticAttribute -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [Declaration] -> TacticAttribute -> Expr
Let Range
forall a. Range' a
noRange) [Declaration]
d TacticAttribute
e
  killRange (Paren Range
_ Expr
e)          = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Expr -> Expr
Paren Range
forall a. Range' a
noRange) Expr
e
  killRange (IdiomBrackets Range
_ [Expr]
es) = ([Expr] -> Expr) -> [Expr] -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Expr] -> Expr
IdiomBrackets Range
forall a. Range' a
noRange) [Expr]
es
  killRange (DoBlock Range
_ [DoStmt]
ss)       = ([DoStmt] -> Expr) -> [DoStmt] -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [DoStmt] -> Expr
DoBlock Range
forall a. Range' a
noRange) [DoStmt]
ss
  killRange (Absurd Range
_)           = Range -> Expr
Absurd Range
forall a. Range' a
noRange
  killRange (As Range
_ Name
n Expr
e)           = (Name -> Expr -> Expr) -> Name -> Expr -> Expr
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Name -> Expr -> Expr
As Range
forall a. Range' a
noRange) Name
n Expr
e
  killRange (Dot Range
_ Expr
e)            = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Expr -> Expr
Dot Range
forall a. Range' a
noRange) Expr
e
  killRange (DoubleDot Range
_ Expr
e)      = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Expr -> Expr
DoubleDot Range
forall a. Range' a
noRange) Expr
e
  killRange (ETel Telescope
t)             = (Telescope -> Expr) -> Telescope -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Telescope -> Expr
ETel Telescope
t
  killRange (Quote Range
_)            = Range -> Expr
Quote Range
forall a. Range' a
noRange
  killRange (QuoteTerm Range
_)        = Range -> Expr
QuoteTerm Range
forall a. Range' a
noRange
  killRange (Unquote Range
_)          = Range -> Expr
Unquote Range
forall a. Range' a
noRange
  killRange (Tactic Range
_ Expr
t)         = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Expr -> Expr
Tactic Range
forall a. Range' a
noRange) Expr
t
  killRange (DontCare Expr
e)         = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Expr -> Expr
DontCare Expr
e
  killRange (Equal Range
_ Expr
x Expr
y)        = Range -> Expr -> Expr -> Expr
Equal Range
forall a. Range' a
noRange Expr
x Expr
y
  killRange (Ellipsis Range
_)         = Range -> Expr
Ellipsis Range
forall a. Range' a
noRange
  killRange (Generalized Expr
e)      = (Expr -> Expr) -> Expr -> Expr
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Expr -> Expr
Generalized Expr
e

instance KillRange LamBinding where
  killRange :: LamBinding -> LamBinding
killRange (DomainFree NamedArg Binder
b) = (NamedArg Binder -> LamBinding) -> NamedArg Binder -> LamBinding
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 NamedArg Binder -> LamBinding
forall a. NamedArg Binder -> LamBinding' a
DomainFree NamedArg Binder
b
  killRange (DomainFull TypedBinding
t) = (TypedBinding -> LamBinding) -> TypedBinding -> LamBinding
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 TypedBinding -> LamBinding
forall a. a -> LamBinding' a
DomainFull TypedBinding
t

instance KillRange LHS where
  killRange :: LHS -> LHS
killRange (LHS Pattern
p [RewriteEqn]
r [WithHiding Expr]
w ExpandedEllipsis
e)  = (Pattern
 -> [RewriteEqn] -> [WithHiding Expr] -> ExpandedEllipsis -> LHS)
-> Pattern
-> [RewriteEqn]
-> [WithHiding Expr]
-> ExpandedEllipsis
-> LHS
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 Pattern
-> [RewriteEqn] -> [WithHiding Expr] -> ExpandedEllipsis -> LHS
LHS Pattern
p [RewriteEqn]
r [WithHiding Expr]
w ExpandedEllipsis
e

instance KillRange LamClause where
  killRange :: LamClause -> LamClause
killRange (LamClause LHS
a RHS
b WhereClause
c Bool
d) = (LHS -> RHS -> WhereClause -> Bool -> LamClause)
-> LHS -> RHS -> WhereClause -> Bool -> LamClause
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 LHS -> RHS -> WhereClause -> Bool -> LamClause
LamClause LHS
a RHS
b WhereClause
c Bool
d

instance KillRange DoStmt where
  killRange :: DoStmt -> DoStmt
killRange (DoBind Range
r Pattern
p Expr
e [LamClause]
w) = (Range -> Pattern -> Expr -> [LamClause] -> DoStmt)
-> Range -> Pattern -> Expr -> [LamClause] -> DoStmt
forall a b c d e.
(KillRange a, KillRange b, KillRange c, KillRange d) =>
(a -> b -> c -> d -> e) -> a -> b -> c -> d -> e
killRange4 Range -> Pattern -> Expr -> [LamClause] -> DoStmt
DoBind Range
r Pattern
p Expr
e [LamClause]
w
  killRange (DoThen Expr
e)       = (Expr -> DoStmt) -> Expr -> DoStmt
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Expr -> DoStmt
DoThen Expr
e
  killRange (DoLet Range
r [Declaration]
ds)     = (Range -> [Declaration] -> DoStmt)
-> Range -> [Declaration] -> DoStmt
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Range -> [Declaration] -> DoStmt
DoLet Range
r [Declaration]
ds

instance KillRange ModuleApplication where
  killRange :: ModuleApplication -> ModuleApplication
killRange (SectionApp Range
_ Telescope
t Expr
e)    = (Telescope -> Expr -> ModuleApplication)
-> Telescope -> Expr -> ModuleApplication
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Telescope -> Expr -> ModuleApplication
SectionApp Range
forall a. Range' a
noRange) Telescope
t Expr
e
  killRange (RecordModuleInstance Range
_ QName
q) = (QName -> ModuleApplication) -> QName -> ModuleApplication
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> QName -> ModuleApplication
RecordModuleInstance Range
forall a. Range' a
noRange) QName
q

instance KillRange e => KillRange (OpApp e) where
  killRange :: KillRangeT (OpApp e)
killRange (SyntaxBindingLambda Range
_ [LamBinding]
l e
e) = ([LamBinding] -> e -> OpApp e) -> [LamBinding] -> e -> OpApp e
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [LamBinding] -> e -> OpApp e
forall e. Range -> [LamBinding] -> e -> OpApp e
SyntaxBindingLambda Range
forall a. Range' a
noRange) [LamBinding]
l e
e
  killRange (Ordinary e
e)                = (e -> OpApp e) -> e -> OpApp e
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 e -> OpApp e
forall e. e -> OpApp e
Ordinary e
e

instance KillRange Pattern where
  killRange :: Pattern -> Pattern
killRange (IdentP QName
q)        = (QName -> Pattern) -> QName -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 QName -> Pattern
IdentP QName
q
  killRange (AppP Pattern
p NamedArg Pattern
ps)       = (Pattern -> NamedArg Pattern -> Pattern)
-> Pattern -> NamedArg Pattern -> Pattern
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Pattern -> NamedArg Pattern -> Pattern
AppP Pattern
p NamedArg Pattern
ps
  killRange (RawAppP Range
_ [Pattern]
p)     = ([Pattern] -> Pattern) -> [Pattern] -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [Pattern] -> Pattern
RawAppP Range
forall a. Range' a
noRange) [Pattern]
p
  killRange (OpAppP Range
_ QName
n Set Name
ns [NamedArg Pattern]
p) = (QName -> Set Name -> [NamedArg Pattern] -> Pattern)
-> QName -> Set Name -> [NamedArg Pattern] -> Pattern
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 (Range -> QName -> Set Name -> [NamedArg Pattern] -> Pattern
OpAppP Range
forall a. Range' a
noRange) QName
n Set Name
ns [NamedArg Pattern]
p
  killRange (HiddenP Range
_ Named NamedName Pattern
n)     = (Named NamedName Pattern -> Pattern)
-> Named NamedName Pattern -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Named NamedName Pattern -> Pattern
HiddenP Range
forall a. Range' a
noRange) Named NamedName Pattern
n
  killRange (InstanceP Range
_ Named NamedName Pattern
n)   = (Named NamedName Pattern -> Pattern)
-> Named NamedName Pattern -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Named NamedName Pattern -> Pattern
InstanceP Range
forall a. Range' a
noRange) Named NamedName Pattern
n
  killRange (ParenP Range
_ Pattern
p)      = (Pattern -> Pattern) -> Pattern -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Pattern -> Pattern
ParenP Range
forall a. Range' a
noRange) Pattern
p
  killRange (WildP Range
_)         = Range -> Pattern
WildP Range
forall a. Range' a
noRange
  killRange (AbsurdP Range
_)       = Range -> Pattern
AbsurdP Range
forall a. Range' a
noRange
  killRange (AsP Range
_ Name
n Pattern
p)       = (Name -> Pattern -> Pattern) -> Name -> Pattern -> Pattern
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Name -> Pattern -> Pattern
AsP Range
forall a. Range' a
noRange) Name
n Pattern
p
  killRange (DotP Range
_ Expr
e)        = (Expr -> Pattern) -> Expr -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Expr -> Pattern
DotP Range
forall a. Range' a
noRange) Expr
e
  killRange (LitP Literal
l)          = (Literal -> Pattern) -> Literal -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Literal -> Pattern
LitP Literal
l
  killRange (QuoteP Range
_)        = Range -> Pattern
QuoteP Range
forall a. Range' a
noRange
  killRange (RecP Range
_ [FieldAssignment' Pattern]
fs)       = ([FieldAssignment' Pattern] -> Pattern)
-> [FieldAssignment' Pattern] -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [FieldAssignment' Pattern] -> Pattern
RecP Range
forall a. Range' a
noRange) [FieldAssignment' Pattern]
fs
  killRange (EqualP Range
_ [(Expr, Expr)]
es)     = ([(Expr, Expr)] -> Pattern) -> [(Expr, Expr)] -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> [(Expr, Expr)] -> Pattern
EqualP Range
forall a. Range' a
noRange) [(Expr, Expr)]
es
  killRange (EllipsisP Range
_)     = Range -> Pattern
EllipsisP Range
forall a. Range' a
noRange
  killRange (WithP Range
_ Pattern
p)       = (Pattern -> Pattern) -> Pattern -> Pattern
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Pattern -> Pattern
WithP Range
forall a. Range' a
noRange) Pattern
p

instance KillRange Pragma where
  killRange :: Pragma -> Pragma
killRange (OptionsPragma Range
_ [String]
s)               = Range -> [String] -> Pragma
OptionsPragma Range
forall a. Range' a
noRange [String]
s
  killRange (BuiltinPragma Range
_ RString
s QName
e)             = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> RString -> QName -> Pragma
BuiltinPragma Range
forall a. Range' a
noRange RString
s) QName
e
  killRange (RewritePragma Range
_ Range
_ [QName]
qs)            = ([QName] -> Pragma) -> [QName] -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Range -> [QName] -> Pragma
RewritePragma Range
forall a. Range' a
noRange Range
forall a. Range' a
noRange) [QName]
qs
  killRange (StaticPragma Range
_ QName
q)                = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> QName -> Pragma
StaticPragma Range
forall a. Range' a
noRange) QName
q
  killRange (InjectivePragma Range
_ QName
q)             = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> QName -> Pragma
InjectivePragma Range
forall a. Range' a
noRange) QName
q
  killRange (InlinePragma Range
_ Bool
b QName
q)              = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> Bool -> QName -> Pragma
InlinePragma Range
forall a. Range' a
noRange Bool
b) QName
q
  killRange (CompilePragma Range
_ RString
b QName
q String
s)           = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (\ QName
q -> Range -> RString -> QName -> String -> Pragma
CompilePragma Range
forall a. Range' a
noRange RString
b QName
q String
s) QName
q
  killRange (ForeignPragma Range
_ RString
b String
s)             = Range -> RString -> String -> Pragma
ForeignPragma Range
forall a. Range' a
noRange RString
b String
s
  killRange (ImpossiblePragma Range
_)              = Range -> Pragma
ImpossiblePragma Range
forall a. Range' a
noRange
  killRange (TerminationCheckPragma Range
_ TerminationCheck Name
t)      = Range -> TerminationCheck Name -> Pragma
TerminationCheckPragma Range
forall a. Range' a
noRange (KillRangeT (TerminationCheck Name)
forall a. KillRange a => KillRangeT a
killRange TerminationCheck Name
t)
  killRange (NoCoverageCheckPragma Range
_)         = Range -> Pragma
NoCoverageCheckPragma Range
forall a. Range' a
noRange
  killRange (WarningOnUsage Range
_ QName
nm String
str)         = Range -> QName -> String -> Pragma
WarningOnUsage Range
forall a. Range' a
noRange (QName -> QName
forall a. KillRange a => KillRangeT a
killRange QName
nm) String
str
  killRange (WarningOnImport Range
_ String
str)           = Range -> String -> Pragma
WarningOnImport Range
forall a. Range' a
noRange String
str
  killRange (CatchallPragma Range
_)                = Range -> Pragma
CatchallPragma Range
forall a. Range' a
noRange
  killRange (DisplayPragma Range
_ Pattern
lhs Expr
rhs)         = (Pattern -> Expr -> Pragma) -> Pattern -> Expr -> Pragma
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> Pattern -> Expr -> Pragma
DisplayPragma Range
forall a. Range' a
noRange) Pattern
lhs Expr
rhs
  killRange (EtaPragma Range
_ QName
q)                   = (QName -> Pragma) -> QName -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (Range -> QName -> Pragma
EtaPragma Range
forall a. Range' a
noRange) QName
q
  killRange (NoPositivityCheckPragma Range
_)       = Range -> Pragma
NoPositivityCheckPragma Range
forall a. Range' a
noRange
  killRange (PolarityPragma Range
_ Name
q [Occurrence]
occs)         = (Name -> Pragma) -> Name -> Pragma
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 (\Name
q -> Range -> Name -> [Occurrence] -> Pragma
PolarityPragma Range
forall a. Range' a
noRange Name
q [Occurrence]
occs) Name
q
  killRange (NoUniverseCheckPragma Range
_)         = Range -> Pragma
NoUniverseCheckPragma Range
forall a. Range' a
noRange

instance KillRange RHS where
  killRange :: KillRangeT RHS
killRange RHS
AbsurdRHS = RHS
forall e. RHS' e
AbsurdRHS
  killRange (RHS Expr
e)   = (Expr -> RHS) -> Expr -> RHS
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 Expr -> RHS
forall e. e -> RHS' e
RHS Expr
e

instance KillRange TypedBinding where
  killRange :: TypedBinding -> TypedBinding
killRange (TBind Range
_ [NamedArg Binder]
b Expr
e) = ([NamedArg Binder] -> Expr -> TypedBinding)
-> [NamedArg Binder] -> Expr -> TypedBinding
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 (Range -> [NamedArg Binder] -> Expr -> TypedBinding
forall e. Range -> [NamedArg Binder] -> e -> TypedBinding' e
TBind Range
forall a. Range' a
noRange) [NamedArg Binder]
b Expr
e
  killRange (TLet Range
r [Declaration]
ds)   = (Range -> [Declaration] -> TypedBinding)
-> Range -> [Declaration] -> TypedBinding
forall a b c.
(KillRange a, KillRange b) =>
(a -> b -> c) -> a -> b -> c
killRange2 Range -> [Declaration] -> TypedBinding
forall e. Range -> [Declaration] -> TypedBinding' e
TLet Range
r [Declaration]
ds

instance KillRange WhereClause where
  killRange :: KillRangeT WhereClause
killRange WhereClause
NoWhere         = WhereClause
forall a. WhereClause' a
NoWhere
  killRange (AnyWhere [Declaration]
d)    = ([Declaration] -> WhereClause) -> [Declaration] -> WhereClause
forall a b. KillRange a => (a -> b) -> a -> b
killRange1 [Declaration] -> WhereClause
forall decls. decls -> WhereClause' decls
AnyWhere [Declaration]
d
  killRange (SomeWhere Name
n Access
a [Declaration]
d) = (Name -> Access -> [Declaration] -> WhereClause)
-> Name -> Access -> [Declaration] -> WhereClause
forall a b c d.
(KillRange a, KillRange b, KillRange c) =>
(a -> b -> c -> d) -> a -> b -> c -> d
killRange3 Name -> Access -> [Declaration] -> WhereClause
forall decls. Name -> Access -> decls -> WhereClause' decls
SomeWhere Name
n Access
a [Declaration]
d

------------------------------------------------------------------------
-- NFData instances

-- | Ranges are not forced.

instance NFData Expr where
  rnf :: Expr -> ()
rnf (Ident QName
a)          = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (Lit Literal
a)            = Literal -> ()
forall a. NFData a => a -> ()
rnf Literal
a
  rnf (QuestionMark Range
_ Maybe Int
a) = Maybe Int -> ()
forall a. NFData a => a -> ()
rnf Maybe Int
a
  rnf (Underscore Range
_ Maybe String
a)   = Maybe String -> ()
forall a. NFData a => a -> ()
rnf Maybe String
a
  rnf (RawApp Range
_ [Expr]
a)       = [Expr] -> ()
forall a. NFData a => a -> ()
rnf [Expr]
a
  rnf (App Range
_ Expr
a NamedArg Expr
b)        = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a () -> () -> ()
`seq` NamedArg Expr -> ()
forall a. NFData a => a -> ()
rnf NamedArg Expr
b
  rnf (OpApp Range
_ QName
a Set Name
b [NamedArg (MaybePlaceholder (OpApp Expr))]
c)    = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` Set Name -> ()
forall a. NFData a => a -> ()
rnf Set Name
b () -> () -> ()
`seq` [NamedArg (MaybePlaceholder (OpApp Expr))] -> ()
forall a. NFData a => a -> ()
rnf [NamedArg (MaybePlaceholder (OpApp Expr))]
c
  rnf (WithApp Range
_ Expr
a [Expr]
b)    = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a () -> () -> ()
`seq` [Expr] -> ()
forall a. NFData a => a -> ()
rnf [Expr]
b
  rnf (HiddenArg Range
_ Named_ Expr
a)    = Named_ Expr -> ()
forall a. NFData a => a -> ()
rnf Named_ Expr
a
  rnf (InstanceArg Range
_ Named_ Expr
a)  = Named_ Expr -> ()
forall a. NFData a => a -> ()
rnf Named_ Expr
a
  rnf (Lam Range
_ [LamBinding]
a Expr
b)        = [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (AbsurdLam Range
_ Hiding
a)    = Hiding -> ()
forall a. NFData a => a -> ()
rnf Hiding
a
  rnf (ExtendedLam Range
_ [LamClause]
a)  = [LamClause] -> ()
forall a. NFData a => a -> ()
rnf [LamClause]
a
  rnf (Fun Range
_ Arg Expr
a Expr
b)        = Arg Expr -> ()
forall a. NFData a => a -> ()
rnf Arg Expr
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (Pi Telescope
a Expr
b)           = Telescope -> ()
forall a. NFData a => a -> ()
rnf Telescope
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (Set Range
_)            = ()
  rnf (Prop Range
_)           = ()
  rnf (SetN Range
_ Integer
a)         = Integer -> ()
forall a. NFData a => a -> ()
rnf Integer
a
  rnf (PropN Range
_ Integer
a)        = Integer -> ()
forall a. NFData a => a -> ()
rnf Integer
a
  rnf (Rec Range
_ RecordAssignments
a)          = RecordAssignments -> ()
forall a. NFData a => a -> ()
rnf RecordAssignments
a
  rnf (RecUpdate Range
_ Expr
a [FieldAssignment]
b)  = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a () -> () -> ()
`seq` [FieldAssignment] -> ()
forall a. NFData a => a -> ()
rnf [FieldAssignment]
b
  rnf (Let Range
_ [Declaration]
a TacticAttribute
b)        = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a () -> () -> ()
`seq` TacticAttribute -> ()
forall a. NFData a => a -> ()
rnf TacticAttribute
b
  rnf (Paren Range
_ Expr
a)        = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (IdiomBrackets Range
_ [Expr]
a)= [Expr] -> ()
forall a. NFData a => a -> ()
rnf [Expr]
a
  rnf (DoBlock Range
_ [DoStmt]
a)      = [DoStmt] -> ()
forall a. NFData a => a -> ()
rnf [DoStmt]
a
  rnf (Absurd Range
_)         = ()
  rnf (As Range
_ Name
a Expr
b)         = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (Dot Range
_ Expr
a)          = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (DoubleDot Range
_ Expr
a)    = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (ETel Telescope
a)           = Telescope -> ()
forall a. NFData a => a -> ()
rnf Telescope
a
  rnf (Quote Range
_)          = ()
  rnf (QuoteTerm Range
_)      = ()
  rnf (Tactic Range
_ Expr
a)       = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (Unquote Range
_)        = ()
  rnf (DontCare Expr
a)       = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (Equal Range
_ Expr
a Expr
b)      = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (Ellipsis Range
_)       = ()
  rnf (Generalized Expr
e)    = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
e

-- | Ranges are not forced.

instance NFData Pattern where
  rnf :: Pattern -> ()
rnf (IdentP QName
a) = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (QuoteP Range
_) = ()
  rnf (AppP Pattern
a NamedArg Pattern
b) = Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
a () -> () -> ()
`seq` NamedArg Pattern -> ()
forall a. NFData a => a -> ()
rnf NamedArg Pattern
b
  rnf (RawAppP Range
_ [Pattern]
a) = [Pattern] -> ()
forall a. NFData a => a -> ()
rnf [Pattern]
a
  rnf (OpAppP Range
_ QName
a Set Name
b [NamedArg Pattern]
c) = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` Set Name -> ()
forall a. NFData a => a -> ()
rnf Set Name
b () -> () -> ()
`seq` [NamedArg Pattern] -> ()
forall a. NFData a => a -> ()
rnf [NamedArg Pattern]
c
  rnf (HiddenP Range
_ Named NamedName Pattern
a) = Named NamedName Pattern -> ()
forall a. NFData a => a -> ()
rnf Named NamedName Pattern
a
  rnf (InstanceP Range
_ Named NamedName Pattern
a) = Named NamedName Pattern -> ()
forall a. NFData a => a -> ()
rnf Named NamedName Pattern
a
  rnf (ParenP Range
_ Pattern
a) = Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
a
  rnf (WildP Range
_) = ()
  rnf (AbsurdP Range
_) = ()
  rnf (AsP Range
_ Name
a Pattern
b) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
b
  rnf (DotP Range
_ Expr
a) = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
a
  rnf (LitP Literal
a) = Literal -> ()
forall a. NFData a => a -> ()
rnf Literal
a
  rnf (RecP Range
_ [FieldAssignment' Pattern]
a) = [FieldAssignment' Pattern] -> ()
forall a. NFData a => a -> ()
rnf [FieldAssignment' Pattern]
a
  rnf (EqualP Range
_ [(Expr, Expr)]
es) = [(Expr, Expr)] -> ()
forall a. NFData a => a -> ()
rnf [(Expr, Expr)]
es
  rnf (EllipsisP Range
_) = ()
  rnf (WithP Range
_ Pattern
a) = Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
a

-- | Ranges are not forced.

instance NFData Declaration where
  rnf :: Declaration -> ()
rnf (TypeSig ArgInfo
a TacticAttribute
b Name
c Expr
d)       = ArgInfo -> ()
forall a. NFData a => a -> ()
rnf ArgInfo
a () -> () -> ()
`seq` TacticAttribute -> ()
forall a. NFData a => a -> ()
rnf TacticAttribute
b () -> () -> ()
`seq` Name -> ()
forall a. NFData a => a -> ()
rnf Name
c () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
d
  rnf (FieldSig IsInstance
a TacticAttribute
b Name
c Arg Expr
d)      = IsInstance -> ()
forall a. NFData a => a -> ()
rnf IsInstance
a () -> () -> ()
`seq` TacticAttribute -> ()
forall a. NFData a => a -> ()
rnf TacticAttribute
b () -> () -> ()
`seq` Name -> ()
forall a. NFData a => a -> ()
rnf Name
c () -> () -> ()
`seq` Arg Expr -> ()
forall a. NFData a => a -> ()
rnf Arg Expr
d
  rnf (Generalize Range
_ [Declaration]
a)        = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Field Range
_ [Declaration]
fs)            = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
fs
  rnf (FunClause LHS
a RHS
b WhereClause
c Bool
d)     = LHS -> ()
forall a. NFData a => a -> ()
rnf LHS
a () -> () -> ()
`seq` RHS -> ()
forall a. NFData a => a -> ()
rnf RHS
b () -> () -> ()
`seq` WhereClause -> ()
forall a. NFData a => a -> ()
rnf WhereClause
c () -> () -> ()
`seq` Bool -> ()
forall a. NFData a => a -> ()
rnf Bool
d
  rnf (DataSig Range
_ Name
a [LamBinding]
b Expr
c)       = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
b () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
c
  rnf (Data Range
_ Name
a [LamBinding]
b Expr
c [Declaration]
d)        = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
b () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
c () -> () -> ()
`seq` [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
d
  rnf (DataDef Range
_ Name
a [LamBinding]
b [Declaration]
c)       = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
b () -> () -> ()
`seq` [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
c
  rnf (RecordSig Range
_ Name
a [LamBinding]
b Expr
c)     = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
b () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
c
  rnf (RecordDef Range
_ Name
a Maybe (Ranged Induction)
b Maybe HasEta
c Maybe (Name, IsInstance)
d [LamBinding]
e [Declaration]
f) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Maybe (Ranged Induction) -> ()
forall a. NFData a => a -> ()
rnf Maybe (Ranged Induction)
b () -> () -> ()
`seq` Maybe HasEta -> ()
forall a. NFData a => a -> ()
rnf Maybe HasEta
c () -> () -> ()
`seq` Maybe (Name, IsInstance) -> ()
forall a. NFData a => a -> ()
rnf Maybe (Name, IsInstance)
d () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
e () -> () -> ()
`seq` [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
f
  rnf (Record Range
_ Name
a Maybe (Ranged Induction)
b Maybe HasEta
c Maybe (Name, IsInstance)
d [LamBinding]
e Expr
f [Declaration]
g)  = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Maybe (Ranged Induction) -> ()
forall a. NFData a => a -> ()
rnf Maybe (Ranged Induction)
b () -> () -> ()
`seq` Maybe HasEta -> ()
forall a. NFData a => a -> ()
rnf Maybe HasEta
c () -> () -> ()
`seq` Maybe (Name, IsInstance) -> ()
forall a. NFData a => a -> ()
rnf Maybe (Name, IsInstance)
d () -> () -> ()
`seq` [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
e () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
f () -> () -> ()
`seq` [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
g
  rnf (Infix Fixity
a [Name]
b)             = Fixity -> ()
forall a. NFData a => a -> ()
rnf Fixity
a () -> () -> ()
`seq` [Name] -> ()
forall a. NFData a => a -> ()
rnf [Name]
b
  rnf (Syntax Name
a Notation
b)            = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Notation -> ()
forall a. NFData a => a -> ()
rnf Notation
b
  rnf (PatternSyn Range
_ Name
a [Arg Name]
b Pattern
c)    = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [Arg Name] -> ()
forall a. NFData a => a -> ()
rnf [Arg Name]
b () -> () -> ()
`seq` Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
c
  rnf (Mutual Range
_ [Declaration]
a)            = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Abstract Range
_ [Declaration]
a)          = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Private Range
_ Origin
_ [Declaration]
a)         = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (InstanceB Range
_ [Declaration]
a)         = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Macro Range
_ [Declaration]
a)             = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Postulate Range
_ [Declaration]
a)         = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Primitive Range
_ [Declaration]
a)         = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a
  rnf (Open Range
_ QName
a ImportDirective
b)            = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` ImportDirective -> ()
forall a. NFData a => a -> ()
rnf ImportDirective
b
  rnf (Import Range
_ QName
a Maybe AsName
b OpenShortHand
_ ImportDirective
c)      = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` Maybe AsName -> ()
forall a. NFData a => a -> ()
rnf Maybe AsName
b () -> () -> ()
`seq` ImportDirective -> ()
forall a. NFData a => a -> ()
rnf ImportDirective
c
  rnf (ModuleMacro Range
_ Name
a ModuleApplication
b OpenShortHand
_ ImportDirective
c) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` ModuleApplication -> ()
forall a. NFData a => a -> ()
rnf ModuleApplication
b () -> () -> ()
`seq` ImportDirective -> ()
forall a. NFData a => a -> ()
rnf ImportDirective
c
  rnf (Module Range
_ QName
a Telescope
b [Declaration]
c)        = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` Telescope -> ()
forall a. NFData a => a -> ()
rnf Telescope
b () -> () -> ()
`seq` [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
c
  rnf (UnquoteDecl Range
_ [Name]
a Expr
b)     = [Name] -> ()
forall a. NFData a => a -> ()
rnf [Name]
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (UnquoteDef Range
_ [Name]
a Expr
b)      = [Name] -> ()
forall a. NFData a => a -> ()
rnf [Name]
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (Pragma Pragma
a)              = Pragma -> ()
forall a. NFData a => a -> ()
rnf Pragma
a

-- | Ranges are not forced.

instance NFData Pragma where
  rnf :: Pragma -> ()
rnf (OptionsPragma Range
_ [String]
a)               = [String] -> ()
forall a. NFData a => a -> ()
rnf [String]
a
  rnf (BuiltinPragma Range
_ RString
a QName
b)             = RString -> ()
forall a. NFData a => a -> ()
rnf RString
a () -> () -> ()
`seq` QName -> ()
forall a. NFData a => a -> ()
rnf QName
b
  rnf (RewritePragma Range
_ Range
_ [QName]
a)             = [QName] -> ()
forall a. NFData a => a -> ()
rnf [QName]
a
  rnf (CompilePragma Range
_ RString
a QName
b String
c)           = RString -> ()
forall a. NFData a => a -> ()
rnf RString
a () -> () -> ()
`seq` QName -> ()
forall a. NFData a => a -> ()
rnf QName
b () -> () -> ()
`seq` String -> ()
forall a. NFData a => a -> ()
rnf String
c
  rnf (ForeignPragma Range
_ RString
b String
s)             = RString -> ()
forall a. NFData a => a -> ()
rnf RString
b () -> () -> ()
`seq` String -> ()
forall a. NFData a => a -> ()
rnf String
s
  rnf (StaticPragma Range
_ QName
a)                = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (InjectivePragma Range
_ QName
a)             = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (InlinePragma Range
_ Bool
_ QName
a)              = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (ImpossiblePragma Range
_)              = ()
  rnf (EtaPragma Range
_ QName
a)                   = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a
  rnf (TerminationCheckPragma Range
_ TerminationCheck Name
a)      = TerminationCheck Name -> ()
forall a. NFData a => a -> ()
rnf TerminationCheck Name
a
  rnf (NoCoverageCheckPragma Range
_)         = ()
  rnf (WarningOnUsage Range
_ QName
a String
b)            = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` String -> ()
forall a. NFData a => a -> ()
rnf String
b
  rnf (WarningOnImport Range
_ String
a)             = String -> ()
forall a. NFData a => a -> ()
rnf String
a
  rnf (CatchallPragma Range
_)                = ()
  rnf (DisplayPragma Range
_ Pattern
a Expr
b)             = Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (NoPositivityCheckPragma Range
_)       = ()
  rnf (PolarityPragma Range
_ Name
a [Occurrence]
b)            = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [Occurrence] -> ()
forall a. NFData a => a -> ()
rnf [Occurrence]
b
  rnf (NoUniverseCheckPragma Range
_)         = ()

-- | Ranges are not forced.

instance NFData AsName where
  rnf :: AsName -> ()
rnf (AsName Either Expr Name
a Range
_) = Either Expr Name -> ()
forall a. NFData a => a -> ()
rnf Either Expr Name
a

-- | Ranges are not forced.

instance NFData a => NFData (TypedBinding' a) where
  rnf :: TypedBinding' a -> ()
rnf (TBind Range
_ [NamedArg Binder]
a a
b) = [NamedArg Binder] -> ()
forall a. NFData a => a -> ()
rnf [NamedArg Binder]
a () -> () -> ()
`seq` a -> ()
forall a. NFData a => a -> ()
rnf a
b
  rnf (TLet Range
_ [Declaration]
a)    = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
a

-- | Ranges are not forced.

instance NFData ModuleApplication where
  rnf :: ModuleApplication -> ()
rnf (SectionApp Range
_ Telescope
a Expr
b)    = Telescope -> ()
forall a. NFData a => a -> ()
rnf Telescope
a () -> () -> ()
`seq` Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
b
  rnf (RecordModuleInstance Range
_ QName
a) = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a

-- | Ranges are not forced.

instance NFData a => NFData (OpApp a) where
  rnf :: OpApp a -> ()
rnf (SyntaxBindingLambda Range
_ [LamBinding]
a a
b) = [LamBinding] -> ()
forall a. NFData a => a -> ()
rnf [LamBinding]
a () -> () -> ()
`seq` a -> ()
forall a. NFData a => a -> ()
rnf a
b
  rnf (Ordinary a
a)                = a -> ()
forall a. NFData a => a -> ()
rnf a
a

-- | Ranges are not forced.

instance NFData LHS where
  rnf :: LHS -> ()
rnf (LHS Pattern
a [RewriteEqn]
b [WithHiding Expr]
c ExpandedEllipsis
d) = Pattern -> ()
forall a. NFData a => a -> ()
rnf Pattern
a () -> () -> ()
`seq` [RewriteEqn] -> ()
forall a. NFData a => a -> ()
rnf [RewriteEqn]
b () -> () -> ()
`seq` [WithHiding Expr] -> ()
forall a. NFData a => a -> ()
rnf [WithHiding Expr]
c () -> () -> ()
`seq` ExpandedEllipsis -> ()
forall a. NFData a => a -> ()
rnf ExpandedEllipsis
d

instance NFData a => NFData (FieldAssignment' a) where
  rnf :: FieldAssignment' a -> ()
rnf (FieldAssignment Name
a a
b) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` a -> ()
forall a. NFData a => a -> ()
rnf a
b

instance NFData ModuleAssignment where
  rnf :: ModuleAssignment -> ()
rnf (ModuleAssignment QName
a [Expr]
b ImportDirective
c) = QName -> ()
forall a. NFData a => a -> ()
rnf QName
a () -> () -> ()
`seq` [Expr] -> ()
forall a. NFData a => a -> ()
rnf [Expr]
b () -> () -> ()
`seq` ImportDirective -> ()
forall a. NFData a => a -> ()
rnf ImportDirective
c

instance NFData a => NFData (WhereClause' a) where
  rnf :: WhereClause' a -> ()
rnf WhereClause' a
NoWhere         = ()
  rnf (AnyWhere a
a)    = a -> ()
forall a. NFData a => a -> ()
rnf a
a
  rnf (SomeWhere Name
a Access
b a
c) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Access -> ()
forall a. NFData a => a -> ()
rnf Access
b () -> () -> ()
`seq` a -> ()
forall a. NFData a => a -> ()
rnf a
c

instance NFData LamClause where
  rnf :: LamClause -> ()
rnf (LamClause LHS
a RHS
b WhereClause
c Bool
d) = (LHS, RHS, WhereClause, Bool) -> ()
forall a. NFData a => a -> ()
rnf (LHS
a, RHS
b, WhereClause
c, Bool
d)

instance NFData a => NFData (LamBinding' a) where
  rnf :: LamBinding' a -> ()
rnf (DomainFree NamedArg Binder
a) = NamedArg Binder -> ()
forall a. NFData a => a -> ()
rnf NamedArg Binder
a
  rnf (DomainFull a
a) = a -> ()
forall a. NFData a => a -> ()
rnf a
a

instance NFData Binder where
  rnf :: Binder -> ()
rnf (Binder Maybe Pattern
a BoundName
b) = Maybe Pattern -> ()
forall a. NFData a => a -> ()
rnf Maybe Pattern
a () -> () -> ()
`seq` BoundName -> ()
forall a. NFData a => a -> ()
rnf BoundName
b

instance NFData BoundName where
  rnf :: BoundName -> ()
rnf (BName Name
a Fixity'
b TacticAttribute
c) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` Fixity' -> ()
forall a. NFData a => a -> ()
rnf Fixity'
b () -> () -> ()
`seq` TacticAttribute -> ()
forall a. NFData a => a -> ()
rnf TacticAttribute
c

instance NFData a => NFData (RHS' a) where
  rnf :: RHS' a -> ()
rnf RHS' a
AbsurdRHS = ()
  rnf (RHS a
a)   = a -> ()
forall a. NFData a => a -> ()
rnf a
a

instance NFData DoStmt where
  rnf :: DoStmt -> ()
rnf (DoBind Range
_ Pattern
p Expr
e [LamClause]
w) = (Pattern, Expr, [LamClause]) -> ()
forall a. NFData a => a -> ()
rnf (Pattern
p, Expr
e, [LamClause]
w)
  rnf (DoThen Expr
e)       = Expr -> ()
forall a. NFData a => a -> ()
rnf Expr
e
  rnf (DoLet Range
_ [Declaration]
ds)     = [Declaration] -> ()
forall a. NFData a => a -> ()
rnf [Declaration]
ds