{-# OPTIONS -fno-warn-name-shadowing #-}
{-# LANGUAGE CPP                #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable     #-}
{-# LANGUAGE DeriveFunctor      #-}
{-# LANGUAGE DeriveTraversable  #-}
{-# LANGUAGE NoImplicitPrelude  #-}
{-# LANGUAGE StandaloneDeriving #-}
module Language.Haskell.Names.Types
  ( Error (..)
  , ExtensionSet
  , GName (..)
  , HasOrigName (..)
  , ModuleNameS
  , NameInfo (..)
  , NameS
  , OrigName (..)
  , Scoped (..)
  , SymTypeInfo (..)
  , SymValueInfo (..)
  , Symbols (..)
  , mkTy
  , mkVal
  , ppError
  , ppGName
  , ppOrigName
  , sLoc
  , tySyms
  , valSyms
  ) where

import {-# SOURCE #-} qualified Language.Haskell.Names.GlobalSymbolTable as Global
import           Fay.Compiler.Prelude

import           Data.Foldable                            as F
import           Data.Lens.Light
import qualified Data.Set                                 as Set
import           Language.Haskell.Exts
import           Text.Printf
import qualified Data.Semigroup                           as SG

type ExtensionSet = Set.Set KnownExtension

-- | Repesents the symbol's fixity
type SymFixity = (Assoc (), Int)

-- | Information about a value-level entitity
data SymValueInfo name
    = SymValue
      { SymValueInfo name -> name
sv_origName :: name
      , SymValueInfo name -> Maybe SymFixity
sv_fixity   :: Maybe SymFixity
      }
      -- ^ value or function
    | SymMethod
      { sv_origName  :: name
      , sv_fixity    :: Maybe SymFixity
      , SymValueInfo name -> name
sv_className :: name
      }
      -- ^ class method
    | SymSelector
      { sv_origName     :: name
      , sv_fixity       :: Maybe SymFixity
      , SymValueInfo name -> name
sv_typeName     :: name
      , SymValueInfo name -> [name]
sv_constructors :: [name]
      }
      -- ^ record field selector
    | SymConstructor
      { sv_origName :: name
      , sv_fixity   :: Maybe SymFixity
      , sv_typeName :: name
      }
      -- ^ data constructor
    deriving (SymValueInfo name -> SymValueInfo name -> Bool
(SymValueInfo name -> SymValueInfo name -> Bool)
-> (SymValueInfo name -> SymValueInfo name -> Bool)
-> Eq (SymValueInfo name)
forall name.
Eq name =>
SymValueInfo name -> SymValueInfo name -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymValueInfo name -> SymValueInfo name -> Bool
$c/= :: forall name.
Eq name =>
SymValueInfo name -> SymValueInfo name -> Bool
== :: SymValueInfo name -> SymValueInfo name -> Bool
$c== :: forall name.
Eq name =>
SymValueInfo name -> SymValueInfo name -> Bool
Eq, Eq (SymValueInfo name)
Eq (SymValueInfo name) =>
(SymValueInfo name -> SymValueInfo name -> Ordering)
-> (SymValueInfo name -> SymValueInfo name -> Bool)
-> (SymValueInfo name -> SymValueInfo name -> Bool)
-> (SymValueInfo name -> SymValueInfo name -> Bool)
-> (SymValueInfo name -> SymValueInfo name -> Bool)
-> (SymValueInfo name -> SymValueInfo name -> SymValueInfo name)
-> (SymValueInfo name -> SymValueInfo name -> SymValueInfo name)
-> Ord (SymValueInfo name)
SymValueInfo name -> SymValueInfo name -> Bool
SymValueInfo name -> SymValueInfo name -> Ordering
SymValueInfo name -> SymValueInfo name -> SymValueInfo name
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall name. Ord name => Eq (SymValueInfo name)
forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Bool
forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Ordering
forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> SymValueInfo name
min :: SymValueInfo name -> SymValueInfo name -> SymValueInfo name
$cmin :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> SymValueInfo name
max :: SymValueInfo name -> SymValueInfo name -> SymValueInfo name
$cmax :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> SymValueInfo name
>= :: SymValueInfo name -> SymValueInfo name -> Bool
$c>= :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Bool
> :: SymValueInfo name -> SymValueInfo name -> Bool
$c> :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Bool
<= :: SymValueInfo name -> SymValueInfo name -> Bool
$c<= :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Bool
< :: SymValueInfo name -> SymValueInfo name -> Bool
$c< :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Bool
compare :: SymValueInfo name -> SymValueInfo name -> Ordering
$ccompare :: forall name.
Ord name =>
SymValueInfo name -> SymValueInfo name -> Ordering
$cp1Ord :: forall name. Ord name => Eq (SymValueInfo name)
Ord, Int -> SymValueInfo name -> ShowS
[SymValueInfo name] -> ShowS
SymValueInfo name -> String
(Int -> SymValueInfo name -> ShowS)
-> (SymValueInfo name -> String)
-> ([SymValueInfo name] -> ShowS)
-> Show (SymValueInfo name)
forall name. Show name => Int -> SymValueInfo name -> ShowS
forall name. Show name => [SymValueInfo name] -> ShowS
forall name. Show name => SymValueInfo name -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymValueInfo name] -> ShowS
$cshowList :: forall name. Show name => [SymValueInfo name] -> ShowS
show :: SymValueInfo name -> String
$cshow :: forall name. Show name => SymValueInfo name -> String
showsPrec :: Int -> SymValueInfo name -> ShowS
$cshowsPrec :: forall name. Show name => Int -> SymValueInfo name -> ShowS
Show, Typeable (SymValueInfo name)
DataType
Constr
Typeable (SymValueInfo name) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SymValueInfo name
 -> c (SymValueInfo name))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (SymValueInfo name))
-> (SymValueInfo name -> Constr)
-> (SymValueInfo name -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (SymValueInfo name)))
-> ((forall b. Data b => b -> b)
    -> SymValueInfo name -> SymValueInfo name)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SymValueInfo name -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SymValueInfo name -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SymValueInfo name -> m (SymValueInfo name))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymValueInfo name -> m (SymValueInfo name))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymValueInfo name -> m (SymValueInfo name))
-> Data (SymValueInfo name)
SymValueInfo name -> DataType
SymValueInfo name -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name))
(forall b. Data b => b -> b)
-> SymValueInfo name -> SymValueInfo name
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymValueInfo name
-> c (SymValueInfo name)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymValueInfo name)
forall name. Data name => Typeable (SymValueInfo name)
forall name. Data name => SymValueInfo name -> DataType
forall name. Data name => SymValueInfo name -> Constr
forall name.
Data name =>
(forall b. Data b => b -> b)
-> SymValueInfo name -> SymValueInfo name
forall name u.
Data name =>
Int -> (forall d. Data d => d -> u) -> SymValueInfo name -> u
forall name u.
Data name =>
(forall d. Data d => d -> u) -> SymValueInfo name -> [u]
forall name r r'.
Data name =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
forall name r r'.
Data name =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
forall name (m :: * -> *).
(Data name, Monad m) =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
forall name (c :: * -> *).
Data name =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymValueInfo name)
forall name (c :: * -> *).
Data name =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymValueInfo name
-> c (SymValueInfo name)
forall name (t :: * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name))
forall name (t :: * -> * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymValueInfo name))
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) -> SymValueInfo name -> u
forall u. (forall d. Data d => d -> u) -> SymValueInfo name -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymValueInfo name)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymValueInfo name
-> c (SymValueInfo name)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymValueInfo name))
$cSymConstructor :: Constr
$cSymSelector :: Constr
$cSymMethod :: Constr
$cSymValue :: Constr
$tSymValueInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
$cgmapMo :: forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
gmapMp :: (forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
$cgmapMp :: forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
gmapM :: (forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
$cgmapM :: forall name (m :: * -> *).
(Data name, Monad m) =>
(forall d. Data d => d -> m d)
-> SymValueInfo name -> m (SymValueInfo name)
gmapQi :: Int -> (forall d. Data d => d -> u) -> SymValueInfo name -> u
$cgmapQi :: forall name u.
Data name =>
Int -> (forall d. Data d => d -> u) -> SymValueInfo name -> u
gmapQ :: (forall d. Data d => d -> u) -> SymValueInfo name -> [u]
$cgmapQ :: forall name u.
Data name =>
(forall d. Data d => d -> u) -> SymValueInfo name -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
$cgmapQr :: forall name r r'.
Data name =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
$cgmapQl :: forall name r r'.
Data name =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymValueInfo name -> r
gmapT :: (forall b. Data b => b -> b)
-> SymValueInfo name -> SymValueInfo name
$cgmapT :: forall name.
Data name =>
(forall b. Data b => b -> b)
-> SymValueInfo name -> SymValueInfo name
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymValueInfo name))
$cdataCast2 :: forall name (t :: * -> * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymValueInfo name))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name))
$cdataCast1 :: forall name (t :: * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SymValueInfo name))
dataTypeOf :: SymValueInfo name -> DataType
$cdataTypeOf :: forall name. Data name => SymValueInfo name -> DataType
toConstr :: SymValueInfo name -> Constr
$ctoConstr :: forall name. Data name => SymValueInfo name -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymValueInfo name)
$cgunfold :: forall name (c :: * -> *).
Data name =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymValueInfo name)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymValueInfo name
-> c (SymValueInfo name)
$cgfoldl :: forall name (c :: * -> *).
Data name =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymValueInfo name
-> c (SymValueInfo name)
$cp1Data :: forall name. Data name => Typeable (SymValueInfo name)
Data, Typeable, a -> SymValueInfo b -> SymValueInfo a
(a -> b) -> SymValueInfo a -> SymValueInfo b
(forall a b. (a -> b) -> SymValueInfo a -> SymValueInfo b)
-> (forall a b. a -> SymValueInfo b -> SymValueInfo a)
-> Functor SymValueInfo
forall a b. a -> SymValueInfo b -> SymValueInfo a
forall a b. (a -> b) -> SymValueInfo a -> SymValueInfo b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> SymValueInfo b -> SymValueInfo a
$c<$ :: forall a b. a -> SymValueInfo b -> SymValueInfo a
fmap :: (a -> b) -> SymValueInfo a -> SymValueInfo b
$cfmap :: forall a b. (a -> b) -> SymValueInfo a -> SymValueInfo b
Functor, SymValueInfo a -> Bool
(a -> m) -> SymValueInfo a -> m
(a -> b -> b) -> b -> SymValueInfo a -> b
(forall m. Monoid m => SymValueInfo m -> m)
-> (forall m a. Monoid m => (a -> m) -> SymValueInfo a -> m)
-> (forall m a. Monoid m => (a -> m) -> SymValueInfo a -> m)
-> (forall a b. (a -> b -> b) -> b -> SymValueInfo a -> b)
-> (forall a b. (a -> b -> b) -> b -> SymValueInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> SymValueInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> SymValueInfo a -> b)
-> (forall a. (a -> a -> a) -> SymValueInfo a -> a)
-> (forall a. (a -> a -> a) -> SymValueInfo a -> a)
-> (forall a. SymValueInfo a -> [a])
-> (forall a. SymValueInfo a -> Bool)
-> (forall a. SymValueInfo a -> Int)
-> (forall a. Eq a => a -> SymValueInfo a -> Bool)
-> (forall a. Ord a => SymValueInfo a -> a)
-> (forall a. Ord a => SymValueInfo a -> a)
-> (forall a. Num a => SymValueInfo a -> a)
-> (forall a. Num a => SymValueInfo a -> a)
-> Foldable SymValueInfo
forall a. Eq a => a -> SymValueInfo a -> Bool
forall a. Num a => SymValueInfo a -> a
forall a. Ord a => SymValueInfo a -> a
forall m. Monoid m => SymValueInfo m -> m
forall a. SymValueInfo a -> Bool
forall a. SymValueInfo a -> Int
forall a. SymValueInfo a -> [a]
forall a. (a -> a -> a) -> SymValueInfo a -> a
forall m a. Monoid m => (a -> m) -> SymValueInfo a -> m
forall b a. (b -> a -> b) -> b -> SymValueInfo a -> b
forall a b. (a -> b -> b) -> b -> SymValueInfo 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 :: SymValueInfo a -> a
$cproduct :: forall a. Num a => SymValueInfo a -> a
sum :: SymValueInfo a -> a
$csum :: forall a. Num a => SymValueInfo a -> a
minimum :: SymValueInfo a -> a
$cminimum :: forall a. Ord a => SymValueInfo a -> a
maximum :: SymValueInfo a -> a
$cmaximum :: forall a. Ord a => SymValueInfo a -> a
elem :: a -> SymValueInfo a -> Bool
$celem :: forall a. Eq a => a -> SymValueInfo a -> Bool
length :: SymValueInfo a -> Int
$clength :: forall a. SymValueInfo a -> Int
null :: SymValueInfo a -> Bool
$cnull :: forall a. SymValueInfo a -> Bool
toList :: SymValueInfo a -> [a]
$ctoList :: forall a. SymValueInfo a -> [a]
foldl1 :: (a -> a -> a) -> SymValueInfo a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> SymValueInfo a -> a
foldr1 :: (a -> a -> a) -> SymValueInfo a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> SymValueInfo a -> a
foldl' :: (b -> a -> b) -> b -> SymValueInfo a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> SymValueInfo a -> b
foldl :: (b -> a -> b) -> b -> SymValueInfo a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> SymValueInfo a -> b
foldr' :: (a -> b -> b) -> b -> SymValueInfo a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> SymValueInfo a -> b
foldr :: (a -> b -> b) -> b -> SymValueInfo a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> SymValueInfo a -> b
foldMap' :: (a -> m) -> SymValueInfo a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> SymValueInfo a -> m
foldMap :: (a -> m) -> SymValueInfo a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> SymValueInfo a -> m
fold :: SymValueInfo m -> m
$cfold :: forall m. Monoid m => SymValueInfo m -> m
Foldable, Functor SymValueInfo
Foldable SymValueInfo
(Functor SymValueInfo, Foldable SymValueInfo) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> SymValueInfo a -> f (SymValueInfo b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    SymValueInfo (f a) -> f (SymValueInfo a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> SymValueInfo a -> m (SymValueInfo b))
-> (forall (m :: * -> *) a.
    Monad m =>
    SymValueInfo (m a) -> m (SymValueInfo a))
-> Traversable SymValueInfo
(a -> f b) -> SymValueInfo a -> f (SymValueInfo 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 =>
SymValueInfo (m a) -> m (SymValueInfo a)
forall (f :: * -> *) a.
Applicative f =>
SymValueInfo (f a) -> f (SymValueInfo a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> SymValueInfo a -> m (SymValueInfo b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> SymValueInfo a -> f (SymValueInfo b)
sequence :: SymValueInfo (m a) -> m (SymValueInfo a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
SymValueInfo (m a) -> m (SymValueInfo a)
mapM :: (a -> m b) -> SymValueInfo a -> m (SymValueInfo b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> SymValueInfo a -> m (SymValueInfo b)
sequenceA :: SymValueInfo (f a) -> f (SymValueInfo a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
SymValueInfo (f a) -> f (SymValueInfo a)
traverse :: (a -> f b) -> SymValueInfo a -> f (SymValueInfo b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> SymValueInfo a -> f (SymValueInfo b)
$cp2Traversable :: Foldable SymValueInfo
$cp1Traversable :: Functor SymValueInfo
Traversable)

-- | Information about a type-level entitity
data SymTypeInfo name
    = SymType
      { SymTypeInfo name -> name
st_origName :: name
      , SymTypeInfo name -> Maybe SymFixity
st_fixity   :: Maybe SymFixity
      }
      -- ^ type synonym
    | SymData
      { st_origName :: name
      , st_fixity   :: Maybe SymFixity
      }
      -- ^ data type
    | SymNewType
      { st_origName :: name
      , st_fixity   :: Maybe SymFixity
      }
      -- ^ newtype
    | SymTypeFam
      { st_origName :: name
      , st_fixity   :: Maybe SymFixity
      }
      -- ^ type family
    | SymDataFam
      { st_origName :: name
      , st_fixity   :: Maybe SymFixity
      }
      -- ^ data family
    | SymClass
      { st_origName :: name
      , st_fixity   :: Maybe SymFixity
      }
      -- ^ type class
    deriving (SymTypeInfo name -> SymTypeInfo name -> Bool
(SymTypeInfo name -> SymTypeInfo name -> Bool)
-> (SymTypeInfo name -> SymTypeInfo name -> Bool)
-> Eq (SymTypeInfo name)
forall name.
Eq name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c/= :: forall name.
Eq name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
== :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c== :: forall name.
Eq name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
Eq, Eq (SymTypeInfo name)
Eq (SymTypeInfo name) =>
(SymTypeInfo name -> SymTypeInfo name -> Ordering)
-> (SymTypeInfo name -> SymTypeInfo name -> Bool)
-> (SymTypeInfo name -> SymTypeInfo name -> Bool)
-> (SymTypeInfo name -> SymTypeInfo name -> Bool)
-> (SymTypeInfo name -> SymTypeInfo name -> Bool)
-> (SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name)
-> (SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name)
-> Ord (SymTypeInfo name)
SymTypeInfo name -> SymTypeInfo name -> Bool
SymTypeInfo name -> SymTypeInfo name -> Ordering
SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall name. Ord name => Eq (SymTypeInfo name)
forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Ordering
forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
min :: SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
$cmin :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
max :: SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
$cmax :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> SymTypeInfo name
>= :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c>= :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
> :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c> :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
<= :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c<= :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
< :: SymTypeInfo name -> SymTypeInfo name -> Bool
$c< :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Bool
compare :: SymTypeInfo name -> SymTypeInfo name -> Ordering
$ccompare :: forall name.
Ord name =>
SymTypeInfo name -> SymTypeInfo name -> Ordering
$cp1Ord :: forall name. Ord name => Eq (SymTypeInfo name)
Ord, Int -> SymTypeInfo name -> ShowS
[SymTypeInfo name] -> ShowS
SymTypeInfo name -> String
(Int -> SymTypeInfo name -> ShowS)
-> (SymTypeInfo name -> String)
-> ([SymTypeInfo name] -> ShowS)
-> Show (SymTypeInfo name)
forall name. Show name => Int -> SymTypeInfo name -> ShowS
forall name. Show name => [SymTypeInfo name] -> ShowS
forall name. Show name => SymTypeInfo name -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymTypeInfo name] -> ShowS
$cshowList :: forall name. Show name => [SymTypeInfo name] -> ShowS
show :: SymTypeInfo name -> String
$cshow :: forall name. Show name => SymTypeInfo name -> String
showsPrec :: Int -> SymTypeInfo name -> ShowS
$cshowsPrec :: forall name. Show name => Int -> SymTypeInfo name -> ShowS
Show, Typeable (SymTypeInfo name)
DataType
Constr
Typeable (SymTypeInfo name) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SymTypeInfo name
 -> c (SymTypeInfo name))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name))
-> (SymTypeInfo name -> Constr)
-> (SymTypeInfo name -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (SymTypeInfo name)))
-> ((forall b. Data b => b -> b)
    -> SymTypeInfo name -> SymTypeInfo name)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SymTypeInfo name -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SymTypeInfo name -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SymTypeInfo name -> m (SymTypeInfo name))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymTypeInfo name -> m (SymTypeInfo name))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymTypeInfo name -> m (SymTypeInfo name))
-> Data (SymTypeInfo name)
SymTypeInfo name -> DataType
SymTypeInfo name -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name))
(forall b. Data b => b -> b)
-> SymTypeInfo name -> SymTypeInfo name
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymTypeInfo name -> c (SymTypeInfo name)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name)
forall name. Data name => Typeable (SymTypeInfo name)
forall name. Data name => SymTypeInfo name -> DataType
forall name. Data name => SymTypeInfo name -> Constr
forall name.
Data name =>
(forall b. Data b => b -> b)
-> SymTypeInfo name -> SymTypeInfo name
forall name u.
Data name =>
Int -> (forall d. Data d => d -> u) -> SymTypeInfo name -> u
forall name u.
Data name =>
(forall d. Data d => d -> u) -> SymTypeInfo name -> [u]
forall name r r'.
Data name =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
forall name r r'.
Data name =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
forall name (m :: * -> *).
(Data name, Monad m) =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
forall name (c :: * -> *).
Data name =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name)
forall name (c :: * -> *).
Data name =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymTypeInfo name -> c (SymTypeInfo name)
forall name (t :: * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name))
forall name (t :: * -> * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymTypeInfo name))
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) -> SymTypeInfo name -> u
forall u. (forall d. Data d => d -> u) -> SymTypeInfo name -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymTypeInfo name -> c (SymTypeInfo name)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymTypeInfo name))
$cSymClass :: Constr
$cSymDataFam :: Constr
$cSymTypeFam :: Constr
$cSymNewType :: Constr
$cSymData :: Constr
$cSymType :: Constr
$tSymTypeInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
$cgmapMo :: forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
gmapMp :: (forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
$cgmapMp :: forall name (m :: * -> *).
(Data name, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
gmapM :: (forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
$cgmapM :: forall name (m :: * -> *).
(Data name, Monad m) =>
(forall d. Data d => d -> m d)
-> SymTypeInfo name -> m (SymTypeInfo name)
gmapQi :: Int -> (forall d. Data d => d -> u) -> SymTypeInfo name -> u
$cgmapQi :: forall name u.
Data name =>
Int -> (forall d. Data d => d -> u) -> SymTypeInfo name -> u
gmapQ :: (forall d. Data d => d -> u) -> SymTypeInfo name -> [u]
$cgmapQ :: forall name u.
Data name =>
(forall d. Data d => d -> u) -> SymTypeInfo name -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
$cgmapQr :: forall name r r'.
Data name =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
$cgmapQl :: forall name r r'.
Data name =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymTypeInfo name -> r
gmapT :: (forall b. Data b => b -> b)
-> SymTypeInfo name -> SymTypeInfo name
$cgmapT :: forall name.
Data name =>
(forall b. Data b => b -> b)
-> SymTypeInfo name -> SymTypeInfo name
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymTypeInfo name))
$cdataCast2 :: forall name (t :: * -> * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SymTypeInfo name))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name))
$cdataCast1 :: forall name (t :: * -> *) (c :: * -> *).
(Data name, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SymTypeInfo name))
dataTypeOf :: SymTypeInfo name -> DataType
$cdataTypeOf :: forall name. Data name => SymTypeInfo name -> DataType
toConstr :: SymTypeInfo name -> Constr
$ctoConstr :: forall name. Data name => SymTypeInfo name -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name)
$cgunfold :: forall name (c :: * -> *).
Data name =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SymTypeInfo name)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymTypeInfo name -> c (SymTypeInfo name)
$cgfoldl :: forall name (c :: * -> *).
Data name =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymTypeInfo name -> c (SymTypeInfo name)
$cp1Data :: forall name. Data name => Typeable (SymTypeInfo name)
Data, Typeable, a -> SymTypeInfo b -> SymTypeInfo a
(a -> b) -> SymTypeInfo a -> SymTypeInfo b
(forall a b. (a -> b) -> SymTypeInfo a -> SymTypeInfo b)
-> (forall a b. a -> SymTypeInfo b -> SymTypeInfo a)
-> Functor SymTypeInfo
forall a b. a -> SymTypeInfo b -> SymTypeInfo a
forall a b. (a -> b) -> SymTypeInfo a -> SymTypeInfo b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> SymTypeInfo b -> SymTypeInfo a
$c<$ :: forall a b. a -> SymTypeInfo b -> SymTypeInfo a
fmap :: (a -> b) -> SymTypeInfo a -> SymTypeInfo b
$cfmap :: forall a b. (a -> b) -> SymTypeInfo a -> SymTypeInfo b
Functor, SymTypeInfo a -> Bool
(a -> m) -> SymTypeInfo a -> m
(a -> b -> b) -> b -> SymTypeInfo a -> b
(forall m. Monoid m => SymTypeInfo m -> m)
-> (forall m a. Monoid m => (a -> m) -> SymTypeInfo a -> m)
-> (forall m a. Monoid m => (a -> m) -> SymTypeInfo a -> m)
-> (forall a b. (a -> b -> b) -> b -> SymTypeInfo a -> b)
-> (forall a b. (a -> b -> b) -> b -> SymTypeInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> SymTypeInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> SymTypeInfo a -> b)
-> (forall a. (a -> a -> a) -> SymTypeInfo a -> a)
-> (forall a. (a -> a -> a) -> SymTypeInfo a -> a)
-> (forall a. SymTypeInfo a -> [a])
-> (forall a. SymTypeInfo a -> Bool)
-> (forall a. SymTypeInfo a -> Int)
-> (forall a. Eq a => a -> SymTypeInfo a -> Bool)
-> (forall a. Ord a => SymTypeInfo a -> a)
-> (forall a. Ord a => SymTypeInfo a -> a)
-> (forall a. Num a => SymTypeInfo a -> a)
-> (forall a. Num a => SymTypeInfo a -> a)
-> Foldable SymTypeInfo
forall a. Eq a => a -> SymTypeInfo a -> Bool
forall a. Num a => SymTypeInfo a -> a
forall a. Ord a => SymTypeInfo a -> a
forall m. Monoid m => SymTypeInfo m -> m
forall a. SymTypeInfo a -> Bool
forall a. SymTypeInfo a -> Int
forall a. SymTypeInfo a -> [a]
forall a. (a -> a -> a) -> SymTypeInfo a -> a
forall m a. Monoid m => (a -> m) -> SymTypeInfo a -> m
forall b a. (b -> a -> b) -> b -> SymTypeInfo a -> b
forall a b. (a -> b -> b) -> b -> SymTypeInfo 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 :: SymTypeInfo a -> a
$cproduct :: forall a. Num a => SymTypeInfo a -> a
sum :: SymTypeInfo a -> a
$csum :: forall a. Num a => SymTypeInfo a -> a
minimum :: SymTypeInfo a -> a
$cminimum :: forall a. Ord a => SymTypeInfo a -> a
maximum :: SymTypeInfo a -> a
$cmaximum :: forall a. Ord a => SymTypeInfo a -> a
elem :: a -> SymTypeInfo a -> Bool
$celem :: forall a. Eq a => a -> SymTypeInfo a -> Bool
length :: SymTypeInfo a -> Int
$clength :: forall a. SymTypeInfo a -> Int
null :: SymTypeInfo a -> Bool
$cnull :: forall a. SymTypeInfo a -> Bool
toList :: SymTypeInfo a -> [a]
$ctoList :: forall a. SymTypeInfo a -> [a]
foldl1 :: (a -> a -> a) -> SymTypeInfo a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> SymTypeInfo a -> a
foldr1 :: (a -> a -> a) -> SymTypeInfo a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> SymTypeInfo a -> a
foldl' :: (b -> a -> b) -> b -> SymTypeInfo a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> SymTypeInfo a -> b
foldl :: (b -> a -> b) -> b -> SymTypeInfo a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> SymTypeInfo a -> b
foldr' :: (a -> b -> b) -> b -> SymTypeInfo a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> SymTypeInfo a -> b
foldr :: (a -> b -> b) -> b -> SymTypeInfo a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> SymTypeInfo a -> b
foldMap' :: (a -> m) -> SymTypeInfo a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> SymTypeInfo a -> m
foldMap :: (a -> m) -> SymTypeInfo a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> SymTypeInfo a -> m
fold :: SymTypeInfo m -> m
$cfold :: forall m. Monoid m => SymTypeInfo m -> m
Foldable, Functor SymTypeInfo
Foldable SymTypeInfo
(Functor SymTypeInfo, Foldable SymTypeInfo) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> SymTypeInfo a -> f (SymTypeInfo b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    SymTypeInfo (f a) -> f (SymTypeInfo a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> SymTypeInfo a -> m (SymTypeInfo b))
-> (forall (m :: * -> *) a.
    Monad m =>
    SymTypeInfo (m a) -> m (SymTypeInfo a))
-> Traversable SymTypeInfo
(a -> f b) -> SymTypeInfo a -> f (SymTypeInfo 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 =>
SymTypeInfo (m a) -> m (SymTypeInfo a)
forall (f :: * -> *) a.
Applicative f =>
SymTypeInfo (f a) -> f (SymTypeInfo a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> SymTypeInfo a -> m (SymTypeInfo b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> SymTypeInfo a -> f (SymTypeInfo b)
sequence :: SymTypeInfo (m a) -> m (SymTypeInfo a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
SymTypeInfo (m a) -> m (SymTypeInfo a)
mapM :: (a -> m b) -> SymTypeInfo a -> m (SymTypeInfo b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> SymTypeInfo a -> m (SymTypeInfo b)
sequenceA :: SymTypeInfo (f a) -> f (SymTypeInfo a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
SymTypeInfo (f a) -> f (SymTypeInfo a)
traverse :: (a -> f b) -> SymTypeInfo a -> f (SymTypeInfo b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> SymTypeInfo a -> f (SymTypeInfo b)
$cp2Traversable :: Foldable SymTypeInfo
$cp1Traversable :: Functor SymTypeInfo
Traversable)

class HasOrigName i where
  origName :: i n -> n

instance HasOrigName SymValueInfo where
  origName :: SymValueInfo n -> n
origName = SymValueInfo n -> n
forall n. SymValueInfo n -> n
sv_origName

instance HasOrigName SymTypeInfo where
  origName :: SymTypeInfo n -> n
origName = SymTypeInfo n -> n
forall n. SymTypeInfo n -> n
st_origName

-- | The set of symbols (entities) exported by a single module. Contains
-- the sets of value-level and type-level entities.
data Symbols = Symbols (Set.Set (SymValueInfo OrigName)) (Set.Set (SymTypeInfo OrigName))
  deriving (Symbols -> Symbols -> Bool
(Symbols -> Symbols -> Bool)
-> (Symbols -> Symbols -> Bool) -> Eq Symbols
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Symbols -> Symbols -> Bool
$c/= :: Symbols -> Symbols -> Bool
== :: Symbols -> Symbols -> Bool
$c== :: Symbols -> Symbols -> Bool
Eq, Eq Symbols
Eq Symbols =>
(Symbols -> Symbols -> Ordering)
-> (Symbols -> Symbols -> Bool)
-> (Symbols -> Symbols -> Bool)
-> (Symbols -> Symbols -> Bool)
-> (Symbols -> Symbols -> Bool)
-> (Symbols -> Symbols -> Symbols)
-> (Symbols -> Symbols -> Symbols)
-> Ord Symbols
Symbols -> Symbols -> Bool
Symbols -> Symbols -> Ordering
Symbols -> Symbols -> Symbols
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Symbols -> Symbols -> Symbols
$cmin :: Symbols -> Symbols -> Symbols
max :: Symbols -> Symbols -> Symbols
$cmax :: Symbols -> Symbols -> Symbols
>= :: Symbols -> Symbols -> Bool
$c>= :: Symbols -> Symbols -> Bool
> :: Symbols -> Symbols -> Bool
$c> :: Symbols -> Symbols -> Bool
<= :: Symbols -> Symbols -> Bool
$c<= :: Symbols -> Symbols -> Bool
< :: Symbols -> Symbols -> Bool
$c< :: Symbols -> Symbols -> Bool
compare :: Symbols -> Symbols -> Ordering
$ccompare :: Symbols -> Symbols -> Ordering
$cp1Ord :: Eq Symbols
Ord, Int -> Symbols -> ShowS
[Symbols] -> ShowS
Symbols -> String
(Int -> Symbols -> ShowS)
-> (Symbols -> String) -> ([Symbols] -> ShowS) -> Show Symbols
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Symbols] -> ShowS
$cshowList :: [Symbols] -> ShowS
show :: Symbols -> String
$cshow :: Symbols -> String
showsPrec :: Int -> Symbols -> ShowS
$cshowsPrec :: Int -> Symbols -> ShowS
Show, Typeable Symbols
DataType
Constr
Typeable Symbols =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Symbols -> c Symbols)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Symbols)
-> (Symbols -> Constr)
-> (Symbols -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Symbols))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Symbols))
-> ((forall b. Data b => b -> b) -> Symbols -> Symbols)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Symbols -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Symbols -> r)
-> (forall u. (forall d. Data d => d -> u) -> Symbols -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Symbols -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Symbols -> m Symbols)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Symbols -> m Symbols)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Symbols -> m Symbols)
-> Data Symbols
Symbols -> DataType
Symbols -> Constr
(forall b. Data b => b -> b) -> Symbols -> Symbols
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Symbols -> c Symbols
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Symbols
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) -> Symbols -> u
forall u. (forall d. Data d => d -> u) -> Symbols -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Symbols -> m Symbols
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Symbols -> m Symbols
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Symbols
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Symbols -> c Symbols
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Symbols)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Symbols)
$cSymbols :: Constr
$tSymbols :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Symbols -> m Symbols
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Symbols -> m Symbols
gmapMp :: (forall d. Data d => d -> m d) -> Symbols -> m Symbols
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Symbols -> m Symbols
gmapM :: (forall d. Data d => d -> m d) -> Symbols -> m Symbols
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Symbols -> m Symbols
gmapQi :: Int -> (forall d. Data d => d -> u) -> Symbols -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Symbols -> u
gmapQ :: (forall d. Data d => d -> u) -> Symbols -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Symbols -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Symbols -> r
gmapT :: (forall b. Data b => b -> b) -> Symbols -> Symbols
$cgmapT :: (forall b. Data b => b -> b) -> Symbols -> Symbols
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Symbols)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Symbols)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Symbols)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Symbols)
dataTypeOf :: Symbols -> DataType
$cdataTypeOf :: Symbols -> DataType
toConstr :: Symbols -> Constr
$ctoConstr :: Symbols -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Symbols
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Symbols
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Symbols -> c Symbols
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Symbols -> c Symbols
$cp1Data :: Typeable Symbols
Data, Typeable)

instance SG.Semigroup Symbols where
  (Symbols s1 :: Set (SymValueInfo OrigName)
s1 t1 :: Set (SymTypeInfo OrigName)
t1) <> :: Symbols -> Symbols -> Symbols
<> (Symbols s2 :: Set (SymValueInfo OrigName)
s2 t2 :: Set (SymTypeInfo OrigName)
t2) =
    Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols (Set (SymValueInfo OrigName)
s1 Set (SymValueInfo OrigName)
-> Set (SymValueInfo OrigName) -> Set (SymValueInfo OrigName)
forall a. Semigroup a => a -> a -> a
<> Set (SymValueInfo OrigName)
s2) (Set (SymTypeInfo OrigName)
t1 Set (SymTypeInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Set (SymTypeInfo OrigName)
forall a. Semigroup a => a -> a -> a
<> Set (SymTypeInfo OrigName)
t2)

instance Monoid Symbols where
  mempty :: Symbols
mempty = Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols Set (SymValueInfo OrigName)
forall a. Monoid a => a
mempty Set (SymTypeInfo OrigName)
forall a. Monoid a => a
mempty
  mappend :: Symbols -> Symbols -> Symbols
mappend = Symbols -> Symbols -> Symbols
forall a. Semigroup a => a -> a -> a
(<>)

valSyms :: Lens Symbols (Set.Set (SymValueInfo OrigName))
valSyms :: Lens Symbols (Set (SymValueInfo OrigName))
valSyms = (Symbols -> Set (SymValueInfo OrigName))
-> (Set (SymValueInfo OrigName) -> Symbols -> Symbols)
-> Lens Symbols (Set (SymValueInfo OrigName))
forall a b. (a -> b) -> (b -> a -> a) -> Lens a b
lens (\(Symbols vs :: Set (SymValueInfo OrigName)
vs _) -> Set (SymValueInfo OrigName)
vs) (\vs :: Set (SymValueInfo OrigName)
vs (Symbols _ ts :: Set (SymTypeInfo OrigName)
ts) -> Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols Set (SymValueInfo OrigName)
vs Set (SymTypeInfo OrigName)
ts)

tySyms :: Lens Symbols (Set.Set (SymTypeInfo OrigName))
tySyms :: Lens Symbols (Set (SymTypeInfo OrigName))
tySyms = (Symbols -> Set (SymTypeInfo OrigName))
-> (Set (SymTypeInfo OrigName) -> Symbols -> Symbols)
-> Lens Symbols (Set (SymTypeInfo OrigName))
forall a b. (a -> b) -> (b -> a -> a) -> Lens a b
lens (\(Symbols _ ts :: Set (SymTypeInfo OrigName)
ts) -> Set (SymTypeInfo OrigName)
ts) (\ts :: Set (SymTypeInfo OrigName)
ts (Symbols vs :: Set (SymValueInfo OrigName)
vs _) -> Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols Set (SymValueInfo OrigName)
vs Set (SymTypeInfo OrigName)
ts)

mkVal :: SymValueInfo OrigName -> Symbols
mkVal :: SymValueInfo OrigName -> Symbols
mkVal i :: SymValueInfo OrigName
i = Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols (SymValueInfo OrigName -> Set (SymValueInfo OrigName)
forall a. a -> Set a
Set.singleton SymValueInfo OrigName
i) Set (SymTypeInfo OrigName)
forall a. Monoid a => a
mempty

mkTy :: SymTypeInfo OrigName -> Symbols
mkTy :: SymTypeInfo OrigName -> Symbols
mkTy i :: SymTypeInfo OrigName
i = Set (SymValueInfo OrigName)
-> Set (SymTypeInfo OrigName) -> Symbols
Symbols Set (SymValueInfo OrigName)
forall a. Monoid a => a
mempty (SymTypeInfo OrigName -> Set (SymTypeInfo OrigName)
forall a. a -> Set a
Set.singleton SymTypeInfo OrigName
i)

-- | String representing an unqualified entity name
type NameS = String
-- | String representing a module name
type ModuleNameS = String

-- | Possibly qualified name. If the name is not qualified,
-- 'ModuleNameS' is the empty string.
data GName = GName
  { GName -> String
gModule :: ModuleNameS
  , GName -> String
gName   :: NameS
  }
  deriving (GName -> GName -> Bool
(GName -> GName -> Bool) -> (GName -> GName -> Bool) -> Eq GName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GName -> GName -> Bool
$c/= :: GName -> GName -> Bool
== :: GName -> GName -> Bool
$c== :: GName -> GName -> Bool
Eq, Eq GName
Eq GName =>
(GName -> GName -> Ordering)
-> (GName -> GName -> Bool)
-> (GName -> GName -> Bool)
-> (GName -> GName -> Bool)
-> (GName -> GName -> Bool)
-> (GName -> GName -> GName)
-> (GName -> GName -> GName)
-> Ord GName
GName -> GName -> Bool
GName -> GName -> Ordering
GName -> GName -> GName
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GName -> GName -> GName
$cmin :: GName -> GName -> GName
max :: GName -> GName -> GName
$cmax :: GName -> GName -> GName
>= :: GName -> GName -> Bool
$c>= :: GName -> GName -> Bool
> :: GName -> GName -> Bool
$c> :: GName -> GName -> Bool
<= :: GName -> GName -> Bool
$c<= :: GName -> GName -> Bool
< :: GName -> GName -> Bool
$c< :: GName -> GName -> Bool
compare :: GName -> GName -> Ordering
$ccompare :: GName -> GName -> Ordering
$cp1Ord :: Eq GName
Ord, Int -> GName -> ShowS
[GName] -> ShowS
GName -> String
(Int -> GName -> ShowS)
-> (GName -> String) -> ([GName] -> ShowS) -> Show GName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GName] -> ShowS
$cshowList :: [GName] -> ShowS
show :: GName -> String
$cshow :: GName -> String
showsPrec :: Int -> GName -> ShowS
$cshowsPrec :: Int -> GName -> ShowS
Show, Typeable GName
DataType
Constr
Typeable GName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> GName -> c GName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c GName)
-> (GName -> Constr)
-> (GName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c GName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GName))
-> ((forall b. Data b => b -> b) -> GName -> GName)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r)
-> (forall u. (forall d. Data d => d -> u) -> GName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> GName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> GName -> m GName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> GName -> m GName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> GName -> m GName)
-> Data GName
GName -> DataType
GName -> Constr
(forall b. Data b => b -> b) -> GName -> GName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GName -> c GName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GName
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) -> GName -> u
forall u. (forall d. Data d => d -> u) -> GName -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GName -> m GName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GName -> m GName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GName -> c GName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GName)
$cGName :: Constr
$tGName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> GName -> m GName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GName -> m GName
gmapMp :: (forall d. Data d => d -> m d) -> GName -> m GName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> GName -> m GName
gmapM :: (forall d. Data d => d -> m d) -> GName -> m GName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> GName -> m GName
gmapQi :: Int -> (forall d. Data d => d -> u) -> GName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> GName -> u
gmapQ :: (forall d. Data d => d -> u) -> GName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> GName -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GName -> r
gmapT :: (forall b. Data b => b -> b) -> GName -> GName
$cgmapT :: (forall b. Data b => b -> b) -> GName -> GName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c GName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c GName)
dataTypeOf :: GName -> DataType
$cdataTypeOf :: GName -> DataType
toConstr :: GName -> Constr
$ctoConstr :: GName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c GName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GName -> c GName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> GName -> c GName
$cp1Data :: Typeable GName
Data, Typeable)

-- | Display a 'GName'
ppGName :: GName -> String
ppGName :: GName -> String
ppGName (GName mod :: String
mod name :: String
name) = String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s.%s" String
mod String
name

-- # if !MIN_VERSION_Cabal(1,17,0)
-- deriving instance Typeable PackageIdentifier
-- deriving instance Data PackageIdentifier
-- deriving instance Typeable PackageName
-- deriving instance Data PackageName
-- deriving instance Data Version
-- # endif

-- | Qualified name, where 'ModuleNameS' points to the module where the
-- name was originally defined. The module part is never empty.
--
-- Also contains name and version of the package where it was defined. If
-- it's 'Nothing', then the entity is defined in the \"current\" package.
data OrigName = OrigName
  { OrigName -> GName
origGName :: GName
  }
  deriving (OrigName -> OrigName -> Bool
(OrigName -> OrigName -> Bool)
-> (OrigName -> OrigName -> Bool) -> Eq OrigName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrigName -> OrigName -> Bool
$c/= :: OrigName -> OrigName -> Bool
== :: OrigName -> OrigName -> Bool
$c== :: OrigName -> OrigName -> Bool
Eq, Eq OrigName
Eq OrigName =>
(OrigName -> OrigName -> Ordering)
-> (OrigName -> OrigName -> Bool)
-> (OrigName -> OrigName -> Bool)
-> (OrigName -> OrigName -> Bool)
-> (OrigName -> OrigName -> Bool)
-> (OrigName -> OrigName -> OrigName)
-> (OrigName -> OrigName -> OrigName)
-> Ord OrigName
OrigName -> OrigName -> Bool
OrigName -> OrigName -> Ordering
OrigName -> OrigName -> OrigName
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: OrigName -> OrigName -> OrigName
$cmin :: OrigName -> OrigName -> OrigName
max :: OrigName -> OrigName -> OrigName
$cmax :: OrigName -> OrigName -> OrigName
>= :: OrigName -> OrigName -> Bool
$c>= :: OrigName -> OrigName -> Bool
> :: OrigName -> OrigName -> Bool
$c> :: OrigName -> OrigName -> Bool
<= :: OrigName -> OrigName -> Bool
$c<= :: OrigName -> OrigName -> Bool
< :: OrigName -> OrigName -> Bool
$c< :: OrigName -> OrigName -> Bool
compare :: OrigName -> OrigName -> Ordering
$ccompare :: OrigName -> OrigName -> Ordering
$cp1Ord :: Eq OrigName
Ord, Int -> OrigName -> ShowS
[OrigName] -> ShowS
OrigName -> String
(Int -> OrigName -> ShowS)
-> (OrigName -> String) -> ([OrigName] -> ShowS) -> Show OrigName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrigName] -> ShowS
$cshowList :: [OrigName] -> ShowS
show :: OrigName -> String
$cshow :: OrigName -> String
showsPrec :: Int -> OrigName -> ShowS
$cshowsPrec :: Int -> OrigName -> ShowS
Show, Typeable OrigName
DataType
Constr
Typeable OrigName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> OrigName -> c OrigName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c OrigName)
-> (OrigName -> Constr)
-> (OrigName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c OrigName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrigName))
-> ((forall b. Data b => b -> b) -> OrigName -> OrigName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OrigName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OrigName -> r)
-> (forall u. (forall d. Data d => d -> u) -> OrigName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> OrigName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OrigName -> m OrigName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OrigName -> m OrigName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OrigName -> m OrigName)
-> Data OrigName
OrigName -> DataType
OrigName -> Constr
(forall b. Data b => b -> b) -> OrigName -> OrigName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OrigName -> c OrigName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OrigName
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) -> OrigName -> u
forall u. (forall d. Data d => d -> u) -> OrigName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OrigName -> m OrigName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OrigName -> m OrigName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OrigName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OrigName -> c OrigName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OrigName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrigName)
$cOrigName :: Constr
$tOrigName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> OrigName -> m OrigName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OrigName -> m OrigName
gmapMp :: (forall d. Data d => d -> m d) -> OrigName -> m OrigName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OrigName -> m OrigName
gmapM :: (forall d. Data d => d -> m d) -> OrigName -> m OrigName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OrigName -> m OrigName
gmapQi :: Int -> (forall d. Data d => d -> u) -> OrigName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OrigName -> u
gmapQ :: (forall d. Data d => d -> u) -> OrigName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> OrigName -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OrigName -> r
gmapT :: (forall b. Data b => b -> b) -> OrigName -> OrigName
$cgmapT :: (forall b. Data b => b -> b) -> OrigName -> OrigName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrigName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OrigName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c OrigName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OrigName)
dataTypeOf :: OrigName -> DataType
$cdataTypeOf :: OrigName -> DataType
toConstr :: OrigName -> Constr
$ctoConstr :: OrigName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OrigName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OrigName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OrigName -> c OrigName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OrigName -> c OrigName
$cp1Data :: Typeable OrigName
Data, Typeable)

-- | Display an 'OrigName'
ppOrigName :: OrigName -> String
ppOrigName :: OrigName -> String
ppOrigName (OrigName gname :: GName
gname) = GName -> String
ppGName GName
gname

-- | A pair of the name information and original annotation. Used as an
-- annotation type for AST.
data Scoped l = Scoped (NameInfo l) l
  deriving (a -> Scoped b -> Scoped a
(a -> b) -> Scoped a -> Scoped b
(forall a b. (a -> b) -> Scoped a -> Scoped b)
-> (forall a b. a -> Scoped b -> Scoped a) -> Functor Scoped
forall a b. a -> Scoped b -> Scoped a
forall a b. (a -> b) -> Scoped a -> Scoped b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Scoped b -> Scoped a
$c<$ :: forall a b. a -> Scoped b -> Scoped a
fmap :: (a -> b) -> Scoped a -> Scoped b
$cfmap :: forall a b. (a -> b) -> Scoped a -> Scoped b
Functor, Scoped a -> Bool
(a -> m) -> Scoped a -> m
(a -> b -> b) -> b -> Scoped a -> b
(forall m. Monoid m => Scoped m -> m)
-> (forall m a. Monoid m => (a -> m) -> Scoped a -> m)
-> (forall m a. Monoid m => (a -> m) -> Scoped a -> m)
-> (forall a b. (a -> b -> b) -> b -> Scoped a -> b)
-> (forall a b. (a -> b -> b) -> b -> Scoped a -> b)
-> (forall b a. (b -> a -> b) -> b -> Scoped a -> b)
-> (forall b a. (b -> a -> b) -> b -> Scoped a -> b)
-> (forall a. (a -> a -> a) -> Scoped a -> a)
-> (forall a. (a -> a -> a) -> Scoped a -> a)
-> (forall a. Scoped a -> [a])
-> (forall a. Scoped a -> Bool)
-> (forall a. Scoped a -> Int)
-> (forall a. Eq a => a -> Scoped a -> Bool)
-> (forall a. Ord a => Scoped a -> a)
-> (forall a. Ord a => Scoped a -> a)
-> (forall a. Num a => Scoped a -> a)
-> (forall a. Num a => Scoped a -> a)
-> Foldable Scoped
forall a. Eq a => a -> Scoped a -> Bool
forall a. Num a => Scoped a -> a
forall a. Ord a => Scoped a -> a
forall m. Monoid m => Scoped m -> m
forall a. Scoped a -> Bool
forall a. Scoped a -> Int
forall a. Scoped a -> [a]
forall a. (a -> a -> a) -> Scoped a -> a
forall m a. Monoid m => (a -> m) -> Scoped a -> m
forall b a. (b -> a -> b) -> b -> Scoped a -> b
forall a b. (a -> b -> b) -> b -> Scoped 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 :: Scoped a -> a
$cproduct :: forall a. Num a => Scoped a -> a
sum :: Scoped a -> a
$csum :: forall a. Num a => Scoped a -> a
minimum :: Scoped a -> a
$cminimum :: forall a. Ord a => Scoped a -> a
maximum :: Scoped a -> a
$cmaximum :: forall a. Ord a => Scoped a -> a
elem :: a -> Scoped a -> Bool
$celem :: forall a. Eq a => a -> Scoped a -> Bool
length :: Scoped a -> Int
$clength :: forall a. Scoped a -> Int
null :: Scoped a -> Bool
$cnull :: forall a. Scoped a -> Bool
toList :: Scoped a -> [a]
$ctoList :: forall a. Scoped a -> [a]
foldl1 :: (a -> a -> a) -> Scoped a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Scoped a -> a
foldr1 :: (a -> a -> a) -> Scoped a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Scoped a -> a
foldl' :: (b -> a -> b) -> b -> Scoped a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Scoped a -> b
foldl :: (b -> a -> b) -> b -> Scoped a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Scoped a -> b
foldr' :: (a -> b -> b) -> b -> Scoped a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Scoped a -> b
foldr :: (a -> b -> b) -> b -> Scoped a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Scoped a -> b
foldMap' :: (a -> m) -> Scoped a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Scoped a -> m
foldMap :: (a -> m) -> Scoped a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Scoped a -> m
fold :: Scoped m -> m
$cfold :: forall m. Monoid m => Scoped m -> m
Foldable, Functor Scoped
Foldable Scoped
(Functor Scoped, Foldable Scoped) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> Scoped a -> f (Scoped b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Scoped (f a) -> f (Scoped a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Scoped a -> m (Scoped b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Scoped (m a) -> m (Scoped a))
-> Traversable Scoped
(a -> f b) -> Scoped a -> f (Scoped 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 => Scoped (m a) -> m (Scoped a)
forall (f :: * -> *) a.
Applicative f =>
Scoped (f a) -> f (Scoped a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Scoped a -> m (Scoped b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Scoped a -> f (Scoped b)
sequence :: Scoped (m a) -> m (Scoped a)
$csequence :: forall (m :: * -> *) a. Monad m => Scoped (m a) -> m (Scoped a)
mapM :: (a -> m b) -> Scoped a -> m (Scoped b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Scoped a -> m (Scoped b)
sequenceA :: Scoped (f a) -> f (Scoped a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Scoped (f a) -> f (Scoped a)
traverse :: (a -> f b) -> Scoped a -> f (Scoped b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Scoped a -> f (Scoped b)
$cp2Traversable :: Foldable Scoped
$cp1Traversable :: Functor Scoped
Traversable, Int -> Scoped l -> ShowS
[Scoped l] -> ShowS
Scoped l -> String
(Int -> Scoped l -> ShowS)
-> (Scoped l -> String) -> ([Scoped l] -> ShowS) -> Show (Scoped l)
forall l. Show l => Int -> Scoped l -> ShowS
forall l. Show l => [Scoped l] -> ShowS
forall l. Show l => Scoped l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scoped l] -> ShowS
$cshowList :: forall l. Show l => [Scoped l] -> ShowS
show :: Scoped l -> String
$cshow :: forall l. Show l => Scoped l -> String
showsPrec :: Int -> Scoped l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> Scoped l -> ShowS
Show, Typeable, Typeable (Scoped l)
DataType
Constr
Typeable (Scoped l) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Scoped l -> c (Scoped l))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Scoped l))
-> (Scoped l -> Constr)
-> (Scoped l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Scoped l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Scoped l)))
-> ((forall b. Data b => b -> b) -> Scoped l -> Scoped l)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Scoped l -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Scoped l -> r)
-> (forall u. (forall d. Data d => d -> u) -> Scoped l -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Scoped l -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l))
-> Data (Scoped l)
Scoped l -> DataType
Scoped l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Scoped l))
(forall b. Data b => b -> b) -> Scoped l -> Scoped l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Scoped l -> c (Scoped l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Scoped l)
forall l. Data l => Typeable (Scoped l)
forall l. Data l => Scoped l -> DataType
forall l. Data l => Scoped l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b) -> Scoped l -> Scoped l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> Scoped l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> Scoped l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Scoped l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Scoped l -> c (Scoped l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Scoped l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Scoped l))
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) -> Scoped l -> u
forall u. (forall d. Data d => d -> u) -> Scoped l -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Scoped l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Scoped l -> c (Scoped l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Scoped l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Scoped l))
$cScoped :: Constr
$tScoped :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
gmapMp :: (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
gmapM :: (forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> Scoped l -> m (Scoped l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Scoped l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> Scoped l -> u
gmapQ :: (forall d. Data d => d -> u) -> Scoped l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> Scoped l -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Scoped l -> r
gmapT :: (forall b. Data b => b -> b) -> Scoped l -> Scoped l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b) -> Scoped l -> Scoped l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Scoped l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Scoped l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Scoped l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Scoped l))
dataTypeOf :: Scoped l -> DataType
$cdataTypeOf :: forall l. Data l => Scoped l -> DataType
toConstr :: Scoped l -> Constr
$ctoConstr :: forall l. Data l => Scoped l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Scoped l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Scoped l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Scoped l -> c (Scoped l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Scoped l -> c (Scoped l)
$cp1Data :: forall l. Data l => Typeable (Scoped l)
Data, Scoped l -> Scoped l -> Bool
(Scoped l -> Scoped l -> Bool)
-> (Scoped l -> Scoped l -> Bool) -> Eq (Scoped l)
forall l. Eq l => Scoped l -> Scoped l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scoped l -> Scoped l -> Bool
$c/= :: forall l. Eq l => Scoped l -> Scoped l -> Bool
== :: Scoped l -> Scoped l -> Bool
$c== :: forall l. Eq l => Scoped l -> Scoped l -> Bool
Eq, Eq (Scoped l)
Eq (Scoped l) =>
(Scoped l -> Scoped l -> Ordering)
-> (Scoped l -> Scoped l -> Bool)
-> (Scoped l -> Scoped l -> Bool)
-> (Scoped l -> Scoped l -> Bool)
-> (Scoped l -> Scoped l -> Bool)
-> (Scoped l -> Scoped l -> Scoped l)
-> (Scoped l -> Scoped l -> Scoped l)
-> Ord (Scoped l)
Scoped l -> Scoped l -> Bool
Scoped l -> Scoped l -> Ordering
Scoped l -> Scoped l -> Scoped l
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (Scoped l)
forall l. Ord l => Scoped l -> Scoped l -> Bool
forall l. Ord l => Scoped l -> Scoped l -> Ordering
forall l. Ord l => Scoped l -> Scoped l -> Scoped l
min :: Scoped l -> Scoped l -> Scoped l
$cmin :: forall l. Ord l => Scoped l -> Scoped l -> Scoped l
max :: Scoped l -> Scoped l -> Scoped l
$cmax :: forall l. Ord l => Scoped l -> Scoped l -> Scoped l
>= :: Scoped l -> Scoped l -> Bool
$c>= :: forall l. Ord l => Scoped l -> Scoped l -> Bool
> :: Scoped l -> Scoped l -> Bool
$c> :: forall l. Ord l => Scoped l -> Scoped l -> Bool
<= :: Scoped l -> Scoped l -> Bool
$c<= :: forall l. Ord l => Scoped l -> Scoped l -> Bool
< :: Scoped l -> Scoped l -> Bool
$c< :: forall l. Ord l => Scoped l -> Scoped l -> Bool
compare :: Scoped l -> Scoped l -> Ordering
$ccompare :: forall l. Ord l => Scoped l -> Scoped l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (Scoped l)
Ord)

data NameInfo l
    = GlobalValue (SymValueInfo OrigName) -- ^ global value
    | GlobalType  (SymTypeInfo  OrigName) -- ^ global type
    | LocalValue  SrcLoc -- ^ local value, and location where it is bound
    | TypeVar     SrcLoc -- ^ type variable, and location where it is bound
    | ValueBinder -- ^ here the value name is bound
    | TypeBinder  -- ^ here the type name is defined
    | Import      Global.Table
      -- ^ @import@ declaration, and the table of symbols that it
      -- introduces
    | ImportPart  Symbols
      -- ^ part of an @import@ declaration
    | Export      Symbols
      -- ^ @export@ declaration, and the symbols it exports
    | RecPatWildcard [OrigName]
      -- ^ wildcard in a record pattern. The list contains resolved names
      -- of the fields that are brought in scope by this pattern.
    | RecExpWildcard [(OrigName, NameInfo l)]
      -- ^ wildcard in a record construction expression. The list contains
      -- resolved names of the fields and information about values
      -- assigned to those fields.
    | None
      -- ^ no annotation
    | ScopeError  (Error l)
      -- ^ scope error
    deriving (a -> NameInfo b -> NameInfo a
(a -> b) -> NameInfo a -> NameInfo b
(forall a b. (a -> b) -> NameInfo a -> NameInfo b)
-> (forall a b. a -> NameInfo b -> NameInfo a) -> Functor NameInfo
forall a b. a -> NameInfo b -> NameInfo a
forall a b. (a -> b) -> NameInfo a -> NameInfo b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> NameInfo b -> NameInfo a
$c<$ :: forall a b. a -> NameInfo b -> NameInfo a
fmap :: (a -> b) -> NameInfo a -> NameInfo b
$cfmap :: forall a b. (a -> b) -> NameInfo a -> NameInfo b
Functor, NameInfo a -> Bool
(a -> m) -> NameInfo a -> m
(a -> b -> b) -> b -> NameInfo a -> b
(forall m. Monoid m => NameInfo m -> m)
-> (forall m a. Monoid m => (a -> m) -> NameInfo a -> m)
-> (forall m a. Monoid m => (a -> m) -> NameInfo a -> m)
-> (forall a b. (a -> b -> b) -> b -> NameInfo a -> b)
-> (forall a b. (a -> b -> b) -> b -> NameInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> NameInfo a -> b)
-> (forall b a. (b -> a -> b) -> b -> NameInfo a -> b)
-> (forall a. (a -> a -> a) -> NameInfo a -> a)
-> (forall a. (a -> a -> a) -> NameInfo a -> a)
-> (forall a. NameInfo a -> [a])
-> (forall a. NameInfo a -> Bool)
-> (forall a. NameInfo a -> Int)
-> (forall a. Eq a => a -> NameInfo a -> Bool)
-> (forall a. Ord a => NameInfo a -> a)
-> (forall a. Ord a => NameInfo a -> a)
-> (forall a. Num a => NameInfo a -> a)
-> (forall a. Num a => NameInfo a -> a)
-> Foldable NameInfo
forall a. Eq a => a -> NameInfo a -> Bool
forall a. Num a => NameInfo a -> a
forall a. Ord a => NameInfo a -> a
forall m. Monoid m => NameInfo m -> m
forall a. NameInfo a -> Bool
forall a. NameInfo a -> Int
forall a. NameInfo a -> [a]
forall a. (a -> a -> a) -> NameInfo a -> a
forall m a. Monoid m => (a -> m) -> NameInfo a -> m
forall b a. (b -> a -> b) -> b -> NameInfo a -> b
forall a b. (a -> b -> b) -> b -> NameInfo 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 :: NameInfo a -> a
$cproduct :: forall a. Num a => NameInfo a -> a
sum :: NameInfo a -> a
$csum :: forall a. Num a => NameInfo a -> a
minimum :: NameInfo a -> a
$cminimum :: forall a. Ord a => NameInfo a -> a
maximum :: NameInfo a -> a
$cmaximum :: forall a. Ord a => NameInfo a -> a
elem :: a -> NameInfo a -> Bool
$celem :: forall a. Eq a => a -> NameInfo a -> Bool
length :: NameInfo a -> Int
$clength :: forall a. NameInfo a -> Int
null :: NameInfo a -> Bool
$cnull :: forall a. NameInfo a -> Bool
toList :: NameInfo a -> [a]
$ctoList :: forall a. NameInfo a -> [a]
foldl1 :: (a -> a -> a) -> NameInfo a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> NameInfo a -> a
foldr1 :: (a -> a -> a) -> NameInfo a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> NameInfo a -> a
foldl' :: (b -> a -> b) -> b -> NameInfo a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> NameInfo a -> b
foldl :: (b -> a -> b) -> b -> NameInfo a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> NameInfo a -> b
foldr' :: (a -> b -> b) -> b -> NameInfo a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> NameInfo a -> b
foldr :: (a -> b -> b) -> b -> NameInfo a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> NameInfo a -> b
foldMap' :: (a -> m) -> NameInfo a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> NameInfo a -> m
foldMap :: (a -> m) -> NameInfo a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> NameInfo a -> m
fold :: NameInfo m -> m
$cfold :: forall m. Monoid m => NameInfo m -> m
Foldable, Functor NameInfo
Foldable NameInfo
(Functor NameInfo, Foldable NameInfo) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> NameInfo a -> f (NameInfo b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    NameInfo (f a) -> f (NameInfo a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> NameInfo a -> m (NameInfo b))
-> (forall (m :: * -> *) a.
    Monad m =>
    NameInfo (m a) -> m (NameInfo a))
-> Traversable NameInfo
(a -> f b) -> NameInfo a -> f (NameInfo 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 => NameInfo (m a) -> m (NameInfo a)
forall (f :: * -> *) a.
Applicative f =>
NameInfo (f a) -> f (NameInfo a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NameInfo a -> m (NameInfo b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NameInfo a -> f (NameInfo b)
sequence :: NameInfo (m a) -> m (NameInfo a)
$csequence :: forall (m :: * -> *) a. Monad m => NameInfo (m a) -> m (NameInfo a)
mapM :: (a -> m b) -> NameInfo a -> m (NameInfo b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> NameInfo a -> m (NameInfo b)
sequenceA :: NameInfo (f a) -> f (NameInfo a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
NameInfo (f a) -> f (NameInfo a)
traverse :: (a -> f b) -> NameInfo a -> f (NameInfo b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> NameInfo a -> f (NameInfo b)
$cp2Traversable :: Foldable NameInfo
$cp1Traversable :: Functor NameInfo
Traversable, Int -> NameInfo l -> ShowS
[NameInfo l] -> ShowS
NameInfo l -> String
(Int -> NameInfo l -> ShowS)
-> (NameInfo l -> String)
-> ([NameInfo l] -> ShowS)
-> Show (NameInfo l)
forall l. Show l => Int -> NameInfo l -> ShowS
forall l. Show l => [NameInfo l] -> ShowS
forall l. Show l => NameInfo l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NameInfo l] -> ShowS
$cshowList :: forall l. Show l => [NameInfo l] -> ShowS
show :: NameInfo l -> String
$cshow :: forall l. Show l => NameInfo l -> String
showsPrec :: Int -> NameInfo l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> NameInfo l -> ShowS
Show, Typeable, Typeable (NameInfo l)
DataType
Constr
Typeable (NameInfo l) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (NameInfo l))
-> (NameInfo l -> Constr)
-> (NameInfo l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (NameInfo l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (NameInfo l)))
-> ((forall b. Data b => b -> b) -> NameInfo l -> NameInfo l)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NameInfo l -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NameInfo l -> r)
-> (forall u. (forall d. Data d => d -> u) -> NameInfo l -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NameInfo l -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l))
-> Data (NameInfo l)
NameInfo l -> DataType
NameInfo l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (NameInfo l))
(forall b. Data b => b -> b) -> NameInfo l -> NameInfo l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NameInfo l)
forall l. Data l => Typeable (NameInfo l)
forall l. Data l => NameInfo l -> DataType
forall l. Data l => NameInfo l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b) -> NameInfo l -> NameInfo l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> NameInfo l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> NameInfo l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NameInfo l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (NameInfo l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NameInfo l))
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) -> NameInfo l -> u
forall u. (forall d. Data d => d -> u) -> NameInfo l -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NameInfo l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (NameInfo l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NameInfo l))
$cScopeError :: Constr
$cNone :: Constr
$cRecExpWildcard :: Constr
$cRecPatWildcard :: Constr
$cExport :: Constr
$cImportPart :: Constr
$cImport :: Constr
$cTypeBinder :: Constr
$cValueBinder :: Constr
$cTypeVar :: Constr
$cLocalValue :: Constr
$cGlobalType :: Constr
$cGlobalValue :: Constr
$tNameInfo :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
gmapMp :: (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
gmapM :: (forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> NameInfo l -> m (NameInfo l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> NameInfo l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> NameInfo l -> u
gmapQ :: (forall d. Data d => d -> u) -> NameInfo l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> NameInfo l -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameInfo l -> r
gmapT :: (forall b. Data b => b -> b) -> NameInfo l -> NameInfo l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b) -> NameInfo l -> NameInfo l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NameInfo l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (NameInfo l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (NameInfo l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (NameInfo l))
dataTypeOf :: NameInfo l -> DataType
$cdataTypeOf :: forall l. Data l => NameInfo l -> DataType
toConstr :: NameInfo l -> Constr
$ctoConstr :: forall l. Data l => NameInfo l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NameInfo l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (NameInfo l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameInfo l -> c (NameInfo l)
$cp1Data :: forall l. Data l => Typeable (NameInfo l)
Data, NameInfo l -> NameInfo l -> Bool
(NameInfo l -> NameInfo l -> Bool)
-> (NameInfo l -> NameInfo l -> Bool) -> Eq (NameInfo l)
forall l. Eq l => NameInfo l -> NameInfo l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NameInfo l -> NameInfo l -> Bool
$c/= :: forall l. Eq l => NameInfo l -> NameInfo l -> Bool
== :: NameInfo l -> NameInfo l -> Bool
$c== :: forall l. Eq l => NameInfo l -> NameInfo l -> Bool
Eq, Eq (NameInfo l)
Eq (NameInfo l) =>
(NameInfo l -> NameInfo l -> Ordering)
-> (NameInfo l -> NameInfo l -> Bool)
-> (NameInfo l -> NameInfo l -> Bool)
-> (NameInfo l -> NameInfo l -> Bool)
-> (NameInfo l -> NameInfo l -> Bool)
-> (NameInfo l -> NameInfo l -> NameInfo l)
-> (NameInfo l -> NameInfo l -> NameInfo l)
-> Ord (NameInfo l)
NameInfo l -> NameInfo l -> Bool
NameInfo l -> NameInfo l -> Ordering
NameInfo l -> NameInfo l -> NameInfo l
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (NameInfo l)
forall l. Ord l => NameInfo l -> NameInfo l -> Bool
forall l. Ord l => NameInfo l -> NameInfo l -> Ordering
forall l. Ord l => NameInfo l -> NameInfo l -> NameInfo l
min :: NameInfo l -> NameInfo l -> NameInfo l
$cmin :: forall l. Ord l => NameInfo l -> NameInfo l -> NameInfo l
max :: NameInfo l -> NameInfo l -> NameInfo l
$cmax :: forall l. Ord l => NameInfo l -> NameInfo l -> NameInfo l
>= :: NameInfo l -> NameInfo l -> Bool
$c>= :: forall l. Ord l => NameInfo l -> NameInfo l -> Bool
> :: NameInfo l -> NameInfo l -> Bool
$c> :: forall l. Ord l => NameInfo l -> NameInfo l -> Bool
<= :: NameInfo l -> NameInfo l -> Bool
$c<= :: forall l. Ord l => NameInfo l -> NameInfo l -> Bool
< :: NameInfo l -> NameInfo l -> Bool
$c< :: forall l. Ord l => NameInfo l -> NameInfo l -> Bool
compare :: NameInfo l -> NameInfo l -> Ordering
$ccompare :: forall l. Ord l => NameInfo l -> NameInfo l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (NameInfo l)
Ord)

data Error l
  = ENotInScope (QName l) -- FIXME annotate with namespace (types/values)
    -- ^ name is not in scope
  | EAmbiguous (QName l) [OrigName]
    -- ^ name is ambiguous
  | ETypeAsClass (QName l)
    -- ^ type is used where a type class is expected
  | EClassAsType (QName l)
    -- ^ type class is used where a type is expected
  | ENotExported
      (Maybe (Name l)) --
      (Name l)         --
      (ModuleName l)
    -- ^ Attempt to explicitly import a name which is not exported (or,
    -- possibly, does not even exist). For example:
    --
    -- >import Prelude(Bool(Right))
    --
    -- The fields are:
    --
    -- 1. optional parent in the import list, e.g. @Bool@ in @Bool(Right)@
    --
    -- 2. the name which is not exported
    --
    -- 3. the module which does not export the name
  | EModNotFound (ModuleName l)
    -- ^ module not found
  | EInternal String
    -- ^ internal error
  deriving (Typeable (Error l)
DataType
Constr
Typeable (Error l) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Error l -> c (Error l))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Error l))
-> (Error l -> Constr)
-> (Error l -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Error l)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Error l)))
-> ((forall b. Data b => b -> b) -> Error l -> Error l)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Error l -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Error l -> r)
-> (forall u. (forall d. Data d => d -> u) -> Error l -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Error l -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Error l -> m (Error l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Error l -> m (Error l))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Error l -> m (Error l))
-> Data (Error l)
Error l -> DataType
Error l -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Error l))
(forall b. Data b => b -> b) -> Error l -> Error l
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Error l -> c (Error l)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Error l)
forall l. Data l => Typeable (Error l)
forall l. Data l => Error l -> DataType
forall l. Data l => Error l -> Constr
forall l.
Data l =>
(forall b. Data b => b -> b) -> Error l -> Error l
forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> Error l -> u
forall l u.
Data l =>
(forall d. Data d => d -> u) -> Error l -> [u]
forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Error l)
forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Error l -> c (Error l)
forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Error l))
forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Error l))
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) -> Error l -> u
forall u. (forall d. Data d => d -> u) -> Error l -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Error l)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Error l -> c (Error l)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Error l))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Error l))
$cEInternal :: Constr
$cEModNotFound :: Constr
$cENotExported :: Constr
$cEClassAsType :: Constr
$cETypeAsClass :: Constr
$cEAmbiguous :: Constr
$cENotInScope :: Constr
$tError :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Error l -> m (Error l)
$cgmapMo :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
gmapMp :: (forall d. Data d => d -> m d) -> Error l -> m (Error l)
$cgmapMp :: forall l (m :: * -> *).
(Data l, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
gmapM :: (forall d. Data d => d -> m d) -> Error l -> m (Error l)
$cgmapM :: forall l (m :: * -> *).
(Data l, Monad m) =>
(forall d. Data d => d -> m d) -> Error l -> m (Error l)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Error l -> u
$cgmapQi :: forall l u.
Data l =>
Int -> (forall d. Data d => d -> u) -> Error l -> u
gmapQ :: (forall d. Data d => d -> u) -> Error l -> [u]
$cgmapQ :: forall l u.
Data l =>
(forall d. Data d => d -> u) -> Error l -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
$cgmapQr :: forall l r r'.
Data l =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
$cgmapQl :: forall l r r'.
Data l =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Error l -> r
gmapT :: (forall b. Data b => b -> b) -> Error l -> Error l
$cgmapT :: forall l.
Data l =>
(forall b. Data b => b -> b) -> Error l -> Error l
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Error l))
$cdataCast2 :: forall l (t :: * -> * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Error l))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Error l))
$cdataCast1 :: forall l (t :: * -> *) (c :: * -> *).
(Data l, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Error l))
dataTypeOf :: Error l -> DataType
$cdataTypeOf :: forall l. Data l => Error l -> DataType
toConstr :: Error l -> Constr
$ctoConstr :: forall l. Data l => Error l -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Error l)
$cgunfold :: forall l (c :: * -> *).
Data l =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Error l)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Error l -> c (Error l)
$cgfoldl :: forall l (c :: * -> *).
Data l =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Error l -> c (Error l)
$cp1Data :: forall l. Data l => Typeable (Error l)
Data, Typeable, Int -> Error l -> ShowS
[Error l] -> ShowS
Error l -> String
(Int -> Error l -> ShowS)
-> (Error l -> String) -> ([Error l] -> ShowS) -> Show (Error l)
forall l. Show l => Int -> Error l -> ShowS
forall l. Show l => [Error l] -> ShowS
forall l. Show l => Error l -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Error l] -> ShowS
$cshowList :: forall l. Show l => [Error l] -> ShowS
show :: Error l -> String
$cshow :: forall l. Show l => Error l -> String
showsPrec :: Int -> Error l -> ShowS
$cshowsPrec :: forall l. Show l => Int -> Error l -> ShowS
Show, a -> Error b -> Error a
(a -> b) -> Error a -> Error b
(forall a b. (a -> b) -> Error a -> Error b)
-> (forall a b. a -> Error b -> Error a) -> Functor Error
forall a b. a -> Error b -> Error a
forall a b. (a -> b) -> Error a -> Error b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Error b -> Error a
$c<$ :: forall a b. a -> Error b -> Error a
fmap :: (a -> b) -> Error a -> Error b
$cfmap :: forall a b. (a -> b) -> Error a -> Error b
Functor, Error a -> Bool
(a -> m) -> Error a -> m
(a -> b -> b) -> b -> Error a -> b
(forall m. Monoid m => Error m -> m)
-> (forall m a. Monoid m => (a -> m) -> Error a -> m)
-> (forall m a. Monoid m => (a -> m) -> Error a -> m)
-> (forall a b. (a -> b -> b) -> b -> Error a -> b)
-> (forall a b. (a -> b -> b) -> b -> Error a -> b)
-> (forall b a. (b -> a -> b) -> b -> Error a -> b)
-> (forall b a. (b -> a -> b) -> b -> Error a -> b)
-> (forall a. (a -> a -> a) -> Error a -> a)
-> (forall a. (a -> a -> a) -> Error a -> a)
-> (forall a. Error a -> [a])
-> (forall a. Error a -> Bool)
-> (forall a. Error a -> Int)
-> (forall a. Eq a => a -> Error a -> Bool)
-> (forall a. Ord a => Error a -> a)
-> (forall a. Ord a => Error a -> a)
-> (forall a. Num a => Error a -> a)
-> (forall a. Num a => Error a -> a)
-> Foldable Error
forall a. Eq a => a -> Error a -> Bool
forall a. Num a => Error a -> a
forall a. Ord a => Error a -> a
forall m. Monoid m => Error m -> m
forall a. Error a -> Bool
forall a. Error a -> Int
forall a. Error a -> [a]
forall a. (a -> a -> a) -> Error a -> a
forall m a. Monoid m => (a -> m) -> Error a -> m
forall b a. (b -> a -> b) -> b -> Error a -> b
forall a b. (a -> b -> b) -> b -> Error 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 :: Error a -> a
$cproduct :: forall a. Num a => Error a -> a
sum :: Error a -> a
$csum :: forall a. Num a => Error a -> a
minimum :: Error a -> a
$cminimum :: forall a. Ord a => Error a -> a
maximum :: Error a -> a
$cmaximum :: forall a. Ord a => Error a -> a
elem :: a -> Error a -> Bool
$celem :: forall a. Eq a => a -> Error a -> Bool
length :: Error a -> Int
$clength :: forall a. Error a -> Int
null :: Error a -> Bool
$cnull :: forall a. Error a -> Bool
toList :: Error a -> [a]
$ctoList :: forall a. Error a -> [a]
foldl1 :: (a -> a -> a) -> Error a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Error a -> a
foldr1 :: (a -> a -> a) -> Error a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Error a -> a
foldl' :: (b -> a -> b) -> b -> Error a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Error a -> b
foldl :: (b -> a -> b) -> b -> Error a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Error a -> b
foldr' :: (a -> b -> b) -> b -> Error a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Error a -> b
foldr :: (a -> b -> b) -> b -> Error a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Error a -> b
foldMap' :: (a -> m) -> Error a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Error a -> m
foldMap :: (a -> m) -> Error a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Error a -> m
fold :: Error m -> m
$cfold :: forall m. Monoid m => Error m -> m
Foldable, Functor Error
Foldable Error
(Functor Error, Foldable Error) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> Error a -> f (Error b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Error (f a) -> f (Error a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Error a -> m (Error b))
-> (forall (m :: * -> *) a. Monad m => Error (m a) -> m (Error a))
-> Traversable Error
(a -> f b) -> Error a -> f (Error 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 => Error (m a) -> m (Error a)
forall (f :: * -> *) a. Applicative f => Error (f a) -> f (Error a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Error a -> m (Error b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Error a -> f (Error b)
sequence :: Error (m a) -> m (Error a)
$csequence :: forall (m :: * -> *) a. Monad m => Error (m a) -> m (Error a)
mapM :: (a -> m b) -> Error a -> m (Error b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Error a -> m (Error b)
sequenceA :: Error (f a) -> f (Error a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Error (f a) -> f (Error a)
traverse :: (a -> f b) -> Error a -> f (Error b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Error a -> f (Error b)
$cp2Traversable :: Foldable Error
$cp1Traversable :: Functor Error
Traversable, Error l -> Error l -> Bool
(Error l -> Error l -> Bool)
-> (Error l -> Error l -> Bool) -> Eq (Error l)
forall l. Eq l => Error l -> Error l -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Error l -> Error l -> Bool
$c/= :: forall l. Eq l => Error l -> Error l -> Bool
== :: Error l -> Error l -> Bool
$c== :: forall l. Eq l => Error l -> Error l -> Bool
Eq, Eq (Error l)
Eq (Error l) =>
(Error l -> Error l -> Ordering)
-> (Error l -> Error l -> Bool)
-> (Error l -> Error l -> Bool)
-> (Error l -> Error l -> Bool)
-> (Error l -> Error l -> Bool)
-> (Error l -> Error l -> Error l)
-> (Error l -> Error l -> Error l)
-> Ord (Error l)
Error l -> Error l -> Bool
Error l -> Error l -> Ordering
Error l -> Error l -> Error l
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall l. Ord l => Eq (Error l)
forall l. Ord l => Error l -> Error l -> Bool
forall l. Ord l => Error l -> Error l -> Ordering
forall l. Ord l => Error l -> Error l -> Error l
min :: Error l -> Error l -> Error l
$cmin :: forall l. Ord l => Error l -> Error l -> Error l
max :: Error l -> Error l -> Error l
$cmax :: forall l. Ord l => Error l -> Error l -> Error l
>= :: Error l -> Error l -> Bool
$c>= :: forall l. Ord l => Error l -> Error l -> Bool
> :: Error l -> Error l -> Bool
$c> :: forall l. Ord l => Error l -> Error l -> Bool
<= :: Error l -> Error l -> Bool
$c<= :: forall l. Ord l => Error l -> Error l -> Bool
< :: Error l -> Error l -> Bool
$c< :: forall l. Ord l => Error l -> Error l -> Bool
compare :: Error l -> Error l -> Ordering
$ccompare :: forall l. Ord l => Error l -> Error l -> Ordering
$cp1Ord :: forall l. Ord l => Eq (Error l)
Ord)

-- | Display an error.
--
-- Note: can span multiple lines; the trailing newline is included.
ppError :: SrcInfo l => Error l -> String
ppError :: Error l -> String
ppError e :: Error l
e =
  case Error l
e of
    ENotInScope qn :: QName l
qn -> String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: not in scope: %s\n"
      (QName l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc QName l
qn)
      (QName l -> String
forall a. Pretty a => a -> String
prettyPrint QName l
qn)
    EAmbiguous qn :: QName l
qn names :: [OrigName]
names ->
      String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: ambiguous name %s\nIt may refer to:\n"
        (QName l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc QName l
qn)
        (QName l -> String
forall a. Pretty a => a -> String
prettyPrint QName l
qn)
      String -> ShowS
forall a. [a] -> [a] -> [a]
++
        [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
F.concat ((OrigName -> String) -> [OrigName] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String -> ShowS
forall r. PrintfType r => String -> r
printf "  %s\n" ShowS -> (OrigName -> String) -> OrigName -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OrigName -> String
ppOrigName) [OrigName]
names)
    ETypeAsClass qn :: QName l
qn ->
      String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: type %s is used where a class is expected\n"
        (QName l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc QName l
qn)
        (QName l -> String
forall a. Pretty a => a -> String
prettyPrint QName l
qn)
    EClassAsType qn :: QName l
qn ->
      String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: class %s is used where a type is expected\n"
        (QName l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc QName l
qn)
        (QName l -> String
forall a. Pretty a => a -> String
prettyPrint QName l
qn)
    ENotExported _mbParent :: Maybe (Name l)
_mbParent name :: Name l
name mod :: ModuleName l
mod ->
      String -> String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: %s does not export %s\n"
        (Name l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc Name l
name)
        (ModuleName l -> String
forall a. Pretty a => a -> String
prettyPrint ModuleName l
mod)
        (Name l -> String
forall a. Pretty a => a -> String
prettyPrint Name l
name)
        -- FIXME: make use of mbParent
    EModNotFound mod :: ModuleName l
mod ->
      String -> String -> ShowS
forall r. PrintfType r => String -> r
printf "%s: module not found: %s\n"
        (ModuleName l -> String
forall (a :: * -> *) l. (Annotated a, SrcInfo l) => a l -> String
ppLoc ModuleName l
mod)
        (ModuleName l -> String
forall a. Pretty a => a -> String
prettyPrint ModuleName l
mod)
    EInternal s :: String
s -> String -> ShowS
forall r. PrintfType r => String -> r
printf "Internal error: %s\n" String
s

  where
    ppLoc :: (Annotated a, SrcInfo l) => a l -> String
    ppLoc :: a l -> String
ppLoc = SrcLoc -> String
forall a. Pretty a => a -> String
prettyPrint (SrcLoc -> String) -> (a l -> SrcLoc) -> a l -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. l -> SrcLoc
forall si. SrcInfo si => si -> SrcLoc
getPointLoc (l -> SrcLoc) -> (a l -> l) -> a l -> SrcLoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a l -> l
forall (ast :: * -> *) l. Annotated ast => ast l -> l
ann

instance (SrcInfo l) => SrcInfo (Scoped l) where
    toSrcInfo :: SrcLoc -> [SrcSpan] -> SrcLoc -> Scoped l
toSrcInfo l1 :: SrcLoc
l1 ss :: [SrcSpan]
ss l2 :: SrcLoc
l2 = NameInfo l -> l -> Scoped l
forall l. NameInfo l -> l -> Scoped l
Scoped NameInfo l
forall l. NameInfo l
None (l -> Scoped l) -> l -> Scoped l
forall a b. (a -> b) -> a -> b
$ SrcLoc -> [SrcSpan] -> SrcLoc -> l
forall si. SrcInfo si => SrcLoc -> [SrcSpan] -> SrcLoc -> si
toSrcInfo SrcLoc
l1 [SrcSpan]
ss SrcLoc
l2
    fromSrcInfo :: SrcSpanInfo -> Scoped l
fromSrcInfo = NameInfo l -> l -> Scoped l
forall l. NameInfo l -> l -> Scoped l
Scoped NameInfo l
forall l. NameInfo l
None (l -> Scoped l) -> (SrcSpanInfo -> l) -> SrcSpanInfo -> Scoped l
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcSpanInfo -> l
forall si. SrcInfo si => SrcSpanInfo -> si
fromSrcInfo
    getPointLoc :: Scoped l -> SrcLoc
getPointLoc = l -> SrcLoc
forall si. SrcInfo si => si -> SrcLoc
getPointLoc (l -> SrcLoc) -> (Scoped l -> l) -> Scoped l -> SrcLoc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scoped l -> l
forall l. Scoped l -> l
sLoc
    fileName :: Scoped l -> String
fileName = l -> String
forall si. SrcInfo si => si -> String
fileName (l -> String) -> (Scoped l -> l) -> Scoped l -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scoped l -> l
forall l. Scoped l -> l
sLoc
    startLine :: Scoped l -> Int
startLine = l -> Int
forall si. SrcInfo si => si -> Int
startLine (l -> Int) -> (Scoped l -> l) -> Scoped l -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scoped l -> l
forall l. Scoped l -> l
sLoc
    startColumn :: Scoped l -> Int
startColumn = l -> Int
forall si. SrcInfo si => si -> Int
startColumn (l -> Int) -> (Scoped l -> l) -> Scoped l -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scoped l -> l
forall l. Scoped l -> l
sLoc

sLoc :: Scoped l -> l
sLoc :: Scoped l -> l
sLoc (Scoped _ l :: l
l) = l
l