{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Language.Haskell.Liquid.Types.Types (
TyConMap (..)
, F.Located (..)
, F.dummyLoc
, F.LocSymbol
, F.LocText
, F.dummyName
, F.isDummy
, RTAlias (..)
, lmapEAlias
, TyConable (..)
, SubsTy (..)
, RelExpr
, RelExprV (..)
, REnv
, AREnv (..)
, Oblig(..)
, ignoreOblig
, AnnInfo (..)
, Annot (..)
, HoleInfo(..)
, Output (..)
, hole, isHole, hasHole
, F.PPrint (..)
, F.pprint
, F.showpp
, ModName (..), ModType (..)
, isSrcImport, isSpecImport, isTarget
, getModName, getModString
, RTEnv (..), BareRTEnv, SpecRTEnv, BareRTAlias, SpecRTAlias
, Error
, ErrorResult
, Warning
, mkWarning
, Diagnostics
, mkDiagnostics
, emptyDiagnostics
, noErrors
, allWarnings
, allErrors
, printWarning
, Cinfo (..)
, Measure
, MeasureV (..)
, UnSortedExprs, UnSortedExpr
, MeasureKind (..)
, CMeasure (..)
, Def
, DefV (..)
, Body
, BodyV (..)
, MSpec (..)
, mapDefTy
, mapMeasureTy
, emapDefM
, mapDefV
, mapMeasureV
, emapMeasureM
, emapRelExprV
, RClass (..)
, KVKind (..)
, KVProf
, emptyKVProf
, updKVProf
, mapRTAVars
, LogicMap(..), toLMapV, mkLogicMap, toLogicMap, eAppWithMap, emapLMapM, LMapV(..), LMap
, RDEnv, DEnv(..), RInstance(..), RISig(..)
, MethodType(..), getMethodType
, liquidBegin, liquidEnd
, Axiom(..), HAxiom
, ordSrcSpan
)
where
import Liquid.GHC.API as Ghc hiding ( Binary
, Expr
, isFunTy
, ($+$)
, nest
, text
, blankLine
, (<+>)
, vcat
, hsep
, comma
, colon
, parens
, empty
, char
, panic
, int
, hcat
, showPpr
, punctuate
, ($$)
, braces
, angleBrackets
, brackets
)
import Data.String
import Data.Binary
import GHC.Generics
import Prelude hiding (error)
import Control.DeepSeq
import Data.Bifunctor
import Data.Typeable (Typeable)
import Data.Generics (Data)
import qualified Data.Binary as B
import Data.Hashable
import qualified Data.HashMap.Strict as M
import qualified Data.HashSet as S
import Data.Function (on)
import Data.Text (Text)
import Text.PrettyPrint.HughesPJ hiding (first, (<>))
import Language.Fixpoint.Misc
import qualified Language.Fixpoint.Types as F
import Language.Fixpoint.Types (Expr, Symbol)
import Language.Haskell.Liquid.GHC.Misc
import Language.Haskell.Liquid.GHC.Logging as GHC
import Language.Haskell.Liquid.Types.Errors
import Language.Haskell.Liquid.Types.Names
import Language.Haskell.Liquid.Types.RType
import Language.Haskell.Liquid.Misc
data TyConMap = TyConMap
{ TyConMap -> HashMap TyCon RTyCon
tcmTyRTy :: M.HashMap TyCon RTyCon
, TyConMap -> HashMap (TyCon, [Sort]) RTyCon
tcmFIRTy :: M.HashMap (TyCon, [F.Sort]) RTyCon
, TyConMap -> HashMap TyCon Int
tcmFtcArity :: M.HashMap TyCon Int
}
type RelExpr = RelExprV F.Symbol
data RelExprV v = ERBasic (F.ExprV v) | ERChecked (F.ExprV v) (RelExprV v) | ERUnChecked (F.ExprV v) (RelExprV v)
deriving (RelExprV v -> RelExprV v -> Bool
(RelExprV v -> RelExprV v -> Bool)
-> (RelExprV v -> RelExprV v -> Bool) -> Eq (RelExprV v)
forall v. Eq v => RelExprV v -> RelExprV v -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall v. Eq v => RelExprV v -> RelExprV v -> Bool
== :: RelExprV v -> RelExprV v -> Bool
$c/= :: forall v. Eq v => RelExprV v -> RelExprV v -> Bool
/= :: RelExprV v -> RelExprV v -> Bool
Eq, Int -> RelExprV v -> ShowS
[RelExprV v] -> ShowS
RelExprV v -> String
(Int -> RelExprV v -> ShowS)
-> (RelExprV v -> String)
-> ([RelExprV v] -> ShowS)
-> Show (RelExprV v)
forall v. (Show v, Fixpoint v, Ord v) => Int -> RelExprV v -> ShowS
forall v. (Show v, Fixpoint v, Ord v) => [RelExprV v] -> ShowS
forall v. (Show v, Fixpoint v, Ord v) => RelExprV v -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall v. (Show v, Fixpoint v, Ord v) => Int -> RelExprV v -> ShowS
showsPrec :: Int -> RelExprV v -> ShowS
$cshow :: forall v. (Show v, Fixpoint v, Ord v) => RelExprV v -> String
show :: RelExprV v -> String
$cshowList :: forall v. (Show v, Fixpoint v, Ord v) => [RelExprV v] -> ShowS
showList :: [RelExprV v] -> ShowS
Show, Typeable (RelExprV v)
Typeable (RelExprV v) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RelExprV v -> c (RelExprV v))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RelExprV v))
-> (RelExprV v -> Constr)
-> (RelExprV v -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RelExprV v)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RelExprV v)))
-> ((forall b. Data b => b -> b) -> RelExprV v -> RelExprV v)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r)
-> (forall u. (forall d. Data d => d -> u) -> RelExprV v -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> RelExprV v -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v))
-> Data (RelExprV v)
RelExprV v -> Constr
RelExprV v -> DataType
(forall b. Data b => b -> b) -> RelExprV v -> RelExprV v
forall v. Data v => Typeable (RelExprV v)
forall v. Data v => RelExprV v -> Constr
forall v. Data v => RelExprV v -> DataType
forall v.
Data v =>
(forall b. Data b => b -> b) -> RelExprV v -> RelExprV v
forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> RelExprV v -> u
forall v u.
Data v =>
(forall d. Data d => d -> u) -> RelExprV v -> [u]
forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RelExprV v)
forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RelExprV v -> c (RelExprV v)
forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RelExprV v))
forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RelExprV v))
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) -> RelExprV v -> u
forall u. (forall d. Data d => d -> u) -> RelExprV v -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RelExprV v)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RelExprV v -> c (RelExprV v)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RelExprV v))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RelExprV v))
$cgfoldl :: forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RelExprV v -> c (RelExprV v)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RelExprV v -> c (RelExprV v)
$cgunfold :: forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RelExprV v)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RelExprV v)
$ctoConstr :: forall v. Data v => RelExprV v -> Constr
toConstr :: RelExprV v -> Constr
$cdataTypeOf :: forall v. Data v => RelExprV v -> DataType
dataTypeOf :: RelExprV v -> DataType
$cdataCast1 :: forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RelExprV v))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RelExprV v))
$cdataCast2 :: forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RelExprV v))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RelExprV v))
$cgmapT :: forall v.
Data v =>
(forall b. Data b => b -> b) -> RelExprV v -> RelExprV v
gmapT :: (forall b. Data b => b -> b) -> RelExprV v -> RelExprV v
$cgmapQl :: forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
$cgmapQr :: forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RelExprV v -> r
$cgmapQ :: forall v u.
Data v =>
(forall d. Data d => d -> u) -> RelExprV v -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RelExprV v -> [u]
$cgmapQi :: forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> RelExprV v -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RelExprV v -> u
$cgmapM :: forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
$cgmapMp :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
$cgmapMo :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RelExprV v -> m (RelExprV v)
Data, (forall x. RelExprV v -> Rep (RelExprV v) x)
-> (forall x. Rep (RelExprV v) x -> RelExprV v)
-> Generic (RelExprV v)
forall x. Rep (RelExprV v) x -> RelExprV v
forall x. RelExprV v -> Rep (RelExprV v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v x. Rep (RelExprV v) x -> RelExprV v
forall v x. RelExprV v -> Rep (RelExprV v) x
$cfrom :: forall v x. RelExprV v -> Rep (RelExprV v) x
from :: forall x. RelExprV v -> Rep (RelExprV v) x
$cto :: forall v x. Rep (RelExprV v) x -> RelExprV v
to :: forall x. Rep (RelExprV v) x -> RelExprV v
Generic, (forall a b. (a -> b) -> RelExprV a -> RelExprV b)
-> (forall a b. a -> RelExprV b -> RelExprV a) -> Functor RelExprV
forall a b. a -> RelExprV b -> RelExprV a
forall a b. (a -> b) -> RelExprV a -> RelExprV b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> RelExprV a -> RelExprV b
fmap :: forall a b. (a -> b) -> RelExprV a -> RelExprV b
$c<$ :: forall a b. a -> RelExprV b -> RelExprV a
<$ :: forall a b. a -> RelExprV b -> RelExprV a
Functor, (forall m. Monoid m => RelExprV m -> m)
-> (forall m a. Monoid m => (a -> m) -> RelExprV a -> m)
-> (forall m a. Monoid m => (a -> m) -> RelExprV a -> m)
-> (forall a b. (a -> b -> b) -> b -> RelExprV a -> b)
-> (forall a b. (a -> b -> b) -> b -> RelExprV a -> b)
-> (forall b a. (b -> a -> b) -> b -> RelExprV a -> b)
-> (forall b a. (b -> a -> b) -> b -> RelExprV a -> b)
-> (forall a. (a -> a -> a) -> RelExprV a -> a)
-> (forall a. (a -> a -> a) -> RelExprV a -> a)
-> (forall a. RelExprV a -> [a])
-> (forall a. RelExprV a -> Bool)
-> (forall a. RelExprV a -> Int)
-> (forall a. Eq a => a -> RelExprV a -> Bool)
-> (forall a. Ord a => RelExprV a -> a)
-> (forall a. Ord a => RelExprV a -> a)
-> (forall a. Num a => RelExprV a -> a)
-> (forall a. Num a => RelExprV a -> a)
-> Foldable RelExprV
forall a. Eq a => a -> RelExprV a -> Bool
forall a. Num a => RelExprV a -> a
forall a. Ord a => RelExprV a -> a
forall m. Monoid m => RelExprV m -> m
forall a. RelExprV a -> Bool
forall a. RelExprV a -> Int
forall a. RelExprV a -> [a]
forall a. (a -> a -> a) -> RelExprV a -> a
forall m a. Monoid m => (a -> m) -> RelExprV a -> m
forall b a. (b -> a -> b) -> b -> RelExprV a -> b
forall a b. (a -> b -> b) -> b -> RelExprV 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
$cfold :: forall m. Monoid m => RelExprV m -> m
fold :: forall m. Monoid m => RelExprV m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> RelExprV a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> RelExprV a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> RelExprV a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> RelExprV a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> RelExprV a -> b
foldr :: forall a b. (a -> b -> b) -> b -> RelExprV a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> RelExprV a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> RelExprV a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> RelExprV a -> b
foldl :: forall b a. (b -> a -> b) -> b -> RelExprV a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> RelExprV a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> RelExprV a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> RelExprV a -> a
foldr1 :: forall a. (a -> a -> a) -> RelExprV a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> RelExprV a -> a
foldl1 :: forall a. (a -> a -> a) -> RelExprV a -> a
$ctoList :: forall a. RelExprV a -> [a]
toList :: forall a. RelExprV a -> [a]
$cnull :: forall a. RelExprV a -> Bool
null :: forall a. RelExprV a -> Bool
$clength :: forall a. RelExprV a -> Int
length :: forall a. RelExprV a -> Int
$celem :: forall a. Eq a => a -> RelExprV a -> Bool
elem :: forall a. Eq a => a -> RelExprV a -> Bool
$cmaximum :: forall a. Ord a => RelExprV a -> a
maximum :: forall a. Ord a => RelExprV a -> a
$cminimum :: forall a. Ord a => RelExprV a -> a
minimum :: forall a. Ord a => RelExprV a -> a
$csum :: forall a. Num a => RelExprV a -> a
sum :: forall a. Num a => RelExprV a -> a
$cproduct :: forall a. Num a => RelExprV a -> a
product :: forall a. Num a => RelExprV a -> a
Foldable, Functor RelExprV
Foldable RelExprV
(Functor RelExprV, Foldable RelExprV) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RelExprV a -> f (RelExprV b))
-> (forall (f :: * -> *) a.
Applicative f =>
RelExprV (f a) -> f (RelExprV a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RelExprV a -> m (RelExprV b))
-> (forall (m :: * -> *) a.
Monad m =>
RelExprV (m a) -> m (RelExprV a))
-> Traversable RelExprV
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 => RelExprV (m a) -> m (RelExprV a)
forall (f :: * -> *) a.
Applicative f =>
RelExprV (f a) -> f (RelExprV a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RelExprV a -> m (RelExprV b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RelExprV a -> f (RelExprV b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RelExprV a -> f (RelExprV b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RelExprV a -> f (RelExprV b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
RelExprV (f a) -> f (RelExprV a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
RelExprV (f a) -> f (RelExprV a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RelExprV a -> m (RelExprV b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RelExprV a -> m (RelExprV b)
$csequence :: forall (m :: * -> *) a. Monad m => RelExprV (m a) -> m (RelExprV a)
sequence :: forall (m :: * -> *) a. Monad m => RelExprV (m a) -> m (RelExprV a)
Traversable)
deriving Get (RelExprV v)
[RelExprV v] -> Put
RelExprV v -> Put
(RelExprV v -> Put)
-> Get (RelExprV v) -> ([RelExprV v] -> Put) -> Binary (RelExprV v)
forall v. Binary v => Get (RelExprV v)
forall v. Binary v => [RelExprV v] -> Put
forall v. Binary v => RelExprV v -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall v. Binary v => RelExprV v -> Put
put :: RelExprV v -> Put
$cget :: forall v. Binary v => Get (RelExprV v)
get :: Get (RelExprV v)
$cputList :: forall v. Binary v => [RelExprV v] -> Put
putList :: [RelExprV v] -> Put
B.Binary via Generically (RelExprV v)
emapRelExprV :: Monad m => ([Symbol] -> v0 -> m v1) -> RelExprV v0 -> m (RelExprV v1)
emapRelExprV :: forall (m :: * -> *) v0 v1.
Monad m =>
([Symbol] -> v0 -> m v1) -> RelExprV v0 -> m (RelExprV v1)
emapRelExprV [Symbol] -> v0 -> m v1
f = RelExprV v0 -> m (RelExprV v1)
go
where
go :: RelExprV v0 -> m (RelExprV v1)
go (ERBasic ExprV v0
e) = ExprV v1 -> RelExprV v1
forall v. ExprV v -> RelExprV v
ERBasic (ExprV v1 -> RelExprV v1) -> m (ExprV v1) -> m (RelExprV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM [Symbol] -> v0 -> m v1
f ExprV v0
e
go (ERChecked ExprV v0
e RelExprV v0
re) = ExprV v1 -> RelExprV v1 -> RelExprV v1
forall v. ExprV v -> RelExprV v -> RelExprV v
ERChecked (ExprV v1 -> RelExprV v1 -> RelExprV v1)
-> m (ExprV v1) -> m (RelExprV v1 -> RelExprV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM [Symbol] -> v0 -> m v1
f ExprV v0
e m (RelExprV v1 -> RelExprV v1)
-> m (RelExprV v1) -> m (RelExprV v1)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> RelExprV v0 -> m (RelExprV v1)
go RelExprV v0
re
go (ERUnChecked ExprV v0
e RelExprV v0
re) = ExprV v1 -> RelExprV v1 -> RelExprV v1
forall v. ExprV v -> RelExprV v -> RelExprV v
ERUnChecked (ExprV v1 -> RelExprV v1 -> RelExprV v1)
-> m (ExprV v1) -> m (RelExprV v1 -> RelExprV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM [Symbol] -> v0 -> m v1
f ExprV v0
e m (RelExprV v1 -> RelExprV v1)
-> m (RelExprV v1) -> m (RelExprV v1)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> RelExprV v0 -> m (RelExprV v1)
go RelExprV v0
re
instance F.PPrint RelExpr where
pprintTidy :: Tidy -> RelExpr -> Doc
pprintTidy Tidy
k (ERBasic Expr
e) = Tidy -> Expr -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Expr
e
pprintTidy Tidy
k (ERChecked Expr
e RelExpr
r) = Tidy -> Expr -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Expr
e Doc -> Doc -> Doc
<+> Doc
"!=>" Doc -> Doc -> Doc
<+> Tidy -> RelExpr -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k RelExpr
r
pprintTidy Tidy
k (ERUnChecked Expr
e RelExpr
r) = Tidy -> Expr -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Expr
e Doc -> Doc -> Doc
<+> Doc
":=>" Doc -> Doc -> Doc
<+> Tidy -> RelExpr -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k RelExpr
r
ignoreOblig :: RType t t1 t2 -> RType t t1 t2
ignoreOblig :: forall t t1 t2. RType t t1 t2 -> RType t t1 t2
ignoreOblig (RRTy [(Symbol, RTypeV Symbol t t1 t2)]
_ t2
_ Oblig
_ RTypeV Symbol t t1 t2
t) = RTypeV Symbol t t1 t2
t
ignoreOblig RTypeV Symbol t t1 t2
t = RTypeV Symbol t t1 t2
t
type SpecRTEnv = RTEnv RTyVar SpecType
type BareRTEnv = RTEnv Symbol BareType
type BareRTAlias = RTAlias Symbol BareType
type SpecRTAlias = RTAlias RTyVar SpecType
class SubsTy tv ty a where
subt :: (tv, ty) -> a -> a
data LogicMap = LM
{ LogicMap -> HashMap Symbol LMap
lmSymDefs :: M.HashMap Symbol LMap
, LogicMap -> HashMap Var (Maybe Symbol)
lmVarSyms :: M.HashMap Var (Maybe Symbol)
} deriving (Int -> LogicMap -> ShowS
[LogicMap] -> ShowS
LogicMap -> String
(Int -> LogicMap -> ShowS)
-> (LogicMap -> String) -> ([LogicMap] -> ShowS) -> Show LogicMap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LogicMap -> ShowS
showsPrec :: Int -> LogicMap -> ShowS
$cshow :: LogicMap -> String
show :: LogicMap -> String
$cshowList :: [LogicMap] -> ShowS
showList :: [LogicMap] -> ShowS
Show)
instance Monoid LogicMap where
mempty :: LogicMap
mempty = HashMap Symbol LMap -> HashMap Var (Maybe Symbol) -> LogicMap
LM HashMap Symbol LMap
forall k v. HashMap k v
M.empty HashMap Var (Maybe Symbol)
forall k v. HashMap k v
M.empty
mappend :: LogicMap -> LogicMap -> LogicMap
mappend = LogicMap -> LogicMap -> LogicMap
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup LogicMap where
LM HashMap Symbol LMap
x1 HashMap Var (Maybe Symbol)
x2 <> :: LogicMap -> LogicMap -> LogicMap
<> LM HashMap Symbol LMap
y1 HashMap Var (Maybe Symbol)
y2 = HashMap Symbol LMap -> HashMap Var (Maybe Symbol) -> LogicMap
LM (HashMap Symbol LMap -> HashMap Symbol LMap -> HashMap Symbol LMap
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
M.union HashMap Symbol LMap
x1 HashMap Symbol LMap
y1) (HashMap Var (Maybe Symbol)
-> HashMap Var (Maybe Symbol) -> HashMap Var (Maybe Symbol)
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
M.union HashMap Var (Maybe Symbol)
x2 HashMap Var (Maybe Symbol)
y2)
data LMapV v = LMap
{ forall v. LMapV v -> LocSymbol
lmVar :: F.LocSymbol
, forall v. LMapV v -> [Symbol]
lmArgs :: [Symbol]
, forall v. LMapV v -> ExprV v
lmExpr :: F.ExprV v
} deriving (LMapV v -> LMapV v -> Bool
(LMapV v -> LMapV v -> Bool)
-> (LMapV v -> LMapV v -> Bool) -> Eq (LMapV v)
forall v. Eq v => LMapV v -> LMapV v -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall v. Eq v => LMapV v -> LMapV v -> Bool
== :: LMapV v -> LMapV v -> Bool
$c/= :: forall v. Eq v => LMapV v -> LMapV v -> Bool
/= :: LMapV v -> LMapV v -> Bool
Eq, Typeable (LMapV v)
Typeable (LMapV v) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LMapV v -> c (LMapV v))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LMapV v))
-> (LMapV v -> Constr)
-> (LMapV v -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (LMapV v)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LMapV v)))
-> ((forall b. Data b => b -> b) -> LMapV v -> LMapV v)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r)
-> (forall u. (forall d. Data d => d -> u) -> LMapV v -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> LMapV v -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v))
-> Data (LMapV v)
LMapV v -> Constr
LMapV v -> DataType
(forall b. Data b => b -> b) -> LMapV v -> LMapV v
forall v. Data v => Typeable (LMapV v)
forall v. Data v => LMapV v -> Constr
forall v. Data v => LMapV v -> DataType
forall v.
Data v =>
(forall b. Data b => b -> b) -> LMapV v -> LMapV v
forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> LMapV v -> u
forall v u.
Data v =>
(forall d. Data d => d -> u) -> LMapV v -> [u]
forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LMapV v)
forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LMapV v -> c (LMapV v)
forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (LMapV v))
forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LMapV v))
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) -> LMapV v -> u
forall u. (forall d. Data d => d -> u) -> LMapV v -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LMapV v)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LMapV v -> c (LMapV v)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (LMapV v))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LMapV v))
$cgfoldl :: forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LMapV v -> c (LMapV v)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LMapV v -> c (LMapV v)
$cgunfold :: forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LMapV v)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (LMapV v)
$ctoConstr :: forall v. Data v => LMapV v -> Constr
toConstr :: LMapV v -> Constr
$cdataTypeOf :: forall v. Data v => LMapV v -> DataType
dataTypeOf :: LMapV v -> DataType
$cdataCast1 :: forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (LMapV v))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (LMapV v))
$cdataCast2 :: forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LMapV v))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LMapV v))
$cgmapT :: forall v.
Data v =>
(forall b. Data b => b -> b) -> LMapV v -> LMapV v
gmapT :: (forall b. Data b => b -> b) -> LMapV v -> LMapV v
$cgmapQl :: forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
$cgmapQr :: forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LMapV v -> r
$cgmapQ :: forall v u.
Data v =>
(forall d. Data d => d -> u) -> LMapV v -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> LMapV v -> [u]
$cgmapQi :: forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> LMapV v -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LMapV v -> u
$cgmapM :: forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
$cgmapMp :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
$cgmapMo :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LMapV v -> m (LMapV v)
Data, (forall x. LMapV v -> Rep (LMapV v) x)
-> (forall x. Rep (LMapV v) x -> LMapV v) -> Generic (LMapV v)
forall x. Rep (LMapV v) x -> LMapV v
forall x. LMapV v -> Rep (LMapV v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v x. Rep (LMapV v) x -> LMapV v
forall v x. LMapV v -> Rep (LMapV v) x
$cfrom :: forall v x. LMapV v -> Rep (LMapV v) x
from :: forall x. LMapV v -> Rep (LMapV v) x
$cto :: forall v x. Rep (LMapV v) x -> LMapV v
to :: forall x. Rep (LMapV v) x -> LMapV v
Generic, (forall a b. (a -> b) -> LMapV a -> LMapV b)
-> (forall a b. a -> LMapV b -> LMapV a) -> Functor LMapV
forall a b. a -> LMapV b -> LMapV a
forall a b. (a -> b) -> LMapV a -> LMapV b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> LMapV a -> LMapV b
fmap :: forall a b. (a -> b) -> LMapV a -> LMapV b
$c<$ :: forall a b. a -> LMapV b -> LMapV a
<$ :: forall a b. a -> LMapV b -> LMapV a
Functor)
deriving (Get (LMapV v)
[LMapV v] -> Put
LMapV v -> Put
(LMapV v -> Put)
-> Get (LMapV v) -> ([LMapV v] -> Put) -> Binary (LMapV v)
forall v. Binary v => Get (LMapV v)
forall v. Binary v => [LMapV v] -> Put
forall v. Binary v => LMapV v -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall v. Binary v => LMapV v -> Put
put :: LMapV v -> Put
$cget :: forall v. Binary v => Get (LMapV v)
get :: Get (LMapV v)
$cputList :: forall v. Binary v => [LMapV v] -> Put
putList :: [LMapV v] -> Put
Binary, Eq (LMapV v)
Eq (LMapV v) =>
(Int -> LMapV v -> Int) -> (LMapV v -> Int) -> Hashable (LMapV v)
Int -> LMapV v -> Int
LMapV v -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall v. Hashable v => Eq (LMapV v)
forall v. Hashable v => Int -> LMapV v -> Int
forall v. Hashable v => LMapV v -> Int
$chashWithSalt :: forall v. Hashable v => Int -> LMapV v -> Int
hashWithSalt :: Int -> LMapV v -> Int
$chash :: forall v. Hashable v => LMapV v -> Int
hash :: LMapV v -> Int
Hashable) via Generically (LMapV v)
type LMap = LMapV F.Symbol
instance (Show v, Ord v, F.Fixpoint v) => Show (LMapV v) where
show :: LMapV v -> String
show (LMap LocSymbol
x [Symbol]
xs ExprV v
e) = LocSymbol -> String
forall a. Show a => a -> String
show LocSymbol
x String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" " String -> ShowS
forall a. [a] -> [a] -> [a]
++ [Symbol] -> String
forall a. Show a => a -> String
show [Symbol]
xs String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
"\t |-> \t" String -> ShowS
forall a. [a] -> [a] -> [a]
++ ExprV v -> String
forall a. Show a => a -> String
show ExprV v
e
toLMapV :: (F.Located LHName, ([Symbol], F.ExprV v)) -> (F.Located LHName, LMapV v)
toLMapV :: forall v.
(Located LHName, ([Symbol], ExprV v)) -> (Located LHName, LMapV v)
toLMapV (Located LHName
x, ([Symbol]
ys, ExprV v
e)) = (Located LHName
x, LMap {lmVar :: LocSymbol
lmVar = LHName -> Symbol
getLHNameSymbol (LHName -> Symbol) -> Located LHName -> LocSymbol
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Located LHName
x, lmArgs :: [Symbol]
lmArgs = [Symbol]
ys, lmExpr :: ExprV v
lmExpr = ExprV v
e})
mkLogicMap :: M.HashMap Symbol LMap -> LogicMap
mkLogicMap :: HashMap Symbol LMap -> LogicMap
mkLogicMap HashMap Symbol LMap
ls = LogicMap
forall a. Monoid a => a
mempty {lmSymDefs = ls}
toLogicMap :: [(F.LocSymbol, ([Symbol], Expr))] -> LogicMap
toLogicMap :: [(LocSymbol, ([Symbol], Expr))] -> LogicMap
toLogicMap = HashMap Symbol LMap -> LogicMap
mkLogicMap (HashMap Symbol LMap -> LogicMap)
-> ([(LocSymbol, ([Symbol], Expr))] -> HashMap Symbol LMap)
-> [(LocSymbol, ([Symbol], Expr))]
-> LogicMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Symbol, LMap)] -> HashMap Symbol LMap
forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
M.fromList ([(Symbol, LMap)] -> HashMap Symbol LMap)
-> ([(LocSymbol, ([Symbol], Expr))] -> [(Symbol, LMap)])
-> [(LocSymbol, ([Symbol], Expr))]
-> HashMap Symbol LMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((LocSymbol, ([Symbol], Expr)) -> (Symbol, LMap))
-> [(LocSymbol, ([Symbol], Expr))] -> [(Symbol, LMap)]
forall a b. (a -> b) -> [a] -> [b]
map (LocSymbol, ([Symbol], Expr)) -> (Symbol, LMap)
forall v. (LocSymbol, ([Symbol], ExprV v)) -> (Symbol, LMapV v)
toLMapV0
where
toLMapV0 :: (F.LocSymbol, ([Symbol], F.ExprV v)) -> (Symbol, LMapV v)
toLMapV0 :: forall v. (LocSymbol, ([Symbol], ExprV v)) -> (Symbol, LMapV v)
toLMapV0 (LocSymbol
x, ([Symbol]
ys, ExprV v
e)) = (LocSymbol -> Symbol
forall a. Located a -> a
F.val LocSymbol
x, LMap {lmVar :: LocSymbol
lmVar = LocSymbol
x, lmArgs :: [Symbol]
lmArgs = [Symbol]
ys, lmExpr :: ExprV v
lmExpr = ExprV v
e})
eAppWithMap :: LogicMap -> Symbol -> [Expr] -> Expr -> Expr
eAppWithMap :: LogicMap -> Symbol -> [Expr] -> Expr -> Expr
eAppWithMap LogicMap
lmap Symbol
f [Expr]
es Expr
expr
| Just (LMap LocSymbol
_ [Symbol]
xs Expr
e) <- Symbol -> HashMap Symbol LMap -> Maybe LMap
forall k v. (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
M.lookup Symbol
f (LogicMap -> HashMap Symbol LMap
lmSymDefs LogicMap
lmap)
, [Symbol] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Symbol]
xs Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== [Expr] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Expr]
es
= Subst -> Expr -> Expr
forall a. Subable a => Subst -> a -> a
F.subst ([(Symbol, Expr)] -> Subst
F.mkSubst ([(Symbol, Expr)] -> Subst) -> [(Symbol, Expr)] -> Subst
forall a b. (a -> b) -> a -> b
$ [Symbol] -> [Expr] -> [(Symbol, Expr)]
forall a b. [a] -> [b] -> [(a, b)]
zip [Symbol]
xs [Expr]
es) Expr
e
| Bool
otherwise
= Expr
expr
emapLMapM :: Monad m => ([Symbol] -> v0 -> m v1) -> LMapV v0 -> m (LMapV v1)
emapLMapM :: forall (m :: * -> *) v0 v1.
Monad m =>
([Symbol] -> v0 -> m v1) -> LMapV v0 -> m (LMapV v1)
emapLMapM [Symbol] -> v0 -> m v1
f LMapV v0
l = do
lmExpr <- ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM ([Symbol] -> v0 -> m v1
f ([Symbol] -> v0 -> m v1)
-> ([Symbol] -> [Symbol]) -> [Symbol] -> v0 -> m v1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Symbol] -> [Symbol] -> [Symbol]
forall a. [a] -> [a] -> [a]
++ LMapV v0 -> [Symbol]
forall v. LMapV v -> [Symbol]
lmArgs LMapV v0
l)) (LMapV v0 -> ExprV v0
forall v. LMapV v -> ExprV v
lmExpr LMapV v0
l)
return l {lmExpr}
data RInstance t = RI
{ forall t. RInstance t -> BTyCon
riclass :: BTyCon
, forall t. RInstance t -> Maybe (Located LHName)
riDictName :: Maybe (F.Located LHName)
, forall t. RInstance t -> [t]
ritype :: [t]
, forall t. RInstance t -> [(Located LHName, RISig t)]
risigs :: [(F.Located LHName, RISig t)]
} deriving (RInstance t -> RInstance t -> Bool
(RInstance t -> RInstance t -> Bool)
-> (RInstance t -> RInstance t -> Bool) -> Eq (RInstance t)
forall t. Eq t => RInstance t -> RInstance t -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall t. Eq t => RInstance t -> RInstance t -> Bool
== :: RInstance t -> RInstance t -> Bool
$c/= :: forall t. Eq t => RInstance t -> RInstance t -> Bool
/= :: RInstance t -> RInstance t -> Bool
Eq, (forall x. RInstance t -> Rep (RInstance t) x)
-> (forall x. Rep (RInstance t) x -> RInstance t)
-> Generic (RInstance t)
forall x. Rep (RInstance t) x -> RInstance t
forall x. RInstance t -> Rep (RInstance t) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall t x. Rep (RInstance t) x -> RInstance t
forall t x. RInstance t -> Rep (RInstance t) x
$cfrom :: forall t x. RInstance t -> Rep (RInstance t) x
from :: forall x. RInstance t -> Rep (RInstance t) x
$cto :: forall t x. Rep (RInstance t) x -> RInstance t
to :: forall x. Rep (RInstance t) x -> RInstance t
Generic, (forall a b. (a -> b) -> RInstance a -> RInstance b)
-> (forall a b. a -> RInstance b -> RInstance a)
-> Functor RInstance
forall a b. a -> RInstance b -> RInstance a
forall a b. (a -> b) -> RInstance a -> RInstance b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> RInstance a -> RInstance b
fmap :: forall a b. (a -> b) -> RInstance a -> RInstance b
$c<$ :: forall a b. a -> RInstance b -> RInstance a
<$ :: forall a b. a -> RInstance b -> RInstance a
Functor, Typeable (RInstance t)
Typeable (RInstance t) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RInstance t -> c (RInstance t))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RInstance t))
-> (RInstance t -> Constr)
-> (RInstance t -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RInstance t)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RInstance t)))
-> ((forall b. Data b => b -> b) -> RInstance t -> RInstance t)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r)
-> (forall u. (forall d. Data d => d -> u) -> RInstance t -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> RInstance t -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t))
-> Data (RInstance t)
RInstance t -> Constr
RInstance t -> DataType
(forall b. Data b => b -> b) -> RInstance t -> RInstance t
forall t. Data t => Typeable (RInstance t)
forall t. Data t => RInstance t -> Constr
forall t. Data t => RInstance t -> DataType
forall t.
Data t =>
(forall b. Data b => b -> b) -> RInstance t -> RInstance t
forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> RInstance t -> u
forall t u.
Data t =>
(forall d. Data d => d -> u) -> RInstance t -> [u]
forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RInstance t)
forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RInstance t -> c (RInstance t)
forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RInstance t))
forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RInstance t))
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) -> RInstance t -> u
forall u. (forall d. Data d => d -> u) -> RInstance t -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RInstance t)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RInstance t -> c (RInstance t)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RInstance t))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RInstance t))
$cgfoldl :: forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RInstance t -> c (RInstance t)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RInstance t -> c (RInstance t)
$cgunfold :: forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RInstance t)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RInstance t)
$ctoConstr :: forall t. Data t => RInstance t -> Constr
toConstr :: RInstance t -> Constr
$cdataTypeOf :: forall t. Data t => RInstance t -> DataType
dataTypeOf :: RInstance t -> DataType
$cdataCast1 :: forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RInstance t))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RInstance t))
$cdataCast2 :: forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RInstance t))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RInstance t))
$cgmapT :: forall t.
Data t =>
(forall b. Data b => b -> b) -> RInstance t -> RInstance t
gmapT :: (forall b. Data b => b -> b) -> RInstance t -> RInstance t
$cgmapQl :: forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
$cgmapQr :: forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RInstance t -> r
$cgmapQ :: forall t u.
Data t =>
(forall d. Data d => d -> u) -> RInstance t -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RInstance t -> [u]
$cgmapQi :: forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> RInstance t -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RInstance t -> u
$cgmapM :: forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
$cgmapMp :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
$cgmapMo :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RInstance t -> m (RInstance t)
Data, Typeable, (forall m. Monoid m => RInstance m -> m)
-> (forall m a. Monoid m => (a -> m) -> RInstance a -> m)
-> (forall m a. Monoid m => (a -> m) -> RInstance a -> m)
-> (forall a b. (a -> b -> b) -> b -> RInstance a -> b)
-> (forall a b. (a -> b -> b) -> b -> RInstance a -> b)
-> (forall b a. (b -> a -> b) -> b -> RInstance a -> b)
-> (forall b a. (b -> a -> b) -> b -> RInstance a -> b)
-> (forall a. (a -> a -> a) -> RInstance a -> a)
-> (forall a. (a -> a -> a) -> RInstance a -> a)
-> (forall t. RInstance t -> [t])
-> (forall a. RInstance a -> Bool)
-> (forall a. RInstance a -> Int)
-> (forall a. Eq a => a -> RInstance a -> Bool)
-> (forall a. Ord a => RInstance a -> a)
-> (forall a. Ord a => RInstance a -> a)
-> (forall a. Num a => RInstance a -> a)
-> (forall a. Num a => RInstance a -> a)
-> Foldable RInstance
forall a. Eq a => a -> RInstance a -> Bool
forall a. Num a => RInstance a -> a
forall a. Ord a => RInstance a -> a
forall m. Monoid m => RInstance m -> m
forall a. RInstance a -> Bool
forall a. RInstance a -> Int
forall t. RInstance t -> [t]
forall a. (a -> a -> a) -> RInstance a -> a
forall m a. Monoid m => (a -> m) -> RInstance a -> m
forall b a. (b -> a -> b) -> b -> RInstance a -> b
forall a b. (a -> b -> b) -> b -> RInstance 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
$cfold :: forall m. Monoid m => RInstance m -> m
fold :: forall m. Monoid m => RInstance m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> RInstance a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> RInstance a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> RInstance a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> RInstance a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> RInstance a -> b
foldr :: forall a b. (a -> b -> b) -> b -> RInstance a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> RInstance a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> RInstance a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> RInstance a -> b
foldl :: forall b a. (b -> a -> b) -> b -> RInstance a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> RInstance a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> RInstance a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> RInstance a -> a
foldr1 :: forall a. (a -> a -> a) -> RInstance a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> RInstance a -> a
foldl1 :: forall a. (a -> a -> a) -> RInstance a -> a
$ctoList :: forall t. RInstance t -> [t]
toList :: forall t. RInstance t -> [t]
$cnull :: forall a. RInstance a -> Bool
null :: forall a. RInstance a -> Bool
$clength :: forall a. RInstance a -> Int
length :: forall a. RInstance a -> Int
$celem :: forall a. Eq a => a -> RInstance a -> Bool
elem :: forall a. Eq a => a -> RInstance a -> Bool
$cmaximum :: forall a. Ord a => RInstance a -> a
maximum :: forall a. Ord a => RInstance a -> a
$cminimum :: forall a. Ord a => RInstance a -> a
minimum :: forall a. Ord a => RInstance a -> a
$csum :: forall a. Num a => RInstance a -> a
sum :: forall a. Num a => RInstance a -> a
$cproduct :: forall a. Num a => RInstance a -> a
product :: forall a. Num a => RInstance a -> a
Foldable, Functor RInstance
Foldable RInstance
(Functor RInstance, Foldable RInstance) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RInstance a -> f (RInstance b))
-> (forall (f :: * -> *) a.
Applicative f =>
RInstance (f a) -> f (RInstance a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RInstance a -> m (RInstance b))
-> (forall (m :: * -> *) a.
Monad m =>
RInstance (m a) -> m (RInstance a))
-> Traversable RInstance
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 =>
RInstance (m a) -> m (RInstance a)
forall (f :: * -> *) a.
Applicative f =>
RInstance (f a) -> f (RInstance a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RInstance a -> m (RInstance b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RInstance a -> f (RInstance b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RInstance a -> f (RInstance b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RInstance a -> f (RInstance b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
RInstance (f a) -> f (RInstance a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
RInstance (f a) -> f (RInstance a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RInstance a -> m (RInstance b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RInstance a -> m (RInstance b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
RInstance (m a) -> m (RInstance a)
sequence :: forall (m :: * -> *) a.
Monad m =>
RInstance (m a) -> m (RInstance a)
Traversable, Int -> RInstance t -> ShowS
[RInstance t] -> ShowS
RInstance t -> String
(Int -> RInstance t -> ShowS)
-> (RInstance t -> String)
-> ([RInstance t] -> ShowS)
-> Show (RInstance t)
forall t. Show t => Int -> RInstance t -> ShowS
forall t. Show t => [RInstance t] -> ShowS
forall t. Show t => RInstance t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall t. Show t => Int -> RInstance t -> ShowS
showsPrec :: Int -> RInstance t -> ShowS
$cshow :: forall t. Show t => RInstance t -> String
show :: RInstance t -> String
$cshowList :: forall t. Show t => [RInstance t] -> ShowS
showList :: [RInstance t] -> ShowS
Show)
deriving Eq (RInstance t)
Eq (RInstance t) =>
(Int -> RInstance t -> Int)
-> (RInstance t -> Int) -> Hashable (RInstance t)
Int -> RInstance t -> Int
RInstance t -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall t. Hashable t => Eq (RInstance t)
forall t. Hashable t => Int -> RInstance t -> Int
forall t. Hashable t => RInstance t -> Int
$chashWithSalt :: forall t. Hashable t => Int -> RInstance t -> Int
hashWithSalt :: Int -> RInstance t -> Int
$chash :: forall t. Hashable t => RInstance t -> Int
hash :: RInstance t -> Int
Hashable via Generically (RInstance t)
deriving Get (RInstance t)
[RInstance t] -> Put
RInstance t -> Put
(RInstance t -> Put)
-> Get (RInstance t)
-> ([RInstance t] -> Put)
-> Binary (RInstance t)
forall t. Binary t => Get (RInstance t)
forall t. Binary t => [RInstance t] -> Put
forall t. Binary t => RInstance t -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall t. Binary t => RInstance t -> Put
put :: RInstance t -> Put
$cget :: forall t. Binary t => Get (RInstance t)
get :: Get (RInstance t)
$cputList :: forall t. Binary t => [RInstance t] -> Put
putList :: [RInstance t] -> Put
B.Binary via Generically (RInstance t)
data RISig t = RIAssumed t | RISig t
deriving (RISig t -> RISig t -> Bool
(RISig t -> RISig t -> Bool)
-> (RISig t -> RISig t -> Bool) -> Eq (RISig t)
forall t. Eq t => RISig t -> RISig t -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall t. Eq t => RISig t -> RISig t -> Bool
== :: RISig t -> RISig t -> Bool
$c/= :: forall t. Eq t => RISig t -> RISig t -> Bool
/= :: RISig t -> RISig t -> Bool
Eq, (forall x. RISig t -> Rep (RISig t) x)
-> (forall x. Rep (RISig t) x -> RISig t) -> Generic (RISig t)
forall x. Rep (RISig t) x -> RISig t
forall x. RISig t -> Rep (RISig t) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall t x. Rep (RISig t) x -> RISig t
forall t x. RISig t -> Rep (RISig t) x
$cfrom :: forall t x. RISig t -> Rep (RISig t) x
from :: forall x. RISig t -> Rep (RISig t) x
$cto :: forall t x. Rep (RISig t) x -> RISig t
to :: forall x. Rep (RISig t) x -> RISig t
Generic, (forall a b. (a -> b) -> RISig a -> RISig b)
-> (forall a b. a -> RISig b -> RISig a) -> Functor RISig
forall a b. a -> RISig b -> RISig a
forall a b. (a -> b) -> RISig a -> RISig b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> RISig a -> RISig b
fmap :: forall a b. (a -> b) -> RISig a -> RISig b
$c<$ :: forall a b. a -> RISig b -> RISig a
<$ :: forall a b. a -> RISig b -> RISig a
Functor, Typeable (RISig t)
Typeable (RISig t) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RISig t -> c (RISig t))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RISig t))
-> (RISig t -> Constr)
-> (RISig t -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RISig t)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RISig t)))
-> ((forall b. Data b => b -> b) -> RISig t -> RISig t)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r)
-> (forall u. (forall d. Data d => d -> u) -> RISig t -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> RISig t -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t))
-> Data (RISig t)
RISig t -> Constr
RISig t -> DataType
(forall b. Data b => b -> b) -> RISig t -> RISig t
forall t. Data t => Typeable (RISig t)
forall t. Data t => RISig t -> Constr
forall t. Data t => RISig t -> DataType
forall t.
Data t =>
(forall b. Data b => b -> b) -> RISig t -> RISig t
forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> RISig t -> u
forall t u.
Data t =>
(forall d. Data d => d -> u) -> RISig t -> [u]
forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RISig t)
forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RISig t -> c (RISig t)
forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RISig t))
forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RISig t))
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) -> RISig t -> u
forall u. (forall d. Data d => d -> u) -> RISig t -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RISig t)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RISig t -> c (RISig t)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RISig t))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RISig t))
$cgfoldl :: forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RISig t -> c (RISig t)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RISig t -> c (RISig t)
$cgunfold :: forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RISig t)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RISig t)
$ctoConstr :: forall t. Data t => RISig t -> Constr
toConstr :: RISig t -> Constr
$cdataTypeOf :: forall t. Data t => RISig t -> DataType
dataTypeOf :: RISig t -> DataType
$cdataCast1 :: forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RISig t))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RISig t))
$cdataCast2 :: forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RISig t))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RISig t))
$cgmapT :: forall t.
Data t =>
(forall b. Data b => b -> b) -> RISig t -> RISig t
gmapT :: (forall b. Data b => b -> b) -> RISig t -> RISig t
$cgmapQl :: forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
$cgmapQr :: forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RISig t -> r
$cgmapQ :: forall t u.
Data t =>
(forall d. Data d => d -> u) -> RISig t -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RISig t -> [u]
$cgmapQi :: forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> RISig t -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RISig t -> u
$cgmapM :: forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
$cgmapMp :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
$cgmapMo :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RISig t -> m (RISig t)
Data, Typeable, Int -> RISig t -> ShowS
[RISig t] -> ShowS
RISig t -> String
(Int -> RISig t -> ShowS)
-> (RISig t -> String) -> ([RISig t] -> ShowS) -> Show (RISig t)
forall t. Show t => Int -> RISig t -> ShowS
forall t. Show t => [RISig t] -> ShowS
forall t. Show t => RISig t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall t. Show t => Int -> RISig t -> ShowS
showsPrec :: Int -> RISig t -> ShowS
$cshow :: forall t. Show t => RISig t -> String
show :: RISig t -> String
$cshowList :: forall t. Show t => [RISig t] -> ShowS
showList :: [RISig t] -> ShowS
Show, (forall m. Monoid m => RISig m -> m)
-> (forall m a. Monoid m => (a -> m) -> RISig a -> m)
-> (forall m a. Monoid m => (a -> m) -> RISig a -> m)
-> (forall a b. (a -> b -> b) -> b -> RISig a -> b)
-> (forall a b. (a -> b -> b) -> b -> RISig a -> b)
-> (forall b a. (b -> a -> b) -> b -> RISig a -> b)
-> (forall b a. (b -> a -> b) -> b -> RISig a -> b)
-> (forall a. (a -> a -> a) -> RISig a -> a)
-> (forall a. (a -> a -> a) -> RISig a -> a)
-> (forall a. RISig a -> [a])
-> (forall a. RISig a -> Bool)
-> (forall a. RISig a -> Int)
-> (forall a. Eq a => a -> RISig a -> Bool)
-> (forall a. Ord a => RISig a -> a)
-> (forall a. Ord a => RISig a -> a)
-> (forall a. Num a => RISig a -> a)
-> (forall a. Num a => RISig a -> a)
-> Foldable RISig
forall a. Eq a => a -> RISig a -> Bool
forall a. Num a => RISig a -> a
forall a. Ord a => RISig a -> a
forall m. Monoid m => RISig m -> m
forall a. RISig a -> Bool
forall a. RISig a -> Int
forall a. RISig a -> [a]
forall a. (a -> a -> a) -> RISig a -> a
forall m a. Monoid m => (a -> m) -> RISig a -> m
forall b a. (b -> a -> b) -> b -> RISig a -> b
forall a b. (a -> b -> b) -> b -> RISig 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
$cfold :: forall m. Monoid m => RISig m -> m
fold :: forall m. Monoid m => RISig m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> RISig a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> RISig a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> RISig a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> RISig a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> RISig a -> b
foldr :: forall a b. (a -> b -> b) -> b -> RISig a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> RISig a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> RISig a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> RISig a -> b
foldl :: forall b a. (b -> a -> b) -> b -> RISig a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> RISig a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> RISig a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> RISig a -> a
foldr1 :: forall a. (a -> a -> a) -> RISig a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> RISig a -> a
foldl1 :: forall a. (a -> a -> a) -> RISig a -> a
$ctoList :: forall a. RISig a -> [a]
toList :: forall a. RISig a -> [a]
$cnull :: forall a. RISig a -> Bool
null :: forall a. RISig a -> Bool
$clength :: forall a. RISig a -> Int
length :: forall a. RISig a -> Int
$celem :: forall a. Eq a => a -> RISig a -> Bool
elem :: forall a. Eq a => a -> RISig a -> Bool
$cmaximum :: forall a. Ord a => RISig a -> a
maximum :: forall a. Ord a => RISig a -> a
$cminimum :: forall a. Ord a => RISig a -> a
minimum :: forall a. Ord a => RISig a -> a
$csum :: forall a. Num a => RISig a -> a
sum :: forall a. Num a => RISig a -> a
$cproduct :: forall a. Num a => RISig a -> a
product :: forall a. Num a => RISig a -> a
Foldable, Functor RISig
Foldable RISig
(Functor RISig, Foldable RISig) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RISig a -> f (RISig b))
-> (forall (f :: * -> *) a.
Applicative f =>
RISig (f a) -> f (RISig a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RISig a -> m (RISig b))
-> (forall (m :: * -> *) a. Monad m => RISig (m a) -> m (RISig a))
-> Traversable RISig
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 => RISig (m a) -> m (RISig a)
forall (f :: * -> *) a. Applicative f => RISig (f a) -> f (RISig a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RISig a -> m (RISig b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RISig a -> f (RISig b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RISig a -> f (RISig b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RISig a -> f (RISig b)
$csequenceA :: forall (f :: * -> *) a. Applicative f => RISig (f a) -> f (RISig a)
sequenceA :: forall (f :: * -> *) a. Applicative f => RISig (f a) -> f (RISig a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RISig a -> m (RISig b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RISig a -> m (RISig b)
$csequence :: forall (m :: * -> *) a. Monad m => RISig (m a) -> m (RISig a)
sequence :: forall (m :: * -> *) a. Monad m => RISig (m a) -> m (RISig a)
Traversable)
deriving Eq (RISig t)
Eq (RISig t) =>
(Int -> RISig t -> Int) -> (RISig t -> Int) -> Hashable (RISig t)
Int -> RISig t -> Int
RISig t -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall t. Hashable t => Eq (RISig t)
forall t. Hashable t => Int -> RISig t -> Int
forall t. Hashable t => RISig t -> Int
$chashWithSalt :: forall t. Hashable t => Int -> RISig t -> Int
hashWithSalt :: Int -> RISig t -> Int
$chash :: forall t. Hashable t => RISig t -> Int
hash :: RISig t -> Int
Hashable via Generically (RISig t)
deriving Get (RISig t)
[RISig t] -> Put
RISig t -> Put
(RISig t -> Put)
-> Get (RISig t) -> ([RISig t] -> Put) -> Binary (RISig t)
forall t. Binary t => Get (RISig t)
forall t. Binary t => [RISig t] -> Put
forall t. Binary t => RISig t -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall t. Binary t => RISig t -> Put
put :: RISig t -> Put
$cget :: forall t. Binary t => Get (RISig t)
get :: Get (RISig t)
$cputList :: forall t. Binary t => [RISig t] -> Put
putList :: [RISig t] -> Put
B.Binary via Generically (RISig t)
instance F.PPrint t => F.PPrint (RISig t) where
pprintTidy :: Tidy -> RISig t -> Doc
pprintTidy Tidy
k = Tidy -> Doc -> RISig t -> Doc
forall k t. (PPrint k, PPrint t) => Tidy -> k -> RISig t -> Doc
ppRISig Tidy
k (Doc
empty :: Doc)
ppRISig :: (F.PPrint k, F.PPrint t) => F.Tidy -> k -> RISig t -> Doc
ppRISig :: forall k t. (PPrint k, PPrint t) => Tidy -> k -> RISig t -> Doc
ppRISig Tidy
k k
x (RIAssumed t
t) = Doc
"assume" Doc -> Doc -> Doc
<+> Tidy -> k -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k k
x Doc -> Doc -> Doc
<+> Doc
"::" Doc -> Doc -> Doc
<+> Tidy -> t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k t
t
ppRISig Tidy
k k
x (RISig t
t) = Tidy -> k -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k k
x Doc -> Doc -> Doc
<+> Doc
"::" Doc -> Doc -> Doc
<+> Tidy -> t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k t
t
instance F.PPrint t => F.PPrint (RInstance t) where
pprintTidy :: Tidy -> RInstance t -> Doc
pprintTidy Tidy
k (RI BTyCon
n Maybe (Located LHName)
_ [t]
ts [(Located LHName, RISig t)]
mts) = Tidy -> Doc -> BTyCon -> [t] -> [(Located LHName, RISig t)] -> Doc
forall x t a n.
(PPrint x, PPrint t, PPrint a, PPrint n) =>
Tidy -> Doc -> n -> [a] -> [(x, RISig t)] -> Doc
ppMethods Tidy
k Doc
"instance" BTyCon
n [t]
ts [(Located LHName, RISig t)]
mts
newtype DEnv x ty = DEnv (M.HashMap x (M.HashMap Symbol (RISig ty)))
deriving (NonEmpty (DEnv x ty) -> DEnv x ty
DEnv x ty -> DEnv x ty -> DEnv x ty
(DEnv x ty -> DEnv x ty -> DEnv x ty)
-> (NonEmpty (DEnv x ty) -> DEnv x ty)
-> (forall b. Integral b => b -> DEnv x ty -> DEnv x ty)
-> Semigroup (DEnv x ty)
forall b. Integral b => b -> DEnv x ty -> DEnv x ty
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall x ty. Hashable x => NonEmpty (DEnv x ty) -> DEnv x ty
forall x ty. Hashable x => DEnv x ty -> DEnv x ty -> DEnv x ty
forall x ty b.
(Hashable x, Integral b) =>
b -> DEnv x ty -> DEnv x ty
$c<> :: forall x ty. Hashable x => DEnv x ty -> DEnv x ty -> DEnv x ty
<> :: DEnv x ty -> DEnv x ty -> DEnv x ty
$csconcat :: forall x ty. Hashable x => NonEmpty (DEnv x ty) -> DEnv x ty
sconcat :: NonEmpty (DEnv x ty) -> DEnv x ty
$cstimes :: forall x ty b.
(Hashable x, Integral b) =>
b -> DEnv x ty -> DEnv x ty
stimes :: forall b. Integral b => b -> DEnv x ty -> DEnv x ty
Semigroup, Semigroup (DEnv x ty)
DEnv x ty
Semigroup (DEnv x ty) =>
DEnv x ty
-> (DEnv x ty -> DEnv x ty -> DEnv x ty)
-> ([DEnv x ty] -> DEnv x ty)
-> Monoid (DEnv x ty)
[DEnv x ty] -> DEnv x ty
DEnv x ty -> DEnv x ty -> DEnv x ty
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall x ty. Hashable x => Semigroup (DEnv x ty)
forall x ty. Hashable x => DEnv x ty
forall x ty. Hashable x => [DEnv x ty] -> DEnv x ty
forall x ty. Hashable x => DEnv x ty -> DEnv x ty -> DEnv x ty
$cmempty :: forall x ty. Hashable x => DEnv x ty
mempty :: DEnv x ty
$cmappend :: forall x ty. Hashable x => DEnv x ty -> DEnv x ty -> DEnv x ty
mappend :: DEnv x ty -> DEnv x ty -> DEnv x ty
$cmconcat :: forall x ty. Hashable x => [DEnv x ty] -> DEnv x ty
mconcat :: [DEnv x ty] -> DEnv x ty
Monoid, Int -> DEnv x ty -> ShowS
[DEnv x ty] -> ShowS
DEnv x ty -> String
(Int -> DEnv x ty -> ShowS)
-> (DEnv x ty -> String)
-> ([DEnv x ty] -> ShowS)
-> Show (DEnv x ty)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall x ty. (Show x, Show ty) => Int -> DEnv x ty -> ShowS
forall x ty. (Show x, Show ty) => [DEnv x ty] -> ShowS
forall x ty. (Show x, Show ty) => DEnv x ty -> String
$cshowsPrec :: forall x ty. (Show x, Show ty) => Int -> DEnv x ty -> ShowS
showsPrec :: Int -> DEnv x ty -> ShowS
$cshow :: forall x ty. (Show x, Show ty) => DEnv x ty -> String
show :: DEnv x ty -> String
$cshowList :: forall x ty. (Show x, Show ty) => [DEnv x ty] -> ShowS
showList :: [DEnv x ty] -> ShowS
Show, (forall a b. (a -> b) -> DEnv x a -> DEnv x b)
-> (forall a b. a -> DEnv x b -> DEnv x a) -> Functor (DEnv x)
forall a b. a -> DEnv x b -> DEnv x a
forall a b. (a -> b) -> DEnv x a -> DEnv x b
forall x a b. a -> DEnv x b -> DEnv x a
forall x a b. (a -> b) -> DEnv x a -> DEnv x b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall x a b. (a -> b) -> DEnv x a -> DEnv x b
fmap :: forall a b. (a -> b) -> DEnv x a -> DEnv x b
$c<$ :: forall x a b. a -> DEnv x b -> DEnv x a
<$ :: forall a b. a -> DEnv x b -> DEnv x a
Functor)
type RDEnv = DEnv Var SpecType
data MethodType t = MT {forall t. MethodType t -> Maybe t
tyInstance :: !(Maybe t), forall t. MethodType t -> Maybe t
tyClass :: !(Maybe t) }
deriving (Int -> MethodType t -> ShowS
[MethodType t] -> ShowS
MethodType t -> String
(Int -> MethodType t -> ShowS)
-> (MethodType t -> String)
-> ([MethodType t] -> ShowS)
-> Show (MethodType t)
forall t. Show t => Int -> MethodType t -> ShowS
forall t. Show t => [MethodType t] -> ShowS
forall t. Show t => MethodType t -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall t. Show t => Int -> MethodType t -> ShowS
showsPrec :: Int -> MethodType t -> ShowS
$cshow :: forall t. Show t => MethodType t -> String
show :: MethodType t -> String
$cshowList :: forall t. Show t => [MethodType t] -> ShowS
showList :: [MethodType t] -> ShowS
Show)
getMethodType :: MethodType t -> Maybe t
getMethodType :: forall t. MethodType t -> Maybe t
getMethodType (MT (Just t
t) Maybe t
_ ) = t -> Maybe t
forall a. a -> Maybe a
Just t
t
getMethodType (MT Maybe t
_ Maybe t
t) = Maybe t
t
data Axiom b s e = Axiom
{ forall b s e. Axiom b s e -> (Var, Maybe DataCon)
aname :: (Var, Maybe DataCon)
, forall b s e. Axiom b s e -> Maybe b
rname :: Maybe b
, forall b s e. Axiom b s e -> [b]
abinds :: [b]
, forall b s e. Axiom b s e -> [s]
atypes :: [s]
, forall b s e. Axiom b s e -> e
alhs :: e
, forall b s e. Axiom b s e -> e
arhs :: e
}
type HAxiom = Axiom Var Type CoreExpr
instance Show (Axiom Var Type CoreExpr) where
show :: Axiom Var Type CoreExpr -> String
show (Axiom (Var
n, Maybe DataCon
c) Maybe Var
v [Var]
bs [Type]
_ts CoreExpr
lhs CoreExpr
rhs) = String
"Axiom : " String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nFun Name: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Var -> String
forall a. Outputable a => a -> String
showPpr Var
n String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nReal Name: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Maybe Var -> String
forall a. Outputable a => a -> String
showPpr Maybe Var
v String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nData Con: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Maybe DataCon -> String
forall a. Outputable a => a -> String
showPpr Maybe DataCon
c String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nArguments:" String -> ShowS
forall a. [a] -> [a] -> [a]
++ [Var] -> String
forall a. Outputable a => a -> String
showPpr [Var]
bs String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nLHS :" String -> ShowS
forall a. [a] -> [a] -> [a]
++ CoreExpr -> String
forall a. Outputable a => a -> String
showPpr CoreExpr
lhs String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nRHS :" String -> ShowS
forall a. [a] -> [a] -> [a]
++ CoreExpr -> String
forall a. Outputable a => a -> String
showPpr CoreExpr
rhs
data RTAlias x a = RTA
{ forall x a. RTAlias x a -> Symbol
rtName :: Symbol
, forall x a. RTAlias x a -> [x]
rtTArgs :: [x]
, forall x a. RTAlias x a -> [Symbol]
rtVArgs :: [Symbol]
, forall x a. RTAlias x a -> a
rtBody :: a
} deriving (RTAlias x a -> RTAlias x a -> Bool
(RTAlias x a -> RTAlias x a -> Bool)
-> (RTAlias x a -> RTAlias x a -> Bool) -> Eq (RTAlias x a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall x a. (Eq x, Eq a) => RTAlias x a -> RTAlias x a -> Bool
$c== :: forall x a. (Eq x, Eq a) => RTAlias x a -> RTAlias x a -> Bool
== :: RTAlias x a -> RTAlias x a -> Bool
$c/= :: forall x a. (Eq x, Eq a) => RTAlias x a -> RTAlias x a -> Bool
/= :: RTAlias x a -> RTAlias x a -> Bool
Eq, Typeable (RTAlias x a)
Typeable (RTAlias x a) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RTAlias x a -> c (RTAlias x a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RTAlias x a))
-> (RTAlias x a -> Constr)
-> (RTAlias x a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RTAlias x a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RTAlias x a)))
-> ((forall b. Data b => b -> b) -> RTAlias x a -> RTAlias x a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r)
-> (forall u. (forall d. Data d => d -> u) -> RTAlias x a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> RTAlias x a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a))
-> Data (RTAlias x a)
RTAlias x a -> Constr
RTAlias x a -> DataType
(forall b. Data b => b -> b) -> RTAlias x a -> RTAlias x a
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> RTAlias x a -> u
forall u. (forall d. Data d => d -> u) -> RTAlias x a -> [u]
forall x a. (Data x, Data a) => Typeable (RTAlias x a)
forall x a. (Data x, Data a) => RTAlias x a -> Constr
forall x a. (Data x, Data a) => RTAlias x a -> DataType
forall x a.
(Data x, Data a) =>
(forall b. Data b => b -> b) -> RTAlias x a -> RTAlias x a
forall x a u.
(Data x, Data a) =>
Int -> (forall d. Data d => d -> u) -> RTAlias x a -> u
forall x a u.
(Data x, Data a) =>
(forall d. Data d => d -> u) -> RTAlias x a -> [u]
forall x a r r'.
(Data x, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
forall x a r r'.
(Data x, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
forall x a (m :: * -> *).
(Data x, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
forall x a (m :: * -> *).
(Data x, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
forall x a (c :: * -> *).
(Data x, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RTAlias x a)
forall x a (c :: * -> *).
(Data x, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RTAlias x a -> c (RTAlias x a)
forall x a (t :: * -> *) (c :: * -> *).
(Data x, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RTAlias x a))
forall x a (t :: * -> * -> *) (c :: * -> *).
(Data x, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RTAlias x a))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RTAlias x a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RTAlias x a -> c (RTAlias x a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RTAlias x a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RTAlias x a))
$cgfoldl :: forall x a (c :: * -> *).
(Data x, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RTAlias x a -> c (RTAlias x a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RTAlias x a -> c (RTAlias x a)
$cgunfold :: forall x a (c :: * -> *).
(Data x, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RTAlias x a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RTAlias x a)
$ctoConstr :: forall x a. (Data x, Data a) => RTAlias x a -> Constr
toConstr :: RTAlias x a -> Constr
$cdataTypeOf :: forall x a. (Data x, Data a) => RTAlias x a -> DataType
dataTypeOf :: RTAlias x a -> DataType
$cdataCast1 :: forall x a (t :: * -> *) (c :: * -> *).
(Data x, Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RTAlias x a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RTAlias x a))
$cdataCast2 :: forall x a (t :: * -> * -> *) (c :: * -> *).
(Data x, Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RTAlias x a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RTAlias x a))
$cgmapT :: forall x a.
(Data x, Data a) =>
(forall b. Data b => b -> b) -> RTAlias x a -> RTAlias x a
gmapT :: (forall b. Data b => b -> b) -> RTAlias x a -> RTAlias x a
$cgmapQl :: forall x a r r'.
(Data x, Data a) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
$cgmapQr :: forall x a r r'.
(Data x, Data a) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RTAlias x a -> r
$cgmapQ :: forall x a u.
(Data x, Data a) =>
(forall d. Data d => d -> u) -> RTAlias x a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RTAlias x a -> [u]
$cgmapQi :: forall x a u.
(Data x, Data a) =>
Int -> (forall d. Data d => d -> u) -> RTAlias x a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RTAlias x a -> u
$cgmapM :: forall x a (m :: * -> *).
(Data x, Data a, Monad m) =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
$cgmapMp :: forall x a (m :: * -> *).
(Data x, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
$cgmapMo :: forall x a (m :: * -> *).
(Data x, Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RTAlias x a -> m (RTAlias x a)
Data, Typeable, (forall x. RTAlias x a -> Rep (RTAlias x a) x)
-> (forall x. Rep (RTAlias x a) x -> RTAlias x a)
-> Generic (RTAlias x a)
forall x. Rep (RTAlias x a) x -> RTAlias x a
forall x. RTAlias x a -> Rep (RTAlias x a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall x a x. Rep (RTAlias x a) x -> RTAlias x a
forall x a x. RTAlias x a -> Rep (RTAlias x a) x
$cfrom :: forall x a x. RTAlias x a -> Rep (RTAlias x a) x
from :: forall x. RTAlias x a -> Rep (RTAlias x a) x
$cto :: forall x a x. Rep (RTAlias x a) x -> RTAlias x a
to :: forall x. Rep (RTAlias x a) x -> RTAlias x a
Generic, (forall a b. (a -> b) -> RTAlias x a -> RTAlias x b)
-> (forall a b. a -> RTAlias x b -> RTAlias x a)
-> Functor (RTAlias x)
forall a b. a -> RTAlias x b -> RTAlias x a
forall a b. (a -> b) -> RTAlias x a -> RTAlias x b
forall x a b. a -> RTAlias x b -> RTAlias x a
forall x a b. (a -> b) -> RTAlias x a -> RTAlias x b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall x a b. (a -> b) -> RTAlias x a -> RTAlias x b
fmap :: forall a b. (a -> b) -> RTAlias x a -> RTAlias x b
$c<$ :: forall x a b. a -> RTAlias x b -> RTAlias x a
<$ :: forall a b. a -> RTAlias x b -> RTAlias x a
Functor, (forall m. Monoid m => RTAlias x m -> m)
-> (forall m a. Monoid m => (a -> m) -> RTAlias x a -> m)
-> (forall m a. Monoid m => (a -> m) -> RTAlias x a -> m)
-> (forall a b. (a -> b -> b) -> b -> RTAlias x a -> b)
-> (forall a b. (a -> b -> b) -> b -> RTAlias x a -> b)
-> (forall b a. (b -> a -> b) -> b -> RTAlias x a -> b)
-> (forall b a. (b -> a -> b) -> b -> RTAlias x a -> b)
-> (forall a. (a -> a -> a) -> RTAlias x a -> a)
-> (forall a. (a -> a -> a) -> RTAlias x a -> a)
-> (forall a. RTAlias x a -> [a])
-> (forall a. RTAlias x a -> Bool)
-> (forall a. RTAlias x a -> Int)
-> (forall a. Eq a => a -> RTAlias x a -> Bool)
-> (forall a. Ord a => RTAlias x a -> a)
-> (forall a. Ord a => RTAlias x a -> a)
-> (forall a. Num a => RTAlias x a -> a)
-> (forall a. Num a => RTAlias x a -> a)
-> Foldable (RTAlias x)
forall a. Eq a => a -> RTAlias x a -> Bool
forall a. Num a => RTAlias x a -> a
forall a. Ord a => RTAlias x a -> a
forall m. Monoid m => RTAlias x m -> m
forall a. RTAlias x a -> Bool
forall a. RTAlias x a -> Int
forall a. RTAlias x a -> [a]
forall a. (a -> a -> a) -> RTAlias x a -> a
forall x a. Eq a => a -> RTAlias x a -> Bool
forall x a. Num a => RTAlias x a -> a
forall x a. Ord a => RTAlias x a -> a
forall x m. Monoid m => RTAlias x m -> m
forall m a. Monoid m => (a -> m) -> RTAlias x a -> m
forall x a. RTAlias x a -> Bool
forall x a. RTAlias x a -> Int
forall x a. RTAlias x a -> [a]
forall b a. (b -> a -> b) -> b -> RTAlias x a -> b
forall a b. (a -> b -> b) -> b -> RTAlias x a -> b
forall x a. (a -> a -> a) -> RTAlias x a -> a
forall x m a. Monoid m => (a -> m) -> RTAlias x a -> m
forall x b a. (b -> a -> b) -> b -> RTAlias x a -> b
forall x a b. (a -> b -> b) -> b -> RTAlias x 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
$cfold :: forall x m. Monoid m => RTAlias x m -> m
fold :: forall m. Monoid m => RTAlias x m -> m
$cfoldMap :: forall x m a. Monoid m => (a -> m) -> RTAlias x a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> RTAlias x a -> m
$cfoldMap' :: forall x m a. Monoid m => (a -> m) -> RTAlias x a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> RTAlias x a -> m
$cfoldr :: forall x a b. (a -> b -> b) -> b -> RTAlias x a -> b
foldr :: forall a b. (a -> b -> b) -> b -> RTAlias x a -> b
$cfoldr' :: forall x a b. (a -> b -> b) -> b -> RTAlias x a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> RTAlias x a -> b
$cfoldl :: forall x b a. (b -> a -> b) -> b -> RTAlias x a -> b
foldl :: forall b a. (b -> a -> b) -> b -> RTAlias x a -> b
$cfoldl' :: forall x b a. (b -> a -> b) -> b -> RTAlias x a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> RTAlias x a -> b
$cfoldr1 :: forall x a. (a -> a -> a) -> RTAlias x a -> a
foldr1 :: forall a. (a -> a -> a) -> RTAlias x a -> a
$cfoldl1 :: forall x a. (a -> a -> a) -> RTAlias x a -> a
foldl1 :: forall a. (a -> a -> a) -> RTAlias x a -> a
$ctoList :: forall x a. RTAlias x a -> [a]
toList :: forall a. RTAlias x a -> [a]
$cnull :: forall x a. RTAlias x a -> Bool
null :: forall a. RTAlias x a -> Bool
$clength :: forall x a. RTAlias x a -> Int
length :: forall a. RTAlias x a -> Int
$celem :: forall x a. Eq a => a -> RTAlias x a -> Bool
elem :: forall a. Eq a => a -> RTAlias x a -> Bool
$cmaximum :: forall x a. Ord a => RTAlias x a -> a
maximum :: forall a. Ord a => RTAlias x a -> a
$cminimum :: forall x a. Ord a => RTAlias x a -> a
minimum :: forall a. Ord a => RTAlias x a -> a
$csum :: forall x a. Num a => RTAlias x a -> a
sum :: forall a. Num a => RTAlias x a -> a
$cproduct :: forall x a. Num a => RTAlias x a -> a
product :: forall a. Num a => RTAlias x a -> a
Foldable, Functor (RTAlias x)
Foldable (RTAlias x)
(Functor (RTAlias x), Foldable (RTAlias x)) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RTAlias x a -> f (RTAlias x b))
-> (forall (f :: * -> *) a.
Applicative f =>
RTAlias x (f a) -> f (RTAlias x a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RTAlias x a -> m (RTAlias x b))
-> (forall (m :: * -> *) a.
Monad m =>
RTAlias x (m a) -> m (RTAlias x a))
-> Traversable (RTAlias x)
forall x. Functor (RTAlias x)
forall x. Foldable (RTAlias x)
forall x (m :: * -> *) a.
Monad m =>
RTAlias x (m a) -> m (RTAlias x a)
forall x (f :: * -> *) a.
Applicative f =>
RTAlias x (f a) -> f (RTAlias x a)
forall x (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RTAlias x a -> m (RTAlias x b)
forall x (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RTAlias x a -> f (RTAlias x 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 =>
RTAlias x (m a) -> m (RTAlias x a)
forall (f :: * -> *) a.
Applicative f =>
RTAlias x (f a) -> f (RTAlias x a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RTAlias x a -> m (RTAlias x b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RTAlias x a -> f (RTAlias x b)
$ctraverse :: forall x (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RTAlias x a -> f (RTAlias x b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RTAlias x a -> f (RTAlias x b)
$csequenceA :: forall x (f :: * -> *) a.
Applicative f =>
RTAlias x (f a) -> f (RTAlias x a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
RTAlias x (f a) -> f (RTAlias x a)
$cmapM :: forall x (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RTAlias x a -> m (RTAlias x b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RTAlias x a -> m (RTAlias x b)
$csequence :: forall x (m :: * -> *) a.
Monad m =>
RTAlias x (m a) -> m (RTAlias x a)
sequence :: forall (m :: * -> *) a.
Monad m =>
RTAlias x (m a) -> m (RTAlias x a)
Traversable)
deriving Eq (RTAlias x a)
Eq (RTAlias x a) =>
(Int -> RTAlias x a -> Int)
-> (RTAlias x a -> Int) -> Hashable (RTAlias x a)
Int -> RTAlias x a -> Int
RTAlias x a -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall x a. (Hashable x, Hashable a) => Eq (RTAlias x a)
forall x a. (Hashable x, Hashable a) => Int -> RTAlias x a -> Int
forall x a. (Hashable x, Hashable a) => RTAlias x a -> Int
$chashWithSalt :: forall x a. (Hashable x, Hashable a) => Int -> RTAlias x a -> Int
hashWithSalt :: Int -> RTAlias x a -> Int
$chash :: forall x a. (Hashable x, Hashable a) => RTAlias x a -> Int
hash :: RTAlias x a -> Int
Hashable via Generically (RTAlias x a)
deriving Get (RTAlias x a)
[RTAlias x a] -> Put
RTAlias x a -> Put
(RTAlias x a -> Put)
-> Get (RTAlias x a)
-> ([RTAlias x a] -> Put)
-> Binary (RTAlias x a)
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
forall x a. (Binary x, Binary a) => Get (RTAlias x a)
forall x a. (Binary x, Binary a) => [RTAlias x a] -> Put
forall x a. (Binary x, Binary a) => RTAlias x a -> Put
$cput :: forall x a. (Binary x, Binary a) => RTAlias x a -> Put
put :: RTAlias x a -> Put
$cget :: forall x a. (Binary x, Binary a) => Get (RTAlias x a)
get :: Get (RTAlias x a)
$cputList :: forall x a. (Binary x, Binary a) => [RTAlias x a] -> Put
putList :: [RTAlias x a] -> Put
B.Binary via Generically (RTAlias x a)
mapRTAVars :: (a -> b) -> RTAlias a ty -> RTAlias b ty
mapRTAVars :: forall a b ty. (a -> b) -> RTAlias a ty -> RTAlias b ty
mapRTAVars a -> b
f RTAlias a ty
rt = RTAlias a ty
rt { rtTArgs = f <$> rtTArgs rt }
lmapEAlias :: LMap -> F.Located (RTAlias Symbol Expr)
lmapEAlias :: LMap -> Located (RTAlias Symbol Expr)
lmapEAlias (LMap LocSymbol
v [Symbol]
ys Expr
e) = LocSymbol -> RTAlias Symbol Expr -> Located (RTAlias Symbol Expr)
forall l b. Loc l => l -> b -> Located b
F.atLoc LocSymbol
v (Symbol -> [Symbol] -> [Symbol] -> Expr -> RTAlias Symbol Expr
forall x a. Symbol -> [x] -> [Symbol] -> a -> RTAlias x a
RTA (LocSymbol -> Symbol
forall a. Located a -> a
F.val LocSymbol
v) [] [Symbol]
ys Expr
e)
type REnv = AREnv SpecType
data AREnv t = REnv
{ forall t. AREnv t -> HashMap Symbol t
reGlobal :: M.HashMap Symbol t
, forall t. AREnv t -> HashMap Symbol t
reLocal :: M.HashMap Symbol t
}
instance Functor AREnv where
fmap :: forall a b. (a -> b) -> AREnv a -> AREnv b
fmap a -> b
f (REnv HashMap Symbol a
g HashMap Symbol a
l) = HashMap Symbol b -> HashMap Symbol b -> AREnv b
forall t. HashMap Symbol t -> HashMap Symbol t -> AREnv t
REnv ((a -> b) -> HashMap Symbol a -> HashMap Symbol b
forall a b. (a -> b) -> HashMap Symbol a -> HashMap Symbol b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f HashMap Symbol a
g) ((a -> b) -> HashMap Symbol a -> HashMap Symbol b
forall a b. (a -> b) -> HashMap Symbol a -> HashMap Symbol b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f HashMap Symbol a
l)
instance (F.PPrint t) => F.PPrint (AREnv t) where
pprintTidy :: Tidy -> AREnv t -> Doc
pprintTidy Tidy
k AREnv t
re =
Doc
"RENV LOCAL"
Doc -> Doc -> Doc
$+$
Doc
""
Doc -> Doc -> Doc
$+$
Tidy -> HashMap Symbol t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (AREnv t -> HashMap Symbol t
forall t. AREnv t -> HashMap Symbol t
reLocal AREnv t
re)
Doc -> Doc -> Doc
$+$
Doc
""
Doc -> Doc -> Doc
$+$
Doc
"RENV GLOBAL"
Doc -> Doc -> Doc
$+$
Doc
""
Doc -> Doc -> Doc
$+$
Tidy -> HashMap Symbol t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (AREnv t -> HashMap Symbol t
forall t. AREnv t -> HashMap Symbol t
reGlobal AREnv t
re)
instance Semigroup REnv where
REnv HashMap Symbol SpecType
g1 HashMap Symbol SpecType
l1 <> :: REnv -> REnv -> REnv
<> REnv HashMap Symbol SpecType
g2 HashMap Symbol SpecType
l2 = HashMap Symbol SpecType -> HashMap Symbol SpecType -> REnv
forall t. HashMap Symbol t -> HashMap Symbol t -> AREnv t
REnv (HashMap Symbol SpecType
g1 HashMap Symbol SpecType
-> HashMap Symbol SpecType -> HashMap Symbol SpecType
forall a. Semigroup a => a -> a -> a
<> HashMap Symbol SpecType
g2) (HashMap Symbol SpecType
l1 HashMap Symbol SpecType
-> HashMap Symbol SpecType -> HashMap Symbol SpecType
forall a. Semigroup a => a -> a -> a
<> HashMap Symbol SpecType
l2)
instance Monoid REnv where
mempty :: REnv
mempty = HashMap Symbol SpecType -> HashMap Symbol SpecType -> REnv
forall t. HashMap Symbol t -> HashMap Symbol t -> AREnv t
REnv HashMap Symbol SpecType
forall a. Monoid a => a
mempty HashMap Symbol SpecType
forall a. Monoid a => a
mempty
instance NFData REnv where
rnf :: REnv -> ()
rnf REnv{} = ()
data Warning = Warning {
Warning -> SrcSpan
warnSpan :: SrcSpan
, Warning -> Doc
warnDoc :: Doc
} deriving (Warning -> Warning -> Bool
(Warning -> Warning -> Bool)
-> (Warning -> Warning -> Bool) -> Eq Warning
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Warning -> Warning -> Bool
== :: Warning -> Warning -> Bool
$c/= :: Warning -> Warning -> Bool
/= :: Warning -> Warning -> Bool
Eq, Int -> Warning -> ShowS
[Warning] -> ShowS
Warning -> String
(Int -> Warning -> ShowS)
-> (Warning -> String) -> ([Warning] -> ShowS) -> Show Warning
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Warning -> ShowS
showsPrec :: Int -> Warning -> ShowS
$cshow :: Warning -> String
show :: Warning -> String
$cshowList :: [Warning] -> ShowS
showList :: [Warning] -> ShowS
Show)
mkWarning :: SrcSpan -> Doc -> Warning
mkWarning :: SrcSpan -> Doc -> Warning
mkWarning = SrcSpan -> Doc -> Warning
Warning
data Diagnostics = Diagnostics {
Diagnostics -> [Warning]
dWarnings :: [Warning]
, Diagnostics -> [Error]
dErrors :: [Error]
} deriving Diagnostics -> Diagnostics -> Bool
(Diagnostics -> Diagnostics -> Bool)
-> (Diagnostics -> Diagnostics -> Bool) -> Eq Diagnostics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Diagnostics -> Diagnostics -> Bool
== :: Diagnostics -> Diagnostics -> Bool
$c/= :: Diagnostics -> Diagnostics -> Bool
/= :: Diagnostics -> Diagnostics -> Bool
Eq
instance Semigroup Diagnostics where
(Diagnostics [Warning]
w1 [Error]
e1) <> :: Diagnostics -> Diagnostics -> Diagnostics
<> (Diagnostics [Warning]
w2 [Error]
e2) = [Warning] -> [Error] -> Diagnostics
Diagnostics ([Warning]
w1 [Warning] -> [Warning] -> [Warning]
forall a. Semigroup a => a -> a -> a
<> [Warning]
w2) ([Error]
e1 [Error] -> [Error] -> [Error]
forall a. Semigroup a => a -> a -> a
<> [Error]
e2)
instance Monoid Diagnostics where
mempty :: Diagnostics
mempty = Diagnostics
emptyDiagnostics
mappend :: Diagnostics -> Diagnostics -> Diagnostics
mappend = Diagnostics -> Diagnostics -> Diagnostics
forall a. Semigroup a => a -> a -> a
(<>)
mkDiagnostics :: [Warning] -> [Error] -> Diagnostics
mkDiagnostics :: [Warning] -> [Error] -> Diagnostics
mkDiagnostics = [Warning] -> [Error] -> Diagnostics
Diagnostics
emptyDiagnostics :: Diagnostics
emptyDiagnostics :: Diagnostics
emptyDiagnostics = [Warning] -> [Error] -> Diagnostics
Diagnostics [Warning]
forall a. Monoid a => a
mempty [Error]
forall a. Monoid a => a
mempty
noErrors :: Diagnostics -> Bool
noErrors :: Diagnostics -> Bool
noErrors = [Error] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([Error] -> Bool)
-> (Diagnostics -> [Error]) -> Diagnostics -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Diagnostics -> [Error]
dErrors
allWarnings :: Diagnostics -> [Warning]
allWarnings :: Diagnostics -> [Warning]
allWarnings = Diagnostics -> [Warning]
dWarnings
allErrors :: Diagnostics -> [Error]
allErrors :: Diagnostics -> [Error]
allErrors = Diagnostics -> [Error]
dErrors
printWarning :: Logger -> Warning -> IO ()
printWarning :: Logger -> Warning -> IO ()
printWarning Logger
logger (Warning SrcSpan
srcSpan Doc
doc) = Logger -> SrcSpan -> Doc -> IO ()
GHC.putWarnMsg Logger
logger SrcSpan
srcSpan Doc
doc
type ErrorResult = F.FixResult UserError
type Error = TError SpecType
instance NFData a => NFData (TError a)
data Cinfo = Ci
{ Cinfo -> SrcSpan
ci_loc :: !SrcSpan
, Cinfo -> Maybe Error
ci_err :: !(Maybe Error)
, Cinfo -> Maybe Var
ci_var :: !(Maybe Var)
}
deriving (Cinfo -> Cinfo -> Bool
(Cinfo -> Cinfo -> Bool) -> (Cinfo -> Cinfo -> Bool) -> Eq Cinfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cinfo -> Cinfo -> Bool
== :: Cinfo -> Cinfo -> Bool
$c/= :: Cinfo -> Cinfo -> Bool
/= :: Cinfo -> Cinfo -> Bool
Eq, (forall x. Cinfo -> Rep Cinfo x)
-> (forall x. Rep Cinfo x -> Cinfo) -> Generic Cinfo
forall x. Rep Cinfo x -> Cinfo
forall x. Cinfo -> Rep Cinfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Cinfo -> Rep Cinfo x
from :: forall x. Cinfo -> Rep Cinfo x
$cto :: forall x. Rep Cinfo x -> Cinfo
to :: forall x. Rep Cinfo x -> Cinfo
Generic)
instance F.Loc Cinfo where
srcSpan :: Cinfo -> SrcSpan
srcSpan = SrcSpan -> SrcSpan
srcSpanFSrcSpan (SrcSpan -> SrcSpan) -> (Cinfo -> SrcSpan) -> Cinfo -> SrcSpan
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cinfo -> SrcSpan
ci_loc
instance NFData Cinfo
instance F.PPrint Cinfo where
pprintTidy :: Tidy -> Cinfo -> Doc
pprintTidy Tidy
k = Tidy -> SrcSpan -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (SrcSpan -> Doc) -> (Cinfo -> SrcSpan) -> Cinfo -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cinfo -> SrcSpan
ci_loc
instance F.Fixpoint Cinfo where
toFix :: Cinfo -> Doc
toFix = String -> Doc
text (String -> Doc) -> (Cinfo -> String) -> Cinfo -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SrcSpan -> String
forall a. Outputable a => a -> String
showPpr (SrcSpan -> String) -> (Cinfo -> SrcSpan) -> Cinfo -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cinfo -> SrcSpan
ci_loc
instance Show Cinfo where
show :: Cinfo -> String
show = Doc -> String
forall a. Show a => a -> String
show (Doc -> String) -> (Cinfo -> Doc) -> Cinfo -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cinfo -> Doc
forall a. Fixpoint a => a -> Doc
F.toFix
data ModName = ModName !ModType !ModuleName
deriving (ModName -> ModName -> Bool
(ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool) -> Eq ModName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModName -> ModName -> Bool
== :: ModName -> ModName -> Bool
$c/= :: ModName -> ModName -> Bool
/= :: ModName -> ModName -> Bool
Eq, Eq ModName
Eq ModName =>
(ModName -> ModName -> Ordering)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> ModName)
-> (ModName -> ModName -> ModName)
-> Ord ModName
ModName -> ModName -> Bool
ModName -> ModName -> Ordering
ModName -> ModName -> ModName
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
$ccompare :: ModName -> ModName -> Ordering
compare :: ModName -> ModName -> Ordering
$c< :: ModName -> ModName -> Bool
< :: ModName -> ModName -> Bool
$c<= :: ModName -> ModName -> Bool
<= :: ModName -> ModName -> Bool
$c> :: ModName -> ModName -> Bool
> :: ModName -> ModName -> Bool
$c>= :: ModName -> ModName -> Bool
>= :: ModName -> ModName -> Bool
$cmax :: ModName -> ModName -> ModName
max :: ModName -> ModName -> ModName
$cmin :: ModName -> ModName -> ModName
min :: ModName -> ModName -> ModName
Ord, Int -> ModName -> ShowS
[ModName] -> ShowS
ModName -> String
(Int -> ModName -> ShowS)
-> (ModName -> String) -> ([ModName] -> ShowS) -> Show ModName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ModName -> ShowS
showsPrec :: Int -> ModName -> ShowS
$cshow :: ModName -> String
show :: ModName -> String
$cshowList :: [ModName] -> ShowS
showList :: [ModName] -> ShowS
Show, (forall x. ModName -> Rep ModName x)
-> (forall x. Rep ModName x -> ModName) -> Generic ModName
forall x. Rep ModName x -> ModName
forall x. ModName -> Rep ModName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ModName -> Rep ModName x
from :: forall x. ModName -> Rep ModName x
$cto :: forall x. Rep ModName x -> ModName
to :: forall x. Rep ModName x -> ModName
Generic, Typeable ModName
Typeable ModName =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName)
-> (ModName -> Constr)
-> (ModName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName))
-> ((forall b. Data b => b -> b) -> ModName -> ModName)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r)
-> (forall u. (forall d. Data d => d -> u) -> ModName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName)
-> Data ModName
ModName -> Constr
ModName -> DataType
(forall b. Data b => b -> b) -> ModName -> ModName
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) -> ModName -> u
forall u. (forall d. Data d => d -> u) -> ModName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
$ctoConstr :: ModName -> Constr
toConstr :: ModName -> Constr
$cdataTypeOf :: ModName -> DataType
dataTypeOf :: ModName -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
$cgmapT :: (forall b. Data b => b -> b) -> ModName -> ModName
gmapT :: (forall b. Data b => b -> b) -> ModName -> ModName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ModName -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
Data, Typeable)
data ModType = Target | SrcImport | SpecImport
deriving (ModType -> ModType -> Bool
(ModType -> ModType -> Bool)
-> (ModType -> ModType -> Bool) -> Eq ModType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModType -> ModType -> Bool
== :: ModType -> ModType -> Bool
$c/= :: ModType -> ModType -> Bool
/= :: ModType -> ModType -> Bool
Eq, Eq ModType
Eq ModType =>
(ModType -> ModType -> Ordering)
-> (ModType -> ModType -> Bool)
-> (ModType -> ModType -> Bool)
-> (ModType -> ModType -> Bool)
-> (ModType -> ModType -> Bool)
-> (ModType -> ModType -> ModType)
-> (ModType -> ModType -> ModType)
-> Ord ModType
ModType -> ModType -> Bool
ModType -> ModType -> Ordering
ModType -> ModType -> ModType
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
$ccompare :: ModType -> ModType -> Ordering
compare :: ModType -> ModType -> Ordering
$c< :: ModType -> ModType -> Bool
< :: ModType -> ModType -> Bool
$c<= :: ModType -> ModType -> Bool
<= :: ModType -> ModType -> Bool
$c> :: ModType -> ModType -> Bool
> :: ModType -> ModType -> Bool
$c>= :: ModType -> ModType -> Bool
>= :: ModType -> ModType -> Bool
$cmax :: ModType -> ModType -> ModType
max :: ModType -> ModType -> ModType
$cmin :: ModType -> ModType -> ModType
min :: ModType -> ModType -> ModType
Ord, Int -> ModType -> ShowS
[ModType] -> ShowS
ModType -> String
(Int -> ModType -> ShowS)
-> (ModType -> String) -> ([ModType] -> ShowS) -> Show ModType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ModType -> ShowS
showsPrec :: Int -> ModType -> ShowS
$cshow :: ModType -> String
show :: ModType -> String
$cshowList :: [ModType] -> ShowS
showList :: [ModType] -> ShowS
Show, (forall x. ModType -> Rep ModType x)
-> (forall x. Rep ModType x -> ModType) -> Generic ModType
forall x. Rep ModType x -> ModType
forall x. ModType -> Rep ModType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ModType -> Rep ModType x
from :: forall x. ModType -> Rep ModType x
$cto :: forall x. Rep ModType x -> ModType
to :: forall x. Rep ModType x -> ModType
Generic, Typeable ModType
Typeable ModType =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModType -> c ModType)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModType)
-> (ModType -> Constr)
-> (ModType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModType))
-> ((forall b. Data b => b -> b) -> ModType -> ModType)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r)
-> (forall u. (forall d. Data d => d -> u) -> ModType -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ModType -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType)
-> Data ModType
ModType -> Constr
ModType -> DataType
(forall b. Data b => b -> b) -> ModType -> ModType
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) -> ModType -> u
forall u. (forall d. Data d => d -> u) -> ModType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModType -> c ModType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModType)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModType -> c ModType
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModType -> c ModType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModType
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModType
$ctoConstr :: ModType -> Constr
toConstr :: ModType -> Constr
$cdataTypeOf :: ModType -> DataType
dataTypeOf :: ModType -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModType)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModType)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModType)
$cgmapT :: (forall b. Data b => b -> b) -> ModType -> ModType
gmapT :: (forall b. Data b => b -> b) -> ModType -> ModType
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModType -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModType -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ModType -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModType -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModType -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModType -> m ModType
Data, Typeable)
instance Hashable ModType
instance Hashable ModName where
hashWithSalt :: Int -> ModName -> Int
hashWithSalt Int
i (ModName ModType
t ModuleName
n) = Int -> (ModType, String) -> Int
forall a. Hashable a => Int -> a -> Int
hashWithSalt Int
i (ModType
t, ModuleName -> String
forall a. Show a => a -> String
show ModuleName
n)
instance F.PPrint ModName where
pprintTidy :: Tidy -> ModName -> Doc
pprintTidy Tidy
_ = String -> Doc
text (String -> Doc) -> (ModName -> String) -> ModName -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModName -> String
forall a. Show a => a -> String
show
instance F.Symbolic ModName where
symbol :: ModName -> Symbol
symbol (ModName ModType
_ ModuleName
m) = ModuleName -> Symbol
forall a. Symbolic a => a -> Symbol
F.symbol ModuleName
m
instance F.Symbolic ModuleName where
symbol :: ModuleName -> Symbol
symbol = FastString -> Symbol
forall a. Symbolic a => a -> Symbol
F.symbol (FastString -> Symbol)
-> (ModuleName -> FastString) -> ModuleName -> Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModuleName -> FastString
moduleNameFS
isTarget :: ModName -> Bool
isTarget :: ModName -> Bool
isTarget (ModName ModType
Target ModuleName
_) = Bool
True
isTarget ModName
_ = Bool
False
isSrcImport :: ModName -> Bool
isSrcImport :: ModName -> Bool
isSrcImport (ModName ModType
SrcImport ModuleName
_) = Bool
True
isSrcImport ModName
_ = Bool
False
isSpecImport :: ModName -> Bool
isSpecImport :: ModName -> Bool
isSpecImport (ModName ModType
SpecImport ModuleName
_) = Bool
True
isSpecImport ModName
_ = Bool
False
getModName :: ModName -> ModuleName
getModName :: ModName -> ModuleName
getModName (ModName ModType
_ ModuleName
m) = ModuleName
m
getModString :: ModName -> String
getModString :: ModName -> String
getModString = ModuleName -> String
moduleNameString (ModuleName -> String)
-> (ModName -> ModuleName) -> ModName -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModName -> ModuleName
getModName
data RTEnv tv t = RTE
{ forall tv t. RTEnv tv t -> HashMap Symbol (Located (RTAlias tv t))
typeAliases :: M.HashMap Symbol (F.Located (RTAlias tv t))
, forall tv t.
RTEnv tv t -> HashMap Symbol (Located (RTAlias Symbol Expr))
exprAliases :: M.HashMap Symbol (F.Located (RTAlias Symbol Expr))
}
instance Monoid (RTEnv tv t) where
mempty :: RTEnv tv t
mempty = HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias Symbol Expr)) -> RTEnv tv t
forall tv t.
HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias Symbol Expr)) -> RTEnv tv t
RTE HashMap Symbol (Located (RTAlias tv t))
forall k v. HashMap k v
M.empty HashMap Symbol (Located (RTAlias Symbol Expr))
forall k v. HashMap k v
M.empty
mappend :: RTEnv tv t -> RTEnv tv t -> RTEnv tv t
mappend = RTEnv tv t -> RTEnv tv t -> RTEnv tv t
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup (RTEnv tv t) where
RTE HashMap Symbol (Located (RTAlias tv t))
x HashMap Symbol (Located (RTAlias Symbol Expr))
y <> :: RTEnv tv t -> RTEnv tv t -> RTEnv tv t
<> RTE HashMap Symbol (Located (RTAlias tv t))
x' HashMap Symbol (Located (RTAlias Symbol Expr))
y' = HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias Symbol Expr)) -> RTEnv tv t
forall tv t.
HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias Symbol Expr)) -> RTEnv tv t
RTE (HashMap Symbol (Located (RTAlias tv t))
x HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias tv t))
-> HashMap Symbol (Located (RTAlias tv t))
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
`M.union` HashMap Symbol (Located (RTAlias tv t))
x') (HashMap Symbol (Located (RTAlias Symbol Expr))
y HashMap Symbol (Located (RTAlias Symbol Expr))
-> HashMap Symbol (Located (RTAlias Symbol Expr))
-> HashMap Symbol (Located (RTAlias Symbol Expr))
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
`M.union` HashMap Symbol (Located (RTAlias Symbol Expr))
y')
type Body = BodyV F.Symbol
data BodyV v
= E (F.ExprV v)
| P (F.ExprV v)
| R Symbol (F.ExprV v)
deriving (Int -> BodyV v -> ShowS
[BodyV v] -> ShowS
BodyV v -> String
(Int -> BodyV v -> ShowS)
-> (BodyV v -> String) -> ([BodyV v] -> ShowS) -> Show (BodyV v)
forall v. (Show v, Fixpoint v, Ord v) => Int -> BodyV v -> ShowS
forall v. (Show v, Fixpoint v, Ord v) => [BodyV v] -> ShowS
forall v. (Show v, Fixpoint v, Ord v) => BodyV v -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall v. (Show v, Fixpoint v, Ord v) => Int -> BodyV v -> ShowS
showsPrec :: Int -> BodyV v -> ShowS
$cshow :: forall v. (Show v, Fixpoint v, Ord v) => BodyV v -> String
show :: BodyV v -> String
$cshowList :: forall v. (Show v, Fixpoint v, Ord v) => [BodyV v] -> ShowS
showList :: [BodyV v] -> ShowS
Show, Typeable (BodyV v)
Typeable (BodyV v) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyV v -> c (BodyV v))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (BodyV v))
-> (BodyV v -> Constr)
-> (BodyV v -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (BodyV v)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BodyV v)))
-> ((forall b. Data b => b -> b) -> BodyV v -> BodyV v)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r)
-> (forall u. (forall d. Data d => d -> u) -> BodyV v -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> BodyV v -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v))
-> Data (BodyV v)
BodyV v -> Constr
BodyV v -> DataType
(forall b. Data b => b -> b) -> BodyV v -> BodyV v
forall v. Data v => Typeable (BodyV v)
forall v. Data v => BodyV v -> Constr
forall v. Data v => BodyV v -> DataType
forall v.
Data v =>
(forall b. Data b => b -> b) -> BodyV v -> BodyV v
forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> BodyV v -> u
forall v u.
Data v =>
(forall d. Data d => d -> u) -> BodyV v -> [u]
forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (BodyV v)
forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyV v -> c (BodyV v)
forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (BodyV v))
forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BodyV v))
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) -> BodyV v -> u
forall u. (forall d. Data d => d -> u) -> BodyV v -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (BodyV v)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyV v -> c (BodyV v)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (BodyV v))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BodyV v))
$cgfoldl :: forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyV v -> c (BodyV v)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BodyV v -> c (BodyV v)
$cgunfold :: forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (BodyV v)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (BodyV v)
$ctoConstr :: forall v. Data v => BodyV v -> Constr
toConstr :: BodyV v -> Constr
$cdataTypeOf :: forall v. Data v => BodyV v -> DataType
dataTypeOf :: BodyV v -> DataType
$cdataCast1 :: forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (BodyV v))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (BodyV v))
$cdataCast2 :: forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BodyV v))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BodyV v))
$cgmapT :: forall v.
Data v =>
(forall b. Data b => b -> b) -> BodyV v -> BodyV v
gmapT :: (forall b. Data b => b -> b) -> BodyV v -> BodyV v
$cgmapQl :: forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
$cgmapQr :: forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BodyV v -> r
$cgmapQ :: forall v u.
Data v =>
(forall d. Data d => d -> u) -> BodyV v -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> BodyV v -> [u]
$cgmapQi :: forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> BodyV v -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BodyV v -> u
$cgmapM :: forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
$cgmapMp :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
$cgmapMo :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BodyV v -> m (BodyV v)
Data, Typeable, (forall x. BodyV v -> Rep (BodyV v) x)
-> (forall x. Rep (BodyV v) x -> BodyV v) -> Generic (BodyV v)
forall x. Rep (BodyV v) x -> BodyV v
forall x. BodyV v -> Rep (BodyV v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v x. Rep (BodyV v) x -> BodyV v
forall v x. BodyV v -> Rep (BodyV v) x
$cfrom :: forall v x. BodyV v -> Rep (BodyV v) x
from :: forall x. BodyV v -> Rep (BodyV v) x
$cto :: forall v x. Rep (BodyV v) x -> BodyV v
to :: forall x. Rep (BodyV v) x -> BodyV v
Generic, BodyV v -> BodyV v -> Bool
(BodyV v -> BodyV v -> Bool)
-> (BodyV v -> BodyV v -> Bool) -> Eq (BodyV v)
forall v. Eq v => BodyV v -> BodyV v -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall v. Eq v => BodyV v -> BodyV v -> Bool
== :: BodyV v -> BodyV v -> Bool
$c/= :: forall v. Eq v => BodyV v -> BodyV v -> Bool
/= :: BodyV v -> BodyV v -> Bool
Eq, (forall a b. (a -> b) -> BodyV a -> BodyV b)
-> (forall a b. a -> BodyV b -> BodyV a) -> Functor BodyV
forall a b. a -> BodyV b -> BodyV a
forall a b. (a -> b) -> BodyV a -> BodyV b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> BodyV a -> BodyV b
fmap :: forall a b. (a -> b) -> BodyV a -> BodyV b
$c<$ :: forall a b. a -> BodyV b -> BodyV a
<$ :: forall a b. a -> BodyV b -> BodyV a
Functor, (forall m. Monoid m => BodyV m -> m)
-> (forall m a. Monoid m => (a -> m) -> BodyV a -> m)
-> (forall m a. Monoid m => (a -> m) -> BodyV a -> m)
-> (forall a b. (a -> b -> b) -> b -> BodyV a -> b)
-> (forall a b. (a -> b -> b) -> b -> BodyV a -> b)
-> (forall b a. (b -> a -> b) -> b -> BodyV a -> b)
-> (forall b a. (b -> a -> b) -> b -> BodyV a -> b)
-> (forall a. (a -> a -> a) -> BodyV a -> a)
-> (forall a. (a -> a -> a) -> BodyV a -> a)
-> (forall a. BodyV a -> [a])
-> (forall a. BodyV a -> Bool)
-> (forall a. BodyV a -> Int)
-> (forall a. Eq a => a -> BodyV a -> Bool)
-> (forall a. Ord a => BodyV a -> a)
-> (forall a. Ord a => BodyV a -> a)
-> (forall a. Num a => BodyV a -> a)
-> (forall a. Num a => BodyV a -> a)
-> Foldable BodyV
forall a. Eq a => a -> BodyV a -> Bool
forall a. Num a => BodyV a -> a
forall a. Ord a => BodyV a -> a
forall m. Monoid m => BodyV m -> m
forall a. BodyV a -> Bool
forall a. BodyV a -> Int
forall a. BodyV a -> [a]
forall a. (a -> a -> a) -> BodyV a -> a
forall m a. Monoid m => (a -> m) -> BodyV a -> m
forall b a. (b -> a -> b) -> b -> BodyV a -> b
forall a b. (a -> b -> b) -> b -> BodyV 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
$cfold :: forall m. Monoid m => BodyV m -> m
fold :: forall m. Monoid m => BodyV m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> BodyV a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> BodyV a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> BodyV a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> BodyV a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> BodyV a -> b
foldr :: forall a b. (a -> b -> b) -> b -> BodyV a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> BodyV a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> BodyV a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> BodyV a -> b
foldl :: forall b a. (b -> a -> b) -> b -> BodyV a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> BodyV a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> BodyV a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> BodyV a -> a
foldr1 :: forall a. (a -> a -> a) -> BodyV a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> BodyV a -> a
foldl1 :: forall a. (a -> a -> a) -> BodyV a -> a
$ctoList :: forall a. BodyV a -> [a]
toList :: forall a. BodyV a -> [a]
$cnull :: forall a. BodyV a -> Bool
null :: forall a. BodyV a -> Bool
$clength :: forall a. BodyV a -> Int
length :: forall a. BodyV a -> Int
$celem :: forall a. Eq a => a -> BodyV a -> Bool
elem :: forall a. Eq a => a -> BodyV a -> Bool
$cmaximum :: forall a. Ord a => BodyV a -> a
maximum :: forall a. Ord a => BodyV a -> a
$cminimum :: forall a. Ord a => BodyV a -> a
minimum :: forall a. Ord a => BodyV a -> a
$csum :: forall a. Num a => BodyV a -> a
sum :: forall a. Num a => BodyV a -> a
$cproduct :: forall a. Num a => BodyV a -> a
product :: forall a. Num a => BodyV a -> a
Foldable, Functor BodyV
Foldable BodyV
(Functor BodyV, Foldable BodyV) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BodyV a -> f (BodyV b))
-> (forall (f :: * -> *) a.
Applicative f =>
BodyV (f a) -> f (BodyV a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BodyV a -> m (BodyV b))
-> (forall (m :: * -> *) a. Monad m => BodyV (m a) -> m (BodyV a))
-> Traversable BodyV
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 => BodyV (m a) -> m (BodyV a)
forall (f :: * -> *) a. Applicative f => BodyV (f a) -> f (BodyV a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BodyV a -> m (BodyV b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BodyV a -> f (BodyV b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BodyV a -> f (BodyV b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> BodyV a -> f (BodyV b)
$csequenceA :: forall (f :: * -> *) a. Applicative f => BodyV (f a) -> f (BodyV a)
sequenceA :: forall (f :: * -> *) a. Applicative f => BodyV (f a) -> f (BodyV a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BodyV a -> m (BodyV b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> BodyV a -> m (BodyV b)
$csequence :: forall (m :: * -> *) a. Monad m => BodyV (m a) -> m (BodyV a)
sequence :: forall (m :: * -> *) a. Monad m => BodyV (m a) -> m (BodyV a)
Traversable)
deriving Get (BodyV v)
[BodyV v] -> Put
BodyV v -> Put
(BodyV v -> Put)
-> Get (BodyV v) -> ([BodyV v] -> Put) -> Binary (BodyV v)
forall v. Binary v => Get (BodyV v)
forall v. Binary v => [BodyV v] -> Put
forall v. Binary v => BodyV v -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall v. Binary v => BodyV v -> Put
put :: BodyV v -> Put
$cget :: forall v. Binary v => Get (BodyV v)
get :: Get (BodyV v)
$cputList :: forall v. Binary v => [BodyV v] -> Put
putList :: [BodyV v] -> Put
B.Binary via Generically (BodyV v)
deriving Eq (BodyV v)
Eq (BodyV v) =>
(Int -> BodyV v -> Int) -> (BodyV v -> Int) -> Hashable (BodyV v)
Int -> BodyV v -> Int
BodyV v -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall v. Hashable v => Eq (BodyV v)
forall v. Hashable v => Int -> BodyV v -> Int
forall v. Hashable v => BodyV v -> Int
$chashWithSalt :: forall v. Hashable v => Int -> BodyV v -> Int
hashWithSalt :: Int -> BodyV v -> Int
$chash :: forall v. Hashable v => BodyV v -> Int
hash :: BodyV v -> Int
Hashable via Generically (BodyV v)
emapBody
:: Monad m
=> ([Symbol] -> v0 -> m v1)
-> BodyV v0
-> m (BodyV v1)
emapBody :: forall (m :: * -> *) v0 v1.
Monad m =>
([Symbol] -> v0 -> m v1) -> BodyV v0 -> m (BodyV v1)
emapBody [Symbol] -> v0 -> m v1
f BodyV v0
b = case BodyV v0
b of
E ExprV v0
e -> ExprV v1 -> BodyV v1
forall v. ExprV v -> BodyV v
E (ExprV v1 -> BodyV v1) -> m (ExprV v1) -> m (BodyV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM [Symbol] -> v0 -> m v1
f ExprV v0
e
P ExprV v0
e -> ExprV v1 -> BodyV v1
forall v. ExprV v -> BodyV v
P (ExprV v1 -> BodyV v1) -> m (ExprV v1) -> m (BodyV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM [Symbol] -> v0 -> m v1
f ExprV v0
e
R Symbol
s ExprV v0
e -> Symbol -> ExprV v1 -> BodyV v1
forall v. Symbol -> ExprV v -> BodyV v
R Symbol
s (ExprV v1 -> BodyV v1) -> m (ExprV v1) -> m (BodyV v1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Symbol] -> v0 -> m v1) -> ExprV v0 -> m (ExprV v1)
forall (m :: * -> *) v v'.
Monad m =>
([Symbol] -> v -> m v') -> ExprV v -> m (ExprV v')
emapExprVM ([Symbol] -> v0 -> m v1
f ([Symbol] -> v0 -> m v1)
-> ([Symbol] -> [Symbol]) -> [Symbol] -> v0 -> m v1
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Symbol
sSymbol -> [Symbol] -> [Symbol]
forall a. a -> [a] -> [a]
:)) ExprV v0
e
type Def ty ctor = DefV Symbol ty ctor
data DefV v ty ctor = Def
{ forall v ty ctor. DefV v ty ctor -> Located LHName
measure :: F.Located LHName
, forall v ty ctor. DefV v ty ctor -> ctor
ctor :: ctor
, forall v ty ctor. DefV v ty ctor -> Maybe ty
dsort :: Maybe ty
, forall v ty ctor. DefV v ty ctor -> [(Symbol, Maybe ty)]
binds :: [(Symbol, Maybe ty)]
, forall v ty ctor. DefV v ty ctor -> BodyV v
body :: BodyV v
} deriving (Int -> DefV v ty ctor -> ShowS
[DefV v ty ctor] -> ShowS
DefV v ty ctor -> String
(Int -> DefV v ty ctor -> ShowS)
-> (DefV v ty ctor -> String)
-> ([DefV v ty ctor] -> ShowS)
-> Show (DefV v ty ctor)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
Int -> DefV v ty ctor -> ShowS
forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
[DefV v ty ctor] -> ShowS
forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
DefV v ty ctor -> String
$cshowsPrec :: forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
Int -> DefV v ty ctor -> ShowS
showsPrec :: Int -> DefV v ty ctor -> ShowS
$cshow :: forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
DefV v ty ctor -> String
show :: DefV v ty ctor -> String
$cshowList :: forall v ty ctor.
(Show ctor, Show ty, Show v, Fixpoint v, Ord v) =>
[DefV v ty ctor] -> ShowS
showList :: [DefV v ty ctor] -> ShowS
Show, Typeable (DefV v ty ctor)
Typeable (DefV v ty ctor) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefV v ty ctor -> c (DefV v ty ctor))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefV v ty ctor))
-> (DefV v ty ctor -> Constr)
-> (DefV v ty ctor -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DefV v ty ctor)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefV v ty ctor)))
-> ((forall b. Data b => b -> b)
-> DefV v ty ctor -> DefV v ty ctor)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r)
-> (forall u.
(forall d. Data d => d -> u) -> DefV v ty ctor -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> DefV v ty ctor -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor))
-> Data (DefV v ty ctor)
DefV v ty ctor -> Constr
DefV v ty ctor -> DataType
(forall b. Data b => b -> b) -> DefV v ty ctor -> DefV v ty ctor
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) -> DefV v ty ctor -> u
forall u. (forall d. Data d => d -> u) -> DefV v ty ctor -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
forall v ty ctor.
(Data v, Data ty, Data ctor) =>
Typeable (DefV v ty ctor)
forall v ty ctor.
(Data v, Data ty, Data ctor) =>
DefV v ty ctor -> Constr
forall v ty ctor.
(Data v, Data ty, Data ctor) =>
DefV v ty ctor -> DataType
forall v ty ctor.
(Data v, Data ty, Data ctor) =>
(forall b. Data b => b -> b) -> DefV v ty ctor -> DefV v ty ctor
forall v ty ctor u.
(Data v, Data ty, Data ctor) =>
Int -> (forall d. Data d => d -> u) -> DefV v ty ctor -> u
forall v ty ctor u.
(Data v, Data ty, Data ctor) =>
(forall d. Data d => d -> u) -> DefV v ty ctor -> [u]
forall v ty ctor r r'.
(Data v, Data ty, Data ctor) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
forall v ty ctor r r'.
(Data v, Data ty, Data ctor) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
forall v ty ctor (m :: * -> *).
(Data v, Data ty, Data ctor, Monad m) =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
forall v ty ctor (m :: * -> *).
(Data v, Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
forall v ty ctor (c :: * -> *).
(Data v, Data ty, Data ctor) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefV v ty ctor)
forall v ty ctor (c :: * -> *).
(Data v, Data ty, Data ctor) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefV v ty ctor -> c (DefV v ty ctor)
forall v ty ctor (t :: * -> *) (c :: * -> *).
(Data v, Data ty, Data ctor, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DefV v ty ctor))
forall v ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data v, Data ty, Data ctor, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefV v ty ctor))
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefV v ty ctor)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefV v ty ctor -> c (DefV v ty ctor)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DefV v ty ctor))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefV v ty ctor))
$cgfoldl :: forall v ty ctor (c :: * -> *).
(Data v, Data ty, Data ctor) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefV v ty ctor -> c (DefV v ty ctor)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DefV v ty ctor -> c (DefV v ty ctor)
$cgunfold :: forall v ty ctor (c :: * -> *).
(Data v, Data ty, Data ctor) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefV v ty ctor)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DefV v ty ctor)
$ctoConstr :: forall v ty ctor.
(Data v, Data ty, Data ctor) =>
DefV v ty ctor -> Constr
toConstr :: DefV v ty ctor -> Constr
$cdataTypeOf :: forall v ty ctor.
(Data v, Data ty, Data ctor) =>
DefV v ty ctor -> DataType
dataTypeOf :: DefV v ty ctor -> DataType
$cdataCast1 :: forall v ty ctor (t :: * -> *) (c :: * -> *).
(Data v, Data ty, Data ctor, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DefV v ty ctor))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DefV v ty ctor))
$cdataCast2 :: forall v ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data v, Data ty, Data ctor, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefV v ty ctor))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DefV v ty ctor))
$cgmapT :: forall v ty ctor.
(Data v, Data ty, Data ctor) =>
(forall b. Data b => b -> b) -> DefV v ty ctor -> DefV v ty ctor
gmapT :: (forall b. Data b => b -> b) -> DefV v ty ctor -> DefV v ty ctor
$cgmapQl :: forall v ty ctor r r'.
(Data v, Data ty, Data ctor) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
$cgmapQr :: forall v ty ctor r r'.
(Data v, Data ty, Data ctor) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DefV v ty ctor -> r
$cgmapQ :: forall v ty ctor u.
(Data v, Data ty, Data ctor) =>
(forall d. Data d => d -> u) -> DefV v ty ctor -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DefV v ty ctor -> [u]
$cgmapQi :: forall v ty ctor u.
(Data v, Data ty, Data ctor) =>
Int -> (forall d. Data d => d -> u) -> DefV v ty ctor -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> DefV v ty ctor -> u
$cgmapM :: forall v ty ctor (m :: * -> *).
(Data v, Data ty, Data ctor, Monad m) =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
$cgmapMp :: forall v ty ctor (m :: * -> *).
(Data v, Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
$cgmapMo :: forall v ty ctor (m :: * -> *).
(Data v, Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DefV v ty ctor -> m (DefV v ty ctor)
Data, Typeable, (forall x. DefV v ty ctor -> Rep (DefV v ty ctor) x)
-> (forall x. Rep (DefV v ty ctor) x -> DefV v ty ctor)
-> Generic (DefV v ty ctor)
forall x. Rep (DefV v ty ctor) x -> DefV v ty ctor
forall x. DefV v ty ctor -> Rep (DefV v ty ctor) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v ty ctor x. Rep (DefV v ty ctor) x -> DefV v ty ctor
forall v ty ctor x. DefV v ty ctor -> Rep (DefV v ty ctor) x
$cfrom :: forall v ty ctor x. DefV v ty ctor -> Rep (DefV v ty ctor) x
from :: forall x. DefV v ty ctor -> Rep (DefV v ty ctor) x
$cto :: forall v ty ctor x. Rep (DefV v ty ctor) x -> DefV v ty ctor
to :: forall x. Rep (DefV v ty ctor) x -> DefV v ty ctor
Generic, DefV v ty ctor -> DefV v ty ctor -> Bool
(DefV v ty ctor -> DefV v ty ctor -> Bool)
-> (DefV v ty ctor -> DefV v ty ctor -> Bool)
-> Eq (DefV v ty ctor)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall v ty ctor.
(Eq ctor, Eq ty, Eq v) =>
DefV v ty ctor -> DefV v ty ctor -> Bool
$c== :: forall v ty ctor.
(Eq ctor, Eq ty, Eq v) =>
DefV v ty ctor -> DefV v ty ctor -> Bool
== :: DefV v ty ctor -> DefV v ty ctor -> Bool
$c/= :: forall v ty ctor.
(Eq ctor, Eq ty, Eq v) =>
DefV v ty ctor -> DefV v ty ctor -> Bool
/= :: DefV v ty ctor -> DefV v ty ctor -> Bool
Eq, (forall a b. (a -> b) -> DefV v ty a -> DefV v ty b)
-> (forall a b. a -> DefV v ty b -> DefV v ty a)
-> Functor (DefV v ty)
forall a b. a -> DefV v ty b -> DefV v ty a
forall a b. (a -> b) -> DefV v ty a -> DefV v ty b
forall v ty a b. a -> DefV v ty b -> DefV v ty a
forall v ty a b. (a -> b) -> DefV v ty a -> DefV v ty b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall v ty a b. (a -> b) -> DefV v ty a -> DefV v ty b
fmap :: forall a b. (a -> b) -> DefV v ty a -> DefV v ty b
$c<$ :: forall v ty a b. a -> DefV v ty b -> DefV v ty a
<$ :: forall a b. a -> DefV v ty b -> DefV v ty a
Functor)
deriving Get (DefV v ty ctor)
[DefV v ty ctor] -> Put
DefV v ty ctor -> Put
(DefV v ty ctor -> Put)
-> Get (DefV v ty ctor)
-> ([DefV v ty ctor] -> Put)
-> Binary (DefV v ty ctor)
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
Get (DefV v ty ctor)
forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
[DefV v ty ctor] -> Put
forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
DefV v ty ctor -> Put
$cput :: forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
DefV v ty ctor -> Put
put :: DefV v ty ctor -> Put
$cget :: forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
Get (DefV v ty ctor)
get :: Get (DefV v ty ctor)
$cputList :: forall v ty ctor.
(Binary ctor, Binary ty, Binary v) =>
[DefV v ty ctor] -> Put
putList :: [DefV v ty ctor] -> Put
B.Binary via Generically (DefV v ty ctor)
deriving Eq (DefV v ty ctor)
Eq (DefV v ty ctor) =>
(Int -> DefV v ty ctor -> Int)
-> (DefV v ty ctor -> Int) -> Hashable (DefV v ty ctor)
Int -> DefV v ty ctor -> Int
DefV v ty ctor -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall v ty ctor.
(Hashable ctor, Hashable ty, Hashable v) =>
Eq (DefV v ty ctor)
forall v ty ctor.
(Hashable ctor, Hashable ty, Hashable v) =>
Int -> DefV v ty ctor -> Int
forall v ty ctor.
(Hashable ctor, Hashable ty, Hashable v) =>
DefV v ty ctor -> Int
$chashWithSalt :: forall v ty ctor.
(Hashable ctor, Hashable ty, Hashable v) =>
Int -> DefV v ty ctor -> Int
hashWithSalt :: Int -> DefV v ty ctor -> Int
$chash :: forall v ty ctor.
(Hashable ctor, Hashable ty, Hashable v) =>
DefV v ty ctor -> Int
hash :: DefV v ty ctor -> Int
Hashable via Generically (DefV v ty ctor)
emapDefM
:: Monad m
=> ([Symbol] -> v0 -> m v1)
-> ([Symbol] -> ty0 -> m ty1)
-> DefV v0 ty0 ctor -> m (DefV v1 ty1 ctor)
emapDefM :: forall (m :: * -> *) v0 v1 ty0 ty1 ctor.
Monad m =>
([Symbol] -> v0 -> m v1)
-> ([Symbol] -> ty0 -> m ty1)
-> DefV v0 ty0 ctor
-> m (DefV v1 ty1 ctor)
emapDefM [Symbol] -> v0 -> m v1
vf [Symbol] -> ty0 -> m ty1
f DefV v0 ty0 ctor
d = do
dsort <- (ty0 -> m ty1) -> Maybe ty0 -> m (Maybe ty1)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
traverse ([Symbol] -> ty0 -> m ty1
f []) (DefV v0 ty0 ctor -> Maybe ty0
forall v ty ctor. DefV v ty ctor -> Maybe ty
dsort DefV v0 ty0 ctor
d)
binds <- snd <$> mapAccumM (\[Symbol]
e (Symbol
s, Maybe ty0
t) -> (Symbol
sSymbol -> [Symbol] -> [Symbol]
forall a. a -> [a] -> [a]
:[Symbol]
e,) ((Symbol, Maybe ty1) -> ([Symbol], (Symbol, Maybe ty1)))
-> (Maybe ty1 -> (Symbol, Maybe ty1))
-> Maybe ty1
-> ([Symbol], (Symbol, Maybe ty1))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Symbol
s,) (Maybe ty1 -> ([Symbol], (Symbol, Maybe ty1)))
-> m (Maybe ty1) -> m ([Symbol], (Symbol, Maybe ty1))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ty0 -> m ty1) -> Maybe ty0 -> m (Maybe ty1)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Maybe a -> f (Maybe b)
traverse ([Symbol] -> ty0 -> m ty1
f [Symbol]
e) Maybe ty0
t) [] (binds d)
body <- emapBody (vf . (++ map fst binds)) $ body d
return d {dsort, binds, body}
mapDefTy :: (ty0 -> ty1) -> DefV v ty0 ctor -> DefV v ty1 ctor
mapDefTy :: forall ty0 ty1 v ctor.
(ty0 -> ty1) -> DefV v ty0 ctor -> DefV v ty1 ctor
mapDefTy ty0 -> ty1
f Def{ctor
[(Symbol, Maybe ty0)]
Maybe ty0
Located LHName
BodyV v
measure :: forall v ty ctor. DefV v ty ctor -> Located LHName
ctor :: forall v ty ctor. DefV v ty ctor -> ctor
dsort :: forall v ty ctor. DefV v ty ctor -> Maybe ty
binds :: forall v ty ctor. DefV v ty ctor -> [(Symbol, Maybe ty)]
body :: forall v ty ctor. DefV v ty ctor -> BodyV v
measure :: Located LHName
ctor :: ctor
dsort :: Maybe ty0
binds :: [(Symbol, Maybe ty0)]
body :: BodyV v
..} =
Def
{ dsort :: Maybe ty1
dsort = (ty0 -> ty1) -> Maybe ty0 -> Maybe ty1
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ty0 -> ty1
f Maybe ty0
dsort
, binds :: [(Symbol, Maybe ty1)]
binds = ((Symbol, Maybe ty0) -> (Symbol, Maybe ty1))
-> [(Symbol, Maybe ty0)] -> [(Symbol, Maybe ty1)]
forall a b. (a -> b) -> [a] -> [b]
map ((Maybe ty0 -> Maybe ty1)
-> (Symbol, Maybe ty0) -> (Symbol, Maybe ty1)
forall a b. (a -> b) -> (Symbol, a) -> (Symbol, b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((ty0 -> ty1) -> Maybe ty0 -> Maybe ty1
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ty0 -> ty1
f)) [(Symbol, Maybe ty0)]
binds
, ctor
Located LHName
BodyV v
measure :: Located LHName
ctor :: ctor
body :: BodyV v
measure :: Located LHName
ctor :: ctor
body :: BodyV v
..
}
mapDefV :: (v -> v') -> DefV v ty ctor -> DefV v' ty ctor
mapDefV :: forall v v' ty ctor. (v -> v') -> DefV v ty ctor -> DefV v' ty ctor
mapDefV v -> v'
f Def{ctor
[(Symbol, Maybe ty)]
Maybe ty
Located LHName
BodyV v
measure :: forall v ty ctor. DefV v ty ctor -> Located LHName
ctor :: forall v ty ctor. DefV v ty ctor -> ctor
dsort :: forall v ty ctor. DefV v ty ctor -> Maybe ty
binds :: forall v ty ctor. DefV v ty ctor -> [(Symbol, Maybe ty)]
body :: forall v ty ctor. DefV v ty ctor -> BodyV v
measure :: Located LHName
ctor :: ctor
dsort :: Maybe ty
binds :: [(Symbol, Maybe ty)]
body :: BodyV v
..} =
Def
{ body :: BodyV v'
body = (v -> v') -> BodyV v -> BodyV v'
forall a b. (a -> b) -> BodyV a -> BodyV b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap v -> v'
f BodyV v
body
, ctor
[(Symbol, Maybe ty)]
Maybe ty
Located LHName
measure :: Located LHName
ctor :: ctor
dsort :: Maybe ty
binds :: [(Symbol, Maybe ty)]
measure :: Located LHName
ctor :: ctor
dsort :: Maybe ty
binds :: [(Symbol, Maybe ty)]
..
}
type Measure ty ctor = MeasureV Symbol ty ctor
data MeasureV v ty ctor = M
{ forall v ty ctor. MeasureV v ty ctor -> Located LHName
msName :: F.Located LHName
, forall v ty ctor. MeasureV v ty ctor -> ty
msSort :: ty
, forall v ty ctor. MeasureV v ty ctor -> [DefV v ty ctor]
msEqns :: [DefV v ty ctor]
, forall v ty ctor. MeasureV v ty ctor -> MeasureKind
msKind :: !MeasureKind
, forall v ty ctor. MeasureV v ty ctor -> UnSortedExprs
msUnSorted :: !UnSortedExprs
} deriving (MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
(MeasureV v ty ctor -> MeasureV v ty ctor -> Bool)
-> (MeasureV v ty ctor -> MeasureV v ty ctor -> Bool)
-> Eq (MeasureV v ty ctor)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall v ty ctor.
(Eq ty, Eq ctor, Eq v) =>
MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
$c== :: forall v ty ctor.
(Eq ty, Eq ctor, Eq v) =>
MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
== :: MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
$c/= :: forall v ty ctor.
(Eq ty, Eq ctor, Eq v) =>
MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
/= :: MeasureV v ty ctor -> MeasureV v ty ctor -> Bool
Eq, Typeable (MeasureV v ty ctor)
Typeable (MeasureV v ty ctor) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> MeasureV v ty ctor
-> c (MeasureV v ty ctor))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MeasureV v ty ctor))
-> (MeasureV v ty ctor -> Constr)
-> (MeasureV v ty ctor -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MeasureV v ty ctor)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MeasureV v ty ctor)))
-> ((forall b. Data b => b -> b)
-> MeasureV v ty ctor -> MeasureV v ty ctor)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r)
-> (forall u.
(forall d. Data d => d -> u) -> MeasureV v ty ctor -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> MeasureV v ty ctor -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor))
-> Data (MeasureV v ty ctor)
MeasureV v ty ctor -> Constr
MeasureV v ty ctor -> DataType
(forall b. Data b => b -> b)
-> MeasureV v ty ctor -> MeasureV v ty ctor
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) -> MeasureV v ty ctor -> u
forall u. (forall d. Data d => d -> u) -> MeasureV v ty ctor -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
forall v ty ctor.
(Data v, Data ctor, Data ty) =>
Typeable (MeasureV v ty ctor)
forall v ty ctor.
(Data v, Data ctor, Data ty) =>
MeasureV v ty ctor -> Constr
forall v ty ctor.
(Data v, Data ctor, Data ty) =>
MeasureV v ty ctor -> DataType
forall v ty ctor.
(Data v, Data ctor, Data ty) =>
(forall b. Data b => b -> b)
-> MeasureV v ty ctor -> MeasureV v ty ctor
forall v ty ctor u.
(Data v, Data ctor, Data ty) =>
Int -> (forall d. Data d => d -> u) -> MeasureV v ty ctor -> u
forall v ty ctor u.
(Data v, Data ctor, Data ty) =>
(forall d. Data d => d -> u) -> MeasureV v ty ctor -> [u]
forall v ty ctor r r'.
(Data v, Data ctor, Data ty) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
forall v ty ctor r r'.
(Data v, Data ctor, Data ty) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
forall v ty ctor (m :: * -> *).
(Data v, Data ctor, Data ty, Monad m) =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
forall v ty ctor (m :: * -> *).
(Data v, Data ctor, Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
forall v ty ctor (c :: * -> *).
(Data v, Data ctor, Data ty) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MeasureV v ty ctor)
forall v ty ctor (c :: * -> *).
(Data v, Data ctor, Data ty) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> MeasureV v ty ctor
-> c (MeasureV v ty ctor)
forall v ty ctor (t :: * -> *) (c :: * -> *).
(Data v, Data ctor, Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MeasureV v ty ctor))
forall v ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data v, Data ctor, Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MeasureV v ty ctor))
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MeasureV v ty ctor)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> MeasureV v ty ctor
-> c (MeasureV v ty ctor)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MeasureV v ty ctor))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MeasureV v ty ctor))
$cgfoldl :: forall v ty ctor (c :: * -> *).
(Data v, Data ctor, Data ty) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> MeasureV v ty ctor
-> c (MeasureV v ty ctor)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> MeasureV v ty ctor
-> c (MeasureV v ty ctor)
$cgunfold :: forall v ty ctor (c :: * -> *).
(Data v, Data ctor, Data ty) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MeasureV v ty ctor)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MeasureV v ty ctor)
$ctoConstr :: forall v ty ctor.
(Data v, Data ctor, Data ty) =>
MeasureV v ty ctor -> Constr
toConstr :: MeasureV v ty ctor -> Constr
$cdataTypeOf :: forall v ty ctor.
(Data v, Data ctor, Data ty) =>
MeasureV v ty ctor -> DataType
dataTypeOf :: MeasureV v ty ctor -> DataType
$cdataCast1 :: forall v ty ctor (t :: * -> *) (c :: * -> *).
(Data v, Data ctor, Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MeasureV v ty ctor))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MeasureV v ty ctor))
$cdataCast2 :: forall v ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data v, Data ctor, Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MeasureV v ty ctor))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MeasureV v ty ctor))
$cgmapT :: forall v ty ctor.
(Data v, Data ctor, Data ty) =>
(forall b. Data b => b -> b)
-> MeasureV v ty ctor -> MeasureV v ty ctor
gmapT :: (forall b. Data b => b -> b)
-> MeasureV v ty ctor -> MeasureV v ty ctor
$cgmapQl :: forall v ty ctor r r'.
(Data v, Data ctor, Data ty) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
$cgmapQr :: forall v ty ctor r r'.
(Data v, Data ctor, Data ty) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureV v ty ctor -> r
$cgmapQ :: forall v ty ctor u.
(Data v, Data ctor, Data ty) =>
(forall d. Data d => d -> u) -> MeasureV v ty ctor -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> MeasureV v ty ctor -> [u]
$cgmapQi :: forall v ty ctor u.
(Data v, Data ctor, Data ty) =>
Int -> (forall d. Data d => d -> u) -> MeasureV v ty ctor -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> MeasureV v ty ctor -> u
$cgmapM :: forall v ty ctor (m :: * -> *).
(Data v, Data ctor, Data ty, Monad m) =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
$cgmapMp :: forall v ty ctor (m :: * -> *).
(Data v, Data ctor, Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
$cgmapMo :: forall v ty ctor (m :: * -> *).
(Data v, Data ctor, Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MeasureV v ty ctor -> m (MeasureV v ty ctor)
Data, Typeable, (forall x. MeasureV v ty ctor -> Rep (MeasureV v ty ctor) x)
-> (forall x. Rep (MeasureV v ty ctor) x -> MeasureV v ty ctor)
-> Generic (MeasureV v ty ctor)
forall x. Rep (MeasureV v ty ctor) x -> MeasureV v ty ctor
forall x. MeasureV v ty ctor -> Rep (MeasureV v ty ctor) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v ty ctor x.
Rep (MeasureV v ty ctor) x -> MeasureV v ty ctor
forall v ty ctor x.
MeasureV v ty ctor -> Rep (MeasureV v ty ctor) x
$cfrom :: forall v ty ctor x.
MeasureV v ty ctor -> Rep (MeasureV v ty ctor) x
from :: forall x. MeasureV v ty ctor -> Rep (MeasureV v ty ctor) x
$cto :: forall v ty ctor x.
Rep (MeasureV v ty ctor) x -> MeasureV v ty ctor
to :: forall x. Rep (MeasureV v ty ctor) x -> MeasureV v ty ctor
Generic, (forall a b. (a -> b) -> MeasureV v ty a -> MeasureV v ty b)
-> (forall a b. a -> MeasureV v ty b -> MeasureV v ty a)
-> Functor (MeasureV v ty)
forall a b. a -> MeasureV v ty b -> MeasureV v ty a
forall a b. (a -> b) -> MeasureV v ty a -> MeasureV v ty b
forall v ty a b. a -> MeasureV v ty b -> MeasureV v ty a
forall v ty a b. (a -> b) -> MeasureV v ty a -> MeasureV v ty b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall v ty a b. (a -> b) -> MeasureV v ty a -> MeasureV v ty b
fmap :: forall a b. (a -> b) -> MeasureV v ty a -> MeasureV v ty b
$c<$ :: forall v ty a b. a -> MeasureV v ty b -> MeasureV v ty a
<$ :: forall a b. a -> MeasureV v ty b -> MeasureV v ty a
Functor)
deriving Get (MeasureV v ty ctor)
[MeasureV v ty ctor] -> Put
MeasureV v ty ctor -> Put
(MeasureV v ty ctor -> Put)
-> Get (MeasureV v ty ctor)
-> ([MeasureV v ty ctor] -> Put)
-> Binary (MeasureV v ty ctor)
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
Get (MeasureV v ty ctor)
forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
[MeasureV v ty ctor] -> Put
forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
MeasureV v ty ctor -> Put
$cput :: forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
MeasureV v ty ctor -> Put
put :: MeasureV v ty ctor -> Put
$cget :: forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
Get (MeasureV v ty ctor)
get :: Get (MeasureV v ty ctor)
$cputList :: forall v ty ctor.
(Binary ty, Binary ctor, Binary v) =>
[MeasureV v ty ctor] -> Put
putList :: [MeasureV v ty ctor] -> Put
B.Binary via Generically (MeasureV v ty ctor)
deriving Eq (MeasureV v ty ctor)
Eq (MeasureV v ty ctor) =>
(Int -> MeasureV v ty ctor -> Int)
-> (MeasureV v ty ctor -> Int) -> Hashable (MeasureV v ty ctor)
Int -> MeasureV v ty ctor -> Int
MeasureV v ty ctor -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall v ty ctor.
(Hashable ty, Hashable ctor, Hashable v) =>
Eq (MeasureV v ty ctor)
forall v ty ctor.
(Hashable ty, Hashable ctor, Hashable v) =>
Int -> MeasureV v ty ctor -> Int
forall v ty ctor.
(Hashable ty, Hashable ctor, Hashable v) =>
MeasureV v ty ctor -> Int
$chashWithSalt :: forall v ty ctor.
(Hashable ty, Hashable ctor, Hashable v) =>
Int -> MeasureV v ty ctor -> Int
hashWithSalt :: Int -> MeasureV v ty ctor -> Int
$chash :: forall v ty ctor.
(Hashable ty, Hashable ctor, Hashable v) =>
MeasureV v ty ctor -> Int
hash :: MeasureV v ty ctor -> Int
Hashable via Generically (MeasureV v ty ctor)
emapMeasureM
:: Monad m
=> ([Symbol] -> v0 -> m v1)
-> ([Symbol] -> ty0 -> m ty1)
-> MeasureV v0 ty0 ctor
-> m (MeasureV v1 ty1 ctor)
emapMeasureM :: forall (m :: * -> *) v0 v1 ty0 ty1 ctor.
Monad m =>
([Symbol] -> v0 -> m v1)
-> ([Symbol] -> ty0 -> m ty1)
-> MeasureV v0 ty0 ctor
-> m (MeasureV v1 ty1 ctor)
emapMeasureM [Symbol] -> v0 -> m v1
vf [Symbol] -> ty0 -> m ty1
f MeasureV v0 ty0 ctor
m = do
msSort <- [Symbol] -> ty0 -> m ty1
f [] (MeasureV v0 ty0 ctor -> ty0
forall v ty ctor. MeasureV v ty ctor -> ty
msSort MeasureV v0 ty0 ctor
m)
msEqns <- mapM (emapDefM vf f) (msEqns m)
return m{msSort, msEqns}
mapMeasureTy :: (ty0 -> ty1) -> MeasureV v ty0 ctor -> MeasureV v ty1 ctor
mapMeasureTy :: forall ty0 ty1 v ctor.
(ty0 -> ty1) -> MeasureV v ty0 ctor -> MeasureV v ty1 ctor
mapMeasureTy ty0 -> ty1
f M{ty0
UnSortedExprs
[DefV v ty0 ctor]
Located LHName
MeasureKind
msName :: forall v ty ctor. MeasureV v ty ctor -> Located LHName
msSort :: forall v ty ctor. MeasureV v ty ctor -> ty
msEqns :: forall v ty ctor. MeasureV v ty ctor -> [DefV v ty ctor]
msKind :: forall v ty ctor. MeasureV v ty ctor -> MeasureKind
msUnSorted :: forall v ty ctor. MeasureV v ty ctor -> UnSortedExprs
msName :: Located LHName
msSort :: ty0
msEqns :: [DefV v ty0 ctor]
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
..} =
M
{ msSort :: ty1
msSort = ty0 -> ty1
f ty0
msSort
, msEqns :: [DefV v ty1 ctor]
msEqns = (DefV v ty0 ctor -> DefV v ty1 ctor)
-> [DefV v ty0 ctor] -> [DefV v ty1 ctor]
forall a b. (a -> b) -> [a] -> [b]
map ((ty0 -> ty1) -> DefV v ty0 ctor -> DefV v ty1 ctor
forall ty0 ty1 v ctor.
(ty0 -> ty1) -> DefV v ty0 ctor -> DefV v ty1 ctor
mapDefTy ty0 -> ty1
f) [DefV v ty0 ctor]
msEqns
, UnSortedExprs
Located LHName
MeasureKind
msName :: Located LHName
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
msName :: Located LHName
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
..
}
mapMeasureV :: (v -> v') -> MeasureV v ty ctor -> MeasureV v' ty ctor
mapMeasureV :: forall v v' ty ctor.
(v -> v') -> MeasureV v ty ctor -> MeasureV v' ty ctor
mapMeasureV v -> v'
f M{ty
UnSortedExprs
[DefV v ty ctor]
Located LHName
MeasureKind
msName :: forall v ty ctor. MeasureV v ty ctor -> Located LHName
msSort :: forall v ty ctor. MeasureV v ty ctor -> ty
msEqns :: forall v ty ctor. MeasureV v ty ctor -> [DefV v ty ctor]
msKind :: forall v ty ctor. MeasureV v ty ctor -> MeasureKind
msUnSorted :: forall v ty ctor. MeasureV v ty ctor -> UnSortedExprs
msName :: Located LHName
msSort :: ty
msEqns :: [DefV v ty ctor]
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
..} =
M
{ msEqns :: [DefV v' ty ctor]
msEqns = (DefV v ty ctor -> DefV v' ty ctor)
-> [DefV v ty ctor] -> [DefV v' ty ctor]
forall a b. (a -> b) -> [a] -> [b]
map ((v -> v') -> DefV v ty ctor -> DefV v' ty ctor
forall v v' ty ctor. (v -> v') -> DefV v ty ctor -> DefV v' ty ctor
mapDefV v -> v'
f) [DefV v ty ctor]
msEqns
, ty
UnSortedExprs
Located LHName
MeasureKind
msName :: Located LHName
msSort :: ty
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
msName :: Located LHName
msSort :: ty
msKind :: MeasureKind
msUnSorted :: UnSortedExprs
..
}
type UnSortedExprs = [UnSortedExpr]
type UnSortedExpr = ([F.Symbol], F.Expr)
data MeasureKind
= MsReflect
| MsMeasure
| MsLifted
| MsClass
| MsAbsMeasure
| MsSelector
| MsChecker
deriving (MeasureKind -> MeasureKind -> Bool
(MeasureKind -> MeasureKind -> Bool)
-> (MeasureKind -> MeasureKind -> Bool) -> Eq MeasureKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MeasureKind -> MeasureKind -> Bool
== :: MeasureKind -> MeasureKind -> Bool
$c/= :: MeasureKind -> MeasureKind -> Bool
/= :: MeasureKind -> MeasureKind -> Bool
Eq, Eq MeasureKind
Eq MeasureKind =>
(MeasureKind -> MeasureKind -> Ordering)
-> (MeasureKind -> MeasureKind -> Bool)
-> (MeasureKind -> MeasureKind -> Bool)
-> (MeasureKind -> MeasureKind -> Bool)
-> (MeasureKind -> MeasureKind -> Bool)
-> (MeasureKind -> MeasureKind -> MeasureKind)
-> (MeasureKind -> MeasureKind -> MeasureKind)
-> Ord MeasureKind
MeasureKind -> MeasureKind -> Bool
MeasureKind -> MeasureKind -> Ordering
MeasureKind -> MeasureKind -> MeasureKind
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
$ccompare :: MeasureKind -> MeasureKind -> Ordering
compare :: MeasureKind -> MeasureKind -> Ordering
$c< :: MeasureKind -> MeasureKind -> Bool
< :: MeasureKind -> MeasureKind -> Bool
$c<= :: MeasureKind -> MeasureKind -> Bool
<= :: MeasureKind -> MeasureKind -> Bool
$c> :: MeasureKind -> MeasureKind -> Bool
> :: MeasureKind -> MeasureKind -> Bool
$c>= :: MeasureKind -> MeasureKind -> Bool
>= :: MeasureKind -> MeasureKind -> Bool
$cmax :: MeasureKind -> MeasureKind -> MeasureKind
max :: MeasureKind -> MeasureKind -> MeasureKind
$cmin :: MeasureKind -> MeasureKind -> MeasureKind
min :: MeasureKind -> MeasureKind -> MeasureKind
Ord, Int -> MeasureKind -> ShowS
[MeasureKind] -> ShowS
MeasureKind -> String
(Int -> MeasureKind -> ShowS)
-> (MeasureKind -> String)
-> ([MeasureKind] -> ShowS)
-> Show MeasureKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MeasureKind -> ShowS
showsPrec :: Int -> MeasureKind -> ShowS
$cshow :: MeasureKind -> String
show :: MeasureKind -> String
$cshowList :: [MeasureKind] -> ShowS
showList :: [MeasureKind] -> ShowS
Show, Typeable MeasureKind
Typeable MeasureKind =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MeasureKind -> c MeasureKind)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MeasureKind)
-> (MeasureKind -> Constr)
-> (MeasureKind -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MeasureKind))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MeasureKind))
-> ((forall b. Data b => b -> b) -> MeasureKind -> MeasureKind)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r)
-> (forall u. (forall d. Data d => d -> u) -> MeasureKind -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> MeasureKind -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind)
-> Data MeasureKind
MeasureKind -> Constr
MeasureKind -> DataType
(forall b. Data b => b -> b) -> MeasureKind -> MeasureKind
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) -> MeasureKind -> u
forall u. (forall d. Data d => d -> u) -> MeasureKind -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MeasureKind
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MeasureKind -> c MeasureKind
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MeasureKind)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MeasureKind)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MeasureKind -> c MeasureKind
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MeasureKind -> c MeasureKind
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MeasureKind
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MeasureKind
$ctoConstr :: MeasureKind -> Constr
toConstr :: MeasureKind -> Constr
$cdataTypeOf :: MeasureKind -> DataType
dataTypeOf :: MeasureKind -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MeasureKind)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MeasureKind)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MeasureKind)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c MeasureKind)
$cgmapT :: (forall b. Data b => b -> b) -> MeasureKind -> MeasureKind
gmapT :: (forall b. Data b => b -> b) -> MeasureKind -> MeasureKind
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MeasureKind -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MeasureKind -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> MeasureKind -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MeasureKind -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MeasureKind -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MeasureKind -> m MeasureKind
Data, Typeable, (forall x. MeasureKind -> Rep MeasureKind x)
-> (forall x. Rep MeasureKind x -> MeasureKind)
-> Generic MeasureKind
forall x. Rep MeasureKind x -> MeasureKind
forall x. MeasureKind -> Rep MeasureKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MeasureKind -> Rep MeasureKind x
from :: forall x. MeasureKind -> Rep MeasureKind x
$cto :: forall x. Rep MeasureKind x -> MeasureKind
to :: forall x. Rep MeasureKind x -> MeasureKind
Generic)
deriving Get MeasureKind
[MeasureKind] -> Put
MeasureKind -> Put
(MeasureKind -> Put)
-> Get MeasureKind -> ([MeasureKind] -> Put) -> Binary MeasureKind
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: MeasureKind -> Put
put :: MeasureKind -> Put
$cget :: Get MeasureKind
get :: Get MeasureKind
$cputList :: [MeasureKind] -> Put
putList :: [MeasureKind] -> Put
B.Binary via Generically MeasureKind
deriving Eq MeasureKind
Eq MeasureKind =>
(Int -> MeasureKind -> Int)
-> (MeasureKind -> Int) -> Hashable MeasureKind
Int -> MeasureKind -> Int
MeasureKind -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> MeasureKind -> Int
hashWithSalt :: Int -> MeasureKind -> Int
$chash :: MeasureKind -> Int
hash :: MeasureKind -> Int
Hashable via Generically MeasureKind
instance F.Loc (Measure a b) where
srcSpan :: Measure a b -> SrcSpan
srcSpan = Located LHName -> SrcSpan
forall a. Loc a => a -> SrcSpan
F.srcSpan (Located LHName -> SrcSpan)
-> (Measure a b -> Located LHName) -> Measure a b -> SrcSpan
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Measure a b -> Located LHName
forall v ty ctor. MeasureV v ty ctor -> Located LHName
msName
instance Bifunctor (DefV v) where
first :: forall a b c. (a -> b) -> DefV v a c -> DefV v b c
first a -> b
f (Def Located LHName
m c
c Maybe a
s [(Symbol, Maybe a)]
bs BodyV v
b) = Located LHName
-> c -> Maybe b -> [(Symbol, Maybe b)] -> BodyV v -> DefV v b c
forall v ty ctor.
Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV v
-> DefV v ty ctor
Def Located LHName
m c
c (a -> b
f (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe a
s) ((Maybe a -> Maybe b) -> (Symbol, Maybe a) -> (Symbol, Maybe b)
forall b c a. (b -> c) -> (a, b) -> (a, c)
forall (p :: * -> * -> *) b c a.
Bifunctor p =>
(b -> c) -> p a b -> p a c
second ((a -> b) -> Maybe a -> Maybe b
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) ((Symbol, Maybe a) -> (Symbol, Maybe b))
-> [(Symbol, Maybe a)] -> [(Symbol, Maybe b)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Symbol, Maybe a)]
bs) BodyV v
b
second :: forall b c a. (b -> c) -> DefV v a b -> DefV v a c
second b -> c
f (Def Located LHName
m b
c Maybe a
s [(Symbol, Maybe a)]
bs BodyV v
b) = Located LHName
-> c -> Maybe a -> [(Symbol, Maybe a)] -> BodyV v -> DefV v a c
forall v ty ctor.
Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV v
-> DefV v ty ctor
Def Located LHName
m (b -> c
f b
c) Maybe a
s [(Symbol, Maybe a)]
bs BodyV v
b
instance Bifunctor (MeasureV v) where
first :: forall a b c. (a -> b) -> MeasureV v a c -> MeasureV v b c
first a -> b
f (M Located LHName
n a
s [DefV v a c]
es MeasureKind
k UnSortedExprs
u) = Located LHName
-> b
-> [DefV v b c]
-> MeasureKind
-> UnSortedExprs
-> MeasureV v b c
forall v ty ctor.
Located LHName
-> ty
-> [DefV v ty ctor]
-> MeasureKind
-> UnSortedExprs
-> MeasureV v ty ctor
M Located LHName
n (a -> b
f a
s) ((a -> b) -> DefV v a c -> DefV v b c
forall a b c. (a -> b) -> DefV v a c -> DefV v b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first a -> b
f (DefV v a c -> DefV v b c) -> [DefV v a c] -> [DefV v b c]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [DefV v a c]
es) MeasureKind
k UnSortedExprs
u
second :: forall b c a. (b -> c) -> MeasureV v a b -> MeasureV v a c
second b -> c
f (M Located LHName
n a
s [DefV v a b]
es MeasureKind
k UnSortedExprs
u) = Located LHName
-> a
-> [DefV v a c]
-> MeasureKind
-> UnSortedExprs
-> MeasureV v a c
forall v ty ctor.
Located LHName
-> ty
-> [DefV v ty ctor]
-> MeasureKind
-> UnSortedExprs
-> MeasureV v ty ctor
M Located LHName
n a
s ((b -> c) -> DefV v a b -> DefV v a c
forall b c a. (b -> c) -> DefV v a b -> DefV v a c
forall (p :: * -> * -> *) b c a.
Bifunctor p =>
(b -> c) -> p a b -> p a c
second b -> c
f (DefV v a b -> DefV v a c) -> [DefV v a b] -> [DefV v a c]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [DefV v a b]
es) MeasureKind
k UnSortedExprs
u
data CMeasure ty = CM
{ forall ty. CMeasure ty -> Located LHName
cName :: F.Located LHName
, forall ty. CMeasure ty -> ty
cSort :: ty
} deriving (Typeable (CMeasure ty)
Typeable (CMeasure ty) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CMeasure ty -> c (CMeasure ty))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CMeasure ty))
-> (CMeasure ty -> Constr)
-> (CMeasure ty -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CMeasure ty)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CMeasure ty)))
-> ((forall b. Data b => b -> b) -> CMeasure ty -> CMeasure ty)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r)
-> (forall u. (forall d. Data d => d -> u) -> CMeasure ty -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> CMeasure ty -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty))
-> Data (CMeasure ty)
CMeasure ty -> Constr
CMeasure ty -> DataType
(forall b. Data b => b -> b) -> CMeasure ty -> CMeasure ty
forall ty. Data ty => Typeable (CMeasure ty)
forall ty. Data ty => CMeasure ty -> Constr
forall ty. Data ty => CMeasure ty -> DataType
forall ty.
Data ty =>
(forall b. Data b => b -> b) -> CMeasure ty -> CMeasure ty
forall ty u.
Data ty =>
Int -> (forall d. Data d => d -> u) -> CMeasure ty -> u
forall ty u.
Data ty =>
(forall d. Data d => d -> u) -> CMeasure ty -> [u]
forall ty r r'.
Data ty =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
forall ty r r'.
Data ty =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
forall ty (m :: * -> *).
(Data ty, Monad m) =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
forall ty (c :: * -> *).
Data ty =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CMeasure ty)
forall ty (c :: * -> *).
Data ty =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CMeasure ty -> c (CMeasure ty)
forall ty (t :: * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CMeasure ty))
forall ty (t :: * -> * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CMeasure ty))
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) -> CMeasure ty -> u
forall u. (forall d. Data d => d -> u) -> CMeasure ty -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CMeasure ty)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CMeasure ty -> c (CMeasure ty)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CMeasure ty))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CMeasure ty))
$cgfoldl :: forall ty (c :: * -> *).
Data ty =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CMeasure ty -> c (CMeasure ty)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CMeasure ty -> c (CMeasure ty)
$cgunfold :: forall ty (c :: * -> *).
Data ty =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CMeasure ty)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (CMeasure ty)
$ctoConstr :: forall ty. Data ty => CMeasure ty -> Constr
toConstr :: CMeasure ty -> Constr
$cdataTypeOf :: forall ty. Data ty => CMeasure ty -> DataType
dataTypeOf :: CMeasure ty -> DataType
$cdataCast1 :: forall ty (t :: * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (CMeasure ty))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (CMeasure ty))
$cdataCast2 :: forall ty (t :: * -> * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CMeasure ty))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (CMeasure ty))
$cgmapT :: forall ty.
Data ty =>
(forall b. Data b => b -> b) -> CMeasure ty -> CMeasure ty
gmapT :: (forall b. Data b => b -> b) -> CMeasure ty -> CMeasure ty
$cgmapQl :: forall ty r r'.
Data ty =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
$cgmapQr :: forall ty r r'.
Data ty =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CMeasure ty -> r
$cgmapQ :: forall ty u.
Data ty =>
(forall d. Data d => d -> u) -> CMeasure ty -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> CMeasure ty -> [u]
$cgmapQi :: forall ty u.
Data ty =>
Int -> (forall d. Data d => d -> u) -> CMeasure ty -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> CMeasure ty -> u
$cgmapM :: forall ty (m :: * -> *).
(Data ty, Monad m) =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
$cgmapMp :: forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
$cgmapMo :: forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> CMeasure ty -> m (CMeasure ty)
Data, Typeable, (forall x. CMeasure ty -> Rep (CMeasure ty) x)
-> (forall x. Rep (CMeasure ty) x -> CMeasure ty)
-> Generic (CMeasure ty)
forall x. Rep (CMeasure ty) x -> CMeasure ty
forall x. CMeasure ty -> Rep (CMeasure ty) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall ty x. Rep (CMeasure ty) x -> CMeasure ty
forall ty x. CMeasure ty -> Rep (CMeasure ty) x
$cfrom :: forall ty x. CMeasure ty -> Rep (CMeasure ty) x
from :: forall x. CMeasure ty -> Rep (CMeasure ty) x
$cto :: forall ty x. Rep (CMeasure ty) x -> CMeasure ty
to :: forall x. Rep (CMeasure ty) x -> CMeasure ty
Generic, (forall a b. (a -> b) -> CMeasure a -> CMeasure b)
-> (forall a b. a -> CMeasure b -> CMeasure a) -> Functor CMeasure
forall a b. a -> CMeasure b -> CMeasure a
forall a b. (a -> b) -> CMeasure a -> CMeasure b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> CMeasure a -> CMeasure b
fmap :: forall a b. (a -> b) -> CMeasure a -> CMeasure b
$c<$ :: forall a b. a -> CMeasure b -> CMeasure a
<$ :: forall a b. a -> CMeasure b -> CMeasure a
Functor)
instance (F.PPrint v, Ord v, F.Fixpoint v) => F.PPrint (BodyV v) where
pprintTidy :: Tidy -> BodyV v -> Doc
pprintTidy Tidy
k (E ExprV v
e) = Tidy -> ExprV v -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k ExprV v
e
pprintTidy Tidy
k (P ExprV v
p) = Tidy -> ExprV v -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k ExprV v
p
pprintTidy Tidy
k (R Symbol
v ExprV v
p) = Doc -> Doc
braces (Tidy -> Symbol -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Symbol
v Doc -> Doc -> Doc
<+> Doc
"|" Doc -> Doc -> Doc
<+> Tidy -> ExprV v -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k ExprV v
p)
instance (F.PPrint a, F.PPrint v, Ord v, F.Fixpoint v) => F.PPrint (DefV v t a) where
pprintTidy :: Tidy -> DefV v t a -> Doc
pprintTidy Tidy
k (Def Located LHName
m a
c Maybe t
_ [(Symbol, Maybe t)]
bs BodyV v
body)
= Tidy -> Located LHName -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Located LHName
m Doc -> Doc -> Doc
<+> Doc
cbsd Doc -> Doc -> Doc
<+> Doc
"=" Doc -> Doc -> Doc
<+> Tidy -> BodyV v -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k BodyV v
body
where
cbsd :: Doc
cbsd = Doc -> Doc
parens (Tidy -> a -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k a
c Doc -> Doc -> Doc
<-> [Doc] -> Doc
hsep (Tidy -> Symbol -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (Symbol -> Doc) -> [Symbol] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ((Symbol, Maybe t) -> Symbol
forall a b. (a, b) -> a
fst ((Symbol, Maybe t) -> Symbol) -> [(Symbol, Maybe t)] -> [Symbol]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Symbol, Maybe t)]
bs)))
instance (F.PPrint v, Ord v, F.Fixpoint v, F.PPrint t, F.PPrint a) => F.PPrint (MeasureV v t a) where
pprintTidy :: Tidy -> MeasureV v t a -> Doc
pprintTidy Tidy
k (M Located LHName
n t
s [DefV v t a]
eqs MeasureKind
_ UnSortedExprs
_) = Tidy -> Located LHName -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Located LHName
n Doc -> Doc -> Doc
<+> Doc
"::" Doc -> Doc -> Doc
<+> Tidy -> t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k t
s
Doc -> Doc -> Doc
$$ [Doc] -> Doc
vcat (Tidy -> DefV v t a -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (DefV v t a -> Doc) -> [DefV v t a] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` [DefV v t a]
eqs)
instance F.PPrint (MeasureV v t a) => Show (MeasureV v t a) where
show :: MeasureV v t a -> String
show = MeasureV v t a -> String
forall a. PPrint a => a -> String
F.showpp
instance F.PPrint t => F.PPrint (CMeasure t) where
pprintTidy :: Tidy -> CMeasure t -> Doc
pprintTidy Tidy
k (CM Located LHName
n t
s) = Tidy -> Located LHName -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k Located LHName
n Doc -> Doc -> Doc
<+> Doc
"::" Doc -> Doc -> Doc
<+> Tidy -> t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k t
s
instance F.PPrint (CMeasure t) => Show (CMeasure t) where
show :: CMeasure t -> String
show = CMeasure t -> String
forall a. PPrint a => a -> String
F.showpp
instance F.Subable (Measure ty ctor) where
syms :: Measure ty ctor -> [Symbol]
syms Measure ty ctor
m = (DefV Symbol ty ctor -> [Symbol])
-> [DefV Symbol ty ctor] -> [Symbol]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap DefV Symbol ty ctor -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms (Measure ty ctor -> [DefV Symbol ty ctor]
forall v ty ctor. MeasureV v ty ctor -> [DefV v ty ctor]
msEqns Measure ty ctor
m)
substa :: (Symbol -> Symbol) -> Measure ty ctor -> Measure ty ctor
substa Symbol -> Symbol
f Measure ty ctor
m = Measure ty ctor
m { msEqns = F.substa f <$> msEqns m }
substf :: (Symbol -> Expr) -> Measure ty ctor -> Measure ty ctor
substf Symbol -> Expr
f Measure ty ctor
m = Measure ty ctor
m { msEqns = F.substf f <$> msEqns m }
subst :: Subst -> Measure ty ctor -> Measure ty ctor
subst Subst
su Measure ty ctor
m = Measure ty ctor
m { msEqns = F.subst su <$> msEqns m }
instance F.Subable (Def ty ctor) where
syms :: Def ty ctor -> [Symbol]
syms (Def Located LHName
_ ctor
_ Maybe ty
_ [(Symbol, Maybe ty)]
sb BodyV Symbol
bd) = ((Symbol, Maybe ty) -> Symbol
forall a b. (a, b) -> a
fst ((Symbol, Maybe ty) -> Symbol) -> [(Symbol, Maybe ty)] -> [Symbol]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Symbol, Maybe ty)]
sb) [Symbol] -> [Symbol] -> [Symbol]
forall a. [a] -> [a] -> [a]
++ BodyV Symbol -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms BodyV Symbol
bd
substa :: (Symbol -> Symbol) -> Def ty ctor -> Def ty ctor
substa Symbol -> Symbol
f (Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b BodyV Symbol
bd) = Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV Symbol
-> Def ty ctor
forall v ty ctor.
Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV v
-> DefV v ty ctor
Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b (BodyV Symbol -> Def ty ctor) -> BodyV Symbol -> Def ty ctor
forall a b. (a -> b) -> a -> b
$ (Symbol -> Symbol) -> BodyV Symbol -> BodyV Symbol
forall a. Subable a => (Symbol -> Symbol) -> a -> a
F.substa Symbol -> Symbol
f BodyV Symbol
bd
substf :: (Symbol -> Expr) -> Def ty ctor -> Def ty ctor
substf Symbol -> Expr
f (Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b BodyV Symbol
bd) = Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV Symbol
-> Def ty ctor
forall v ty ctor.
Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV v
-> DefV v ty ctor
Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b (BodyV Symbol -> Def ty ctor) -> BodyV Symbol -> Def ty ctor
forall a b. (a -> b) -> a -> b
$ (Symbol -> Expr) -> BodyV Symbol -> BodyV Symbol
forall a. Subable a => (Symbol -> Expr) -> a -> a
F.substf Symbol -> Expr
f BodyV Symbol
bd
subst :: Subst -> Def ty ctor -> Def ty ctor
subst Subst
su (Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b BodyV Symbol
bd) = Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV Symbol
-> Def ty ctor
forall v ty ctor.
Located LHName
-> ctor
-> Maybe ty
-> [(Symbol, Maybe ty)]
-> BodyV v
-> DefV v ty ctor
Def Located LHName
m ctor
c Maybe ty
t [(Symbol, Maybe ty)]
b (BodyV Symbol -> Def ty ctor) -> BodyV Symbol -> Def ty ctor
forall a b. (a -> b) -> a -> b
$ Subst -> BodyV Symbol -> BodyV Symbol
forall a. Subable a => Subst -> a -> a
F.subst Subst
su BodyV Symbol
bd
instance F.Subable Body where
syms :: BodyV Symbol -> [Symbol]
syms (E Expr
e) = Expr -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms Expr
e
syms (P Expr
e) = Expr -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms Expr
e
syms (R Symbol
s Expr
e) = Symbol
s Symbol -> [Symbol] -> [Symbol]
forall a. a -> [a] -> [a]
: Expr -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms Expr
e
substa :: (Symbol -> Symbol) -> BodyV Symbol -> BodyV Symbol
substa Symbol -> Symbol
f (E Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
E ((Symbol -> Symbol) -> Expr -> Expr
forall a. Subable a => (Symbol -> Symbol) -> a -> a
F.substa Symbol -> Symbol
f Expr
e)
substa Symbol -> Symbol
f (P Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
P ((Symbol -> Symbol) -> Expr -> Expr
forall a. Subable a => (Symbol -> Symbol) -> a -> a
F.substa Symbol -> Symbol
f Expr
e)
substa Symbol -> Symbol
f (R Symbol
s Expr
e) = Symbol -> Expr -> BodyV Symbol
forall v. Symbol -> ExprV v -> BodyV v
R Symbol
s ((Symbol -> Symbol) -> Expr -> Expr
forall a. Subable a => (Symbol -> Symbol) -> a -> a
F.substa Symbol -> Symbol
f Expr
e)
substf :: (Symbol -> Expr) -> BodyV Symbol -> BodyV Symbol
substf Symbol -> Expr
f (E Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
E ((Symbol -> Expr) -> Expr -> Expr
forall a. Subable a => (Symbol -> Expr) -> a -> a
F.substf Symbol -> Expr
f Expr
e)
substf Symbol -> Expr
f (P Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
P ((Symbol -> Expr) -> Expr -> Expr
forall a. Subable a => (Symbol -> Expr) -> a -> a
F.substf Symbol -> Expr
f Expr
e)
substf Symbol -> Expr
f (R Symbol
s Expr
e) = Symbol -> Expr -> BodyV Symbol
forall v. Symbol -> ExprV v -> BodyV v
R Symbol
s ((Symbol -> Expr) -> Expr -> Expr
forall a. Subable a => (Symbol -> Expr) -> a -> a
F.substf Symbol -> Expr
f Expr
e)
subst :: Subst -> BodyV Symbol -> BodyV Symbol
subst Subst
su (E Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
E (Subst -> Expr -> Expr
forall a. Subable a => Subst -> a -> a
F.subst Subst
su Expr
e)
subst Subst
su (P Expr
e) = Expr -> BodyV Symbol
forall v. ExprV v -> BodyV v
P (Subst -> Expr -> Expr
forall a. Subable a => Subst -> a -> a
F.subst Subst
su Expr
e)
subst Subst
su (R Symbol
s Expr
e) = Symbol -> Expr -> BodyV Symbol
forall v. Symbol -> ExprV v -> BodyV v
R Symbol
s (Subst -> Expr -> Expr
forall a. Subable a => Subst -> a -> a
F.subst Subst
su Expr
e)
instance F.Subable t => F.Subable (WithModel t) where
syms :: WithModel t -> [Symbol]
syms (NoModel t
t) = t -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms t
t
syms (WithModel Doc
_ t
t) = t -> [Symbol]
forall a. Subable a => a -> [Symbol]
F.syms t
t
substa :: (Symbol -> Symbol) -> WithModel t -> WithModel t
substa Symbol -> Symbol
f = (t -> t) -> WithModel t -> WithModel t
forall a b. (a -> b) -> WithModel a -> WithModel b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Symbol -> Symbol) -> t -> t
forall a. Subable a => (Symbol -> Symbol) -> a -> a
F.substa Symbol -> Symbol
f)
substf :: (Symbol -> Expr) -> WithModel t -> WithModel t
substf Symbol -> Expr
f = (t -> t) -> WithModel t -> WithModel t
forall a b. (a -> b) -> WithModel a -> WithModel b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Symbol -> Expr) -> t -> t
forall a. Subable a => (Symbol -> Expr) -> a -> a
F.substf Symbol -> Expr
f)
subst :: Subst -> WithModel t -> WithModel t
subst Subst
su = (t -> t) -> WithModel t -> WithModel t
forall a b. (a -> b) -> WithModel a -> WithModel b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Subst -> t -> t
forall a. Subable a => Subst -> a -> a
F.subst Subst
su)
data RClass ty = RClass
{ forall ty. RClass ty -> BTyCon
rcName :: BTyCon
, forall ty. RClass ty -> [ty]
rcSupers :: [ty]
, forall ty. RClass ty -> [BTyVar]
rcTyVars :: [BTyVar]
, forall ty. RClass ty -> [(Located LHName, ty)]
rcMethods :: [(F.Located LHName, ty)]
} deriving (RClass ty -> RClass ty -> Bool
(RClass ty -> RClass ty -> Bool)
-> (RClass ty -> RClass ty -> Bool) -> Eq (RClass ty)
forall ty. Eq ty => RClass ty -> RClass ty -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall ty. Eq ty => RClass ty -> RClass ty -> Bool
== :: RClass ty -> RClass ty -> Bool
$c/= :: forall ty. Eq ty => RClass ty -> RClass ty -> Bool
/= :: RClass ty -> RClass ty -> Bool
Eq, Int -> RClass ty -> ShowS
[RClass ty] -> ShowS
RClass ty -> String
(Int -> RClass ty -> ShowS)
-> (RClass ty -> String)
-> ([RClass ty] -> ShowS)
-> Show (RClass ty)
forall ty. Show ty => Int -> RClass ty -> ShowS
forall ty. Show ty => [RClass ty] -> ShowS
forall ty. Show ty => RClass ty -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall ty. Show ty => Int -> RClass ty -> ShowS
showsPrec :: Int -> RClass ty -> ShowS
$cshow :: forall ty. Show ty => RClass ty -> String
show :: RClass ty -> String
$cshowList :: forall ty. Show ty => [RClass ty] -> ShowS
showList :: [RClass ty] -> ShowS
Show, (forall a b. (a -> b) -> RClass a -> RClass b)
-> (forall a b. a -> RClass b -> RClass a) -> Functor RClass
forall a b. a -> RClass b -> RClass a
forall a b. (a -> b) -> RClass a -> RClass b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> RClass a -> RClass b
fmap :: forall a b. (a -> b) -> RClass a -> RClass b
$c<$ :: forall a b. a -> RClass b -> RClass a
<$ :: forall a b. a -> RClass b -> RClass a
Functor, Typeable (RClass ty)
Typeable (RClass ty) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RClass ty -> c (RClass ty))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RClass ty))
-> (RClass ty -> Constr)
-> (RClass ty -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RClass ty)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RClass ty)))
-> ((forall b. Data b => b -> b) -> RClass ty -> RClass ty)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r)
-> (forall u. (forall d. Data d => d -> u) -> RClass ty -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> RClass ty -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty))
-> Data (RClass ty)
RClass ty -> Constr
RClass ty -> DataType
(forall b. Data b => b -> b) -> RClass ty -> RClass ty
forall ty. Data ty => Typeable (RClass ty)
forall ty. Data ty => RClass ty -> Constr
forall ty. Data ty => RClass ty -> DataType
forall ty.
Data ty =>
(forall b. Data b => b -> b) -> RClass ty -> RClass ty
forall ty u.
Data ty =>
Int -> (forall d. Data d => d -> u) -> RClass ty -> u
forall ty u.
Data ty =>
(forall d. Data d => d -> u) -> RClass ty -> [u]
forall ty r r'.
Data ty =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
forall ty r r'.
Data ty =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
forall ty (m :: * -> *).
(Data ty, Monad m) =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
forall ty (c :: * -> *).
Data ty =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RClass ty)
forall ty (c :: * -> *).
Data ty =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RClass ty -> c (RClass ty)
forall ty (t :: * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RClass ty))
forall ty (t :: * -> * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RClass ty))
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) -> RClass ty -> u
forall u. (forall d. Data d => d -> u) -> RClass ty -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RClass ty)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RClass ty -> c (RClass ty)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RClass ty))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RClass ty))
$cgfoldl :: forall ty (c :: * -> *).
Data ty =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RClass ty -> c (RClass ty)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RClass ty -> c (RClass ty)
$cgunfold :: forall ty (c :: * -> *).
Data ty =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RClass ty)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (RClass ty)
$ctoConstr :: forall ty. Data ty => RClass ty -> Constr
toConstr :: RClass ty -> Constr
$cdataTypeOf :: forall ty. Data ty => RClass ty -> DataType
dataTypeOf :: RClass ty -> DataType
$cdataCast1 :: forall ty (t :: * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (RClass ty))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (RClass ty))
$cdataCast2 :: forall ty (t :: * -> * -> *) (c :: * -> *).
(Data ty, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RClass ty))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (RClass ty))
$cgmapT :: forall ty.
Data ty =>
(forall b. Data b => b -> b) -> RClass ty -> RClass ty
gmapT :: (forall b. Data b => b -> b) -> RClass ty -> RClass ty
$cgmapQl :: forall ty r r'.
Data ty =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
$cgmapQr :: forall ty r r'.
Data ty =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RClass ty -> r
$cgmapQ :: forall ty u.
Data ty =>
(forall d. Data d => d -> u) -> RClass ty -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RClass ty -> [u]
$cgmapQi :: forall ty u.
Data ty =>
Int -> (forall d. Data d => d -> u) -> RClass ty -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RClass ty -> u
$cgmapM :: forall ty (m :: * -> *).
(Data ty, Monad m) =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
$cgmapMp :: forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
$cgmapMo :: forall ty (m :: * -> *).
(Data ty, MonadPlus m) =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RClass ty -> m (RClass ty)
Data, Typeable, (forall x. RClass ty -> Rep (RClass ty) x)
-> (forall x. Rep (RClass ty) x -> RClass ty)
-> Generic (RClass ty)
forall x. Rep (RClass ty) x -> RClass ty
forall x. RClass ty -> Rep (RClass ty) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall ty x. Rep (RClass ty) x -> RClass ty
forall ty x. RClass ty -> Rep (RClass ty) x
$cfrom :: forall ty x. RClass ty -> Rep (RClass ty) x
from :: forall x. RClass ty -> Rep (RClass ty) x
$cto :: forall ty x. Rep (RClass ty) x -> RClass ty
to :: forall x. Rep (RClass ty) x -> RClass ty
Generic, (forall m. Monoid m => RClass m -> m)
-> (forall m a. Monoid m => (a -> m) -> RClass a -> m)
-> (forall m a. Monoid m => (a -> m) -> RClass a -> m)
-> (forall a b. (a -> b -> b) -> b -> RClass a -> b)
-> (forall a b. (a -> b -> b) -> b -> RClass a -> b)
-> (forall b a. (b -> a -> b) -> b -> RClass a -> b)
-> (forall b a. (b -> a -> b) -> b -> RClass a -> b)
-> (forall a. (a -> a -> a) -> RClass a -> a)
-> (forall a. (a -> a -> a) -> RClass a -> a)
-> (forall ty. RClass ty -> [ty])
-> (forall a. RClass a -> Bool)
-> (forall a. RClass a -> Int)
-> (forall a. Eq a => a -> RClass a -> Bool)
-> (forall a. Ord a => RClass a -> a)
-> (forall a. Ord a => RClass a -> a)
-> (forall a. Num a => RClass a -> a)
-> (forall a. Num a => RClass a -> a)
-> Foldable RClass
forall a. Eq a => a -> RClass a -> Bool
forall a. Num a => RClass a -> a
forall a. Ord a => RClass a -> a
forall m. Monoid m => RClass m -> m
forall a. RClass a -> Bool
forall a. RClass a -> Int
forall ty. RClass ty -> [ty]
forall a. (a -> a -> a) -> RClass a -> a
forall m a. Monoid m => (a -> m) -> RClass a -> m
forall b a. (b -> a -> b) -> b -> RClass a -> b
forall a b. (a -> b -> b) -> b -> RClass 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
$cfold :: forall m. Monoid m => RClass m -> m
fold :: forall m. Monoid m => RClass m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> RClass a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> RClass a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> RClass a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> RClass a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> RClass a -> b
foldr :: forall a b. (a -> b -> b) -> b -> RClass a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> RClass a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> RClass a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> RClass a -> b
foldl :: forall b a. (b -> a -> b) -> b -> RClass a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> RClass a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> RClass a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> RClass a -> a
foldr1 :: forall a. (a -> a -> a) -> RClass a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> RClass a -> a
foldl1 :: forall a. (a -> a -> a) -> RClass a -> a
$ctoList :: forall ty. RClass ty -> [ty]
toList :: forall ty. RClass ty -> [ty]
$cnull :: forall a. RClass a -> Bool
null :: forall a. RClass a -> Bool
$clength :: forall a. RClass a -> Int
length :: forall a. RClass a -> Int
$celem :: forall a. Eq a => a -> RClass a -> Bool
elem :: forall a. Eq a => a -> RClass a -> Bool
$cmaximum :: forall a. Ord a => RClass a -> a
maximum :: forall a. Ord a => RClass a -> a
$cminimum :: forall a. Ord a => RClass a -> a
minimum :: forall a. Ord a => RClass a -> a
$csum :: forall a. Num a => RClass a -> a
sum :: forall a. Num a => RClass a -> a
$cproduct :: forall a. Num a => RClass a -> a
product :: forall a. Num a => RClass a -> a
Foldable, Functor RClass
Foldable RClass
(Functor RClass, Foldable RClass) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RClass a -> f (RClass b))
-> (forall (f :: * -> *) a.
Applicative f =>
RClass (f a) -> f (RClass a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RClass a -> m (RClass b))
-> (forall (m :: * -> *) a.
Monad m =>
RClass (m a) -> m (RClass a))
-> Traversable RClass
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 => RClass (m a) -> m (RClass a)
forall (f :: * -> *) a.
Applicative f =>
RClass (f a) -> f (RClass a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RClass a -> m (RClass b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RClass a -> f (RClass b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RClass a -> f (RClass b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> RClass a -> f (RClass b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
RClass (f a) -> f (RClass a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
RClass (f a) -> f (RClass a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RClass a -> m (RClass b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> RClass a -> m (RClass b)
$csequence :: forall (m :: * -> *) a. Monad m => RClass (m a) -> m (RClass a)
sequence :: forall (m :: * -> *) a. Monad m => RClass (m a) -> m (RClass a)
Traversable)
deriving Get (RClass ty)
[RClass ty] -> Put
RClass ty -> Put
(RClass ty -> Put)
-> Get (RClass ty) -> ([RClass ty] -> Put) -> Binary (RClass ty)
forall ty. Binary ty => Get (RClass ty)
forall ty. Binary ty => [RClass ty] -> Put
forall ty. Binary ty => RClass ty -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
$cput :: forall ty. Binary ty => RClass ty -> Put
put :: RClass ty -> Put
$cget :: forall ty. Binary ty => Get (RClass ty)
get :: Get (RClass ty)
$cputList :: forall ty. Binary ty => [RClass ty] -> Put
putList :: [RClass ty] -> Put
B.Binary via Generically (RClass ty)
deriving Eq (RClass ty)
Eq (RClass ty) =>
(Int -> RClass ty -> Int)
-> (RClass ty -> Int) -> Hashable (RClass ty)
Int -> RClass ty -> Int
RClass ty -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall ty. Hashable ty => Eq (RClass ty)
forall ty. Hashable ty => Int -> RClass ty -> Int
forall ty. Hashable ty => RClass ty -> Int
$chashWithSalt :: forall ty. Hashable ty => Int -> RClass ty -> Int
hashWithSalt :: Int -> RClass ty -> Int
$chash :: forall ty. Hashable ty => RClass ty -> Int
hash :: RClass ty -> Int
Hashable via Generically (RClass ty)
instance F.PPrint t => F.PPrint (RClass t) where
pprintTidy :: Tidy -> RClass t -> Doc
pprintTidy Tidy
k (RClass BTyCon
n [t]
ts [BTyVar]
as [(Located LHName, t)]
mts)
= Tidy
-> Doc -> BTyCon -> [BTyVar] -> [(Located LHName, RISig t)] -> Doc
forall x t a n.
(PPrint x, PPrint t, PPrint a, PPrint n) =>
Tidy -> Doc -> n -> [a] -> [(x, RISig t)] -> Doc
ppMethods Tidy
k (Doc
"class" Doc -> Doc -> Doc
<+> [t] -> Doc
forall {a}. PPrint a => [a] -> Doc
supers [t]
ts) BTyCon
n [BTyVar]
as [(Located LHName
m, t -> RISig t
forall t. t -> RISig t
RISig t
t) | (Located LHName
m, t
t) <- [(Located LHName, t)]
mts]
where
supers :: [a] -> Doc
supers [] = Doc
""
supers [a]
xs = [Doc] -> Doc
tuplify (Tidy -> a -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (a -> Doc) -> [a] -> [Doc]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [a]
xs) Doc -> Doc -> Doc
<+> Doc
"=>"
tuplify :: [Doc] -> Doc
tuplify = Doc -> Doc
parens (Doc -> Doc) -> ([Doc] -> Doc) -> [Doc] -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Doc] -> Doc
hcat ([Doc] -> Doc) -> ([Doc] -> [Doc]) -> [Doc] -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> [Doc] -> [Doc]
punctuate Doc
", "
ppMethods :: (F.PPrint x, F.PPrint t, F.PPrint a, F.PPrint n)
=> F.Tidy -> Doc -> n -> [a] -> [(x, RISig t)] -> Doc
ppMethods :: forall x t a n.
(PPrint x, PPrint t, PPrint a, PPrint n) =>
Tidy -> Doc -> n -> [a] -> [(x, RISig t)] -> Doc
ppMethods Tidy
k Doc
hdr n
name [a]
args [(x, RISig t)]
mts
= [Doc] -> Doc
vcat ([Doc] -> Doc) -> [Doc] -> Doc
forall a b. (a -> b) -> a -> b
$ Doc
hdr Doc -> Doc -> Doc
<+> Doc
dName Doc -> Doc -> Doc
<+> Doc
"where"
Doc -> [Doc] -> [Doc]
forall a. a -> [a] -> [a]
: [ Int -> Doc -> Doc
nest Int
4 (x -> RISig t -> Doc
forall {k} {t}. (PPrint k, PPrint t) => k -> RISig t -> Doc
bind x
m RISig t
t) | (x
m, RISig t
t) <- [(x, RISig t)]
mts ]
where
dName :: Doc
dName = Doc -> Doc
parens (Tidy -> n -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k n
name Doc -> Doc -> Doc
<+> Doc
dArgs)
dArgs :: Doc
dArgs = [Doc] -> Doc
gaps (Tidy -> a -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (a -> Doc) -> [a] -> [Doc]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [a]
args)
gaps :: [Doc] -> Doc
gaps = [Doc] -> Doc
hcat ([Doc] -> Doc) -> ([Doc] -> [Doc]) -> [Doc] -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> [Doc] -> [Doc]
punctuate Doc
" "
bind :: k -> RISig t -> Doc
bind k
m RISig t
t = Tidy -> k -> RISig t -> Doc
forall k t. (PPrint k, PPrint t) => Tidy -> k -> RISig t -> Doc
ppRISig Tidy
k k
m RISig t
t
data HoleInfo i t = HoleInfo {forall i t. HoleInfo i t -> t
htype :: t, forall i t. HoleInfo i t -> SrcSpan
hloc :: SrcSpan, forall i t. HoleInfo i t -> AREnv t
henv :: AREnv t, forall i t. HoleInfo i t -> i
info :: i }
instance Functor (HoleInfo i) where
fmap :: forall a b. (a -> b) -> HoleInfo i a -> HoleInfo i b
fmap a -> b
f HoleInfo i a
hinfo = HoleInfo i a
hinfo{htype = f (htype hinfo), henv = fmap f (henv hinfo)}
instance (F.PPrint t) => F.PPrint (HoleInfo i t) where
pprintTidy :: Tidy -> HoleInfo i t -> Doc
pprintTidy Tidy
k HoleInfo i t
hinfo = String -> Doc
text String
"type:" Doc -> Doc -> Doc
<+> Tidy -> t -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (HoleInfo i t -> t
forall i t. HoleInfo i t -> t
htype HoleInfo i t
hinfo)
Doc -> Doc -> Doc
<+> String -> Doc
text String
"\n loc:" Doc -> Doc -> Doc
<+> Tidy -> SrcSpan -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (HoleInfo i t -> SrcSpan
forall i t. HoleInfo i t -> SrcSpan
hloc HoleInfo i t
hinfo)
newtype AnnInfo a = AI (M.HashMap SrcSpan [(Maybe Text, a)])
deriving (Typeable (AnnInfo a)
Typeable (AnnInfo a) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnInfo a -> c (AnnInfo a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AnnInfo a))
-> (AnnInfo a -> Constr)
-> (AnnInfo a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AnnInfo a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AnnInfo a)))
-> ((forall b. Data b => b -> b) -> AnnInfo a -> AnnInfo a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r)
-> (forall u. (forall d. Data d => d -> u) -> AnnInfo a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> AnnInfo a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a))
-> Data (AnnInfo a)
AnnInfo a -> Constr
AnnInfo a -> DataType
(forall b. Data b => b -> b) -> AnnInfo a -> AnnInfo a
forall a. Data a => Typeable (AnnInfo a)
forall a. Data a => AnnInfo a -> Constr
forall a. Data a => AnnInfo a -> DataType
forall a.
Data a =>
(forall b. Data b => b -> b) -> AnnInfo a -> AnnInfo a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> AnnInfo a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> AnnInfo a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AnnInfo a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnInfo a -> c (AnnInfo a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AnnInfo a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AnnInfo a))
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> AnnInfo a -> u
forall u. (forall d. Data d => d -> u) -> AnnInfo a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AnnInfo a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnInfo a -> c (AnnInfo a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AnnInfo a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AnnInfo a))
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnInfo a -> c (AnnInfo a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnInfo a -> c (AnnInfo a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AnnInfo a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AnnInfo a)
$ctoConstr :: forall a. Data a => AnnInfo a -> Constr
toConstr :: AnnInfo a -> Constr
$cdataTypeOf :: forall a. Data a => AnnInfo a -> DataType
dataTypeOf :: AnnInfo a -> DataType
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AnnInfo a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AnnInfo a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AnnInfo a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AnnInfo a))
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> AnnInfo a -> AnnInfo a
gmapT :: (forall b. Data b => b -> b) -> AnnInfo a -> AnnInfo a
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnInfo a -> r
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> AnnInfo a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> AnnInfo a -> [u]
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> AnnInfo a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnnInfo a -> u
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnInfo a -> m (AnnInfo a)
Data, Typeable, (forall x. AnnInfo a -> Rep (AnnInfo a) x)
-> (forall x. Rep (AnnInfo a) x -> AnnInfo a)
-> Generic (AnnInfo a)
forall x. Rep (AnnInfo a) x -> AnnInfo a
forall x. AnnInfo a -> Rep (AnnInfo a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (AnnInfo a) x -> AnnInfo a
forall a x. AnnInfo a -> Rep (AnnInfo a) x
$cfrom :: forall a x. AnnInfo a -> Rep (AnnInfo a) x
from :: forall x. AnnInfo a -> Rep (AnnInfo a) x
$cto :: forall a x. Rep (AnnInfo a) x -> AnnInfo a
to :: forall x. Rep (AnnInfo a) x -> AnnInfo a
Generic, (forall a b. (a -> b) -> AnnInfo a -> AnnInfo b)
-> (forall a b. a -> AnnInfo b -> AnnInfo a) -> Functor AnnInfo
forall a b. a -> AnnInfo b -> AnnInfo a
forall a b. (a -> b) -> AnnInfo a -> AnnInfo b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> AnnInfo a -> AnnInfo b
fmap :: forall a b. (a -> b) -> AnnInfo a -> AnnInfo b
$c<$ :: forall a b. a -> AnnInfo b -> AnnInfo a
<$ :: forall a b. a -> AnnInfo b -> AnnInfo a
Functor)
data Annot t
= AnnUse t
| AnnDef t
| AnnRDf t
| AnnLoc SrcSpan
deriving (Typeable (Annot t)
Typeable (Annot t) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Annot t -> c (Annot t))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Annot t))
-> (Annot t -> Constr)
-> (Annot t -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Annot t)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Annot t)))
-> ((forall b. Data b => b -> b) -> Annot t -> Annot t)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r)
-> (forall u. (forall d. Data d => d -> u) -> Annot t -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Annot t -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t))
-> Data (Annot t)
Annot t -> Constr
Annot t -> DataType
(forall b. Data b => b -> b) -> Annot t -> Annot t
forall t. Data t => Typeable (Annot t)
forall t. Data t => Annot t -> Constr
forall t. Data t => Annot t -> DataType
forall t.
Data t =>
(forall b. Data b => b -> b) -> Annot t -> Annot t
forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> Annot t -> u
forall t u.
Data t =>
(forall d. Data d => d -> u) -> Annot t -> [u]
forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Annot t)
forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Annot t -> c (Annot t)
forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Annot t))
forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Annot t))
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) -> Annot t -> u
forall u. (forall d. Data d => d -> u) -> Annot t -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Annot t)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Annot t -> c (Annot t)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Annot t))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Annot t))
$cgfoldl :: forall t (c :: * -> *).
Data t =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Annot t -> c (Annot t)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Annot t -> c (Annot t)
$cgunfold :: forall t (c :: * -> *).
Data t =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Annot t)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Annot t)
$ctoConstr :: forall t. Data t => Annot t -> Constr
toConstr :: Annot t -> Constr
$cdataTypeOf :: forall t. Data t => Annot t -> DataType
dataTypeOf :: Annot t -> DataType
$cdataCast1 :: forall t (t :: * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Annot t))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Annot t))
$cdataCast2 :: forall t (t :: * -> * -> *) (c :: * -> *).
(Data t, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Annot t))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Annot t))
$cgmapT :: forall t.
Data t =>
(forall b. Data b => b -> b) -> Annot t -> Annot t
gmapT :: (forall b. Data b => b -> b) -> Annot t -> Annot t
$cgmapQl :: forall t r r'.
Data t =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
$cgmapQr :: forall t r r'.
Data t =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Annot t -> r
$cgmapQ :: forall t u.
Data t =>
(forall d. Data d => d -> u) -> Annot t -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Annot t -> [u]
$cgmapQi :: forall t u.
Data t =>
Int -> (forall d. Data d => d -> u) -> Annot t -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Annot t -> u
$cgmapM :: forall t (m :: * -> *).
(Data t, Monad m) =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
$cgmapMp :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
$cgmapMo :: forall t (m :: * -> *).
(Data t, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Annot t -> m (Annot t)
Data, Typeable, (forall x. Annot t -> Rep (Annot t) x)
-> (forall x. Rep (Annot t) x -> Annot t) -> Generic (Annot t)
forall x. Rep (Annot t) x -> Annot t
forall x. Annot t -> Rep (Annot t) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall t x. Rep (Annot t) x -> Annot t
forall t x. Annot t -> Rep (Annot t) x
$cfrom :: forall t x. Annot t -> Rep (Annot t) x
from :: forall x. Annot t -> Rep (Annot t) x
$cto :: forall t x. Rep (Annot t) x -> Annot t
to :: forall x. Rep (Annot t) x -> Annot t
Generic, (forall a b. (a -> b) -> Annot a -> Annot b)
-> (forall a b. a -> Annot b -> Annot a) -> Functor Annot
forall a b. a -> Annot b -> Annot a
forall a b. (a -> b) -> Annot a -> Annot b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Annot a -> Annot b
fmap :: forall a b. (a -> b) -> Annot a -> Annot b
$c<$ :: forall a b. a -> Annot b -> Annot a
<$ :: forall a b. a -> Annot b -> Annot a
Functor)
instance Monoid (AnnInfo a) where
mempty :: AnnInfo a
mempty = HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a
forall a. HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a
AI HashMap SrcSpan [(Maybe Text, a)]
forall k v. HashMap k v
M.empty
mappend :: AnnInfo a -> AnnInfo a -> AnnInfo a
mappend = AnnInfo a -> AnnInfo a -> AnnInfo a
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup (AnnInfo a) where
AI HashMap SrcSpan [(Maybe Text, a)]
m1 <> :: AnnInfo a -> AnnInfo a -> AnnInfo a
<> AI HashMap SrcSpan [(Maybe Text, a)]
m2 = HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a
forall a. HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a
AI (HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a)
-> HashMap SrcSpan [(Maybe Text, a)] -> AnnInfo a
forall a b. (a -> b) -> a -> b
$ ([(Maybe Text, a)] -> [(Maybe Text, a)] -> [(Maybe Text, a)])
-> HashMap SrcSpan [(Maybe Text, a)]
-> HashMap SrcSpan [(Maybe Text, a)]
-> HashMap SrcSpan [(Maybe Text, a)]
forall k v.
Eq k =>
(v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
M.unionWith [(Maybe Text, a)] -> [(Maybe Text, a)] -> [(Maybe Text, a)]
forall a. [a] -> [a] -> [a]
(++) HashMap SrcSpan [(Maybe Text, a)]
m1 HashMap SrcSpan [(Maybe Text, a)]
m2
instance NFData a => NFData (AnnInfo a)
instance NFData a => NFData (Annot a)
data Output a = O
{ forall a. Output a -> Maybe [String]
o_vars :: Maybe [String]
, forall a. Output a -> AnnInfo a
o_types :: !(AnnInfo a)
, forall a. Output a -> AnnInfo a
o_templs :: !(AnnInfo a)
, forall a. Output a -> [SrcSpan]
o_bots :: ![SrcSpan]
, forall a. Output a -> ErrorResult
o_result :: ErrorResult
} deriving (Typeable, (forall x. Output a -> Rep (Output a) x)
-> (forall x. Rep (Output a) x -> Output a) -> Generic (Output a)
forall x. Rep (Output a) x -> Output a
forall x. Output a -> Rep (Output a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Output a) x -> Output a
forall a x. Output a -> Rep (Output a) x
$cfrom :: forall a x. Output a -> Rep (Output a) x
from :: forall x. Output a -> Rep (Output a) x
$cto :: forall a x. Rep (Output a) x -> Output a
to :: forall x. Rep (Output a) x -> Output a
Generic, (forall a b. (a -> b) -> Output a -> Output b)
-> (forall a b. a -> Output b -> Output a) -> Functor Output
forall a b. a -> Output b -> Output a
forall a b. (a -> b) -> Output a -> Output b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Output a -> Output b
fmap :: forall a b. (a -> b) -> Output a -> Output b
$c<$ :: forall a b. a -> Output b -> Output a
<$ :: forall a b. a -> Output b -> Output a
Functor)
instance (F.PPrint a) => F.PPrint (Output a) where
pprintTidy :: Tidy -> Output a -> Doc
pprintTidy Tidy
_ Output a
out = FixResult Doc -> Doc
forall a. Fixpoint a => FixResult a -> Doc
F.resultDoc (UserError -> Doc
forall a. PPrint a => a -> Doc
F.pprint (UserError -> Doc) -> ErrorResult -> FixResult Doc
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Output a -> ErrorResult
forall a. Output a -> ErrorResult
o_result Output a
out)
emptyOutput :: Output a
emptyOutput :: forall a. Output a
emptyOutput = Maybe [String]
-> AnnInfo a -> AnnInfo a -> [SrcSpan] -> ErrorResult -> Output a
forall a.
Maybe [String]
-> AnnInfo a -> AnnInfo a -> [SrcSpan] -> ErrorResult -> Output a
O Maybe [String]
forall a. Maybe a
Nothing AnnInfo a
forall a. Monoid a => a
mempty AnnInfo a
forall a. Monoid a => a
mempty [] ErrorResult
forall a. Monoid a => a
mempty
instance Monoid (Output a) where
mempty :: Output a
mempty = Output a
forall a. Output a
emptyOutput
mappend :: Output a -> Output a -> Output a
mappend = Output a -> Output a -> Output a
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup (Output a) where
Output a
o1 <> :: Output a -> Output a -> Output a
<> Output a
o2 = O { o_vars :: Maybe [String]
o_vars = [String] -> [String]
forall a. Ord a => [a] -> [a]
sortNub ([String] -> [String]) -> Maybe [String] -> Maybe [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe [String] -> Maybe [String] -> Maybe [String]
forall a. Monoid a => a -> a -> a
mappend (Output a -> Maybe [String]
forall a. Output a -> Maybe [String]
o_vars Output a
o1) (Output a -> Maybe [String]
forall a. Output a -> Maybe [String]
o_vars Output a
o2)
, o_types :: AnnInfo a
o_types = AnnInfo a -> AnnInfo a -> AnnInfo a
forall a. Monoid a => a -> a -> a
mappend (Output a -> AnnInfo a
forall a. Output a -> AnnInfo a
o_types Output a
o1) (Output a -> AnnInfo a
forall a. Output a -> AnnInfo a
o_types Output a
o2)
, o_templs :: AnnInfo a
o_templs = AnnInfo a -> AnnInfo a -> AnnInfo a
forall a. Monoid a => a -> a -> a
mappend (Output a -> AnnInfo a
forall a. Output a -> AnnInfo a
o_templs Output a
o1) (Output a -> AnnInfo a
forall a. Output a -> AnnInfo a
o_templs Output a
o2)
, o_bots :: [SrcSpan]
o_bots = (SrcSpan -> SrcSpan -> Ordering) -> [SrcSpan] -> [SrcSpan]
forall a. Eq a => (a -> a -> Ordering) -> [a] -> [a]
sortNubBy SrcSpan -> SrcSpan -> Ordering
ordSrcSpan ([SrcSpan] -> [SrcSpan]) -> [SrcSpan] -> [SrcSpan]
forall a b. (a -> b) -> a -> b
$ [SrcSpan] -> [SrcSpan] -> [SrcSpan]
forall a. Monoid a => a -> a -> a
mappend (Output a -> [SrcSpan]
forall a. Output a -> [SrcSpan]
o_bots Output a
o1) (Output a -> [SrcSpan]
forall a. Output a -> [SrcSpan]
o_bots Output a
o2)
, o_result :: ErrorResult
o_result = ErrorResult -> ErrorResult -> ErrorResult
forall a. Monoid a => a -> a -> a
mappend (Output a -> ErrorResult
forall a. Output a -> ErrorResult
o_result Output a
o1) (Output a -> ErrorResult
forall a. Output a -> ErrorResult
o_result Output a
o2)
}
ordSrcSpan :: SrcSpan -> SrcSpan -> Ordering
ordSrcSpan :: SrcSpan -> SrcSpan -> Ordering
ordSrcSpan (RealSrcSpan RealSrcSpan
r1 Maybe BufSpan
_) (RealSrcSpan RealSrcSpan
r2 Maybe BufSpan
_) = RealSrcSpan
r1 RealSrcSpan -> RealSrcSpan -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` RealSrcSpan
r2
ordSrcSpan (RealSrcSpan RealSrcSpan
_ Maybe BufSpan
_ ) SrcSpan
_ = Ordering
GT
ordSrcSpan SrcSpan
_ (RealSrcSpan RealSrcSpan
_ Maybe BufSpan
_ ) = Ordering
LT
ordSrcSpan SrcSpan
_ SrcSpan
_ = Ordering
EQ
data KVKind
= RecBindE Var
| NonRecBindE Var
| TypeInstE
| PredInstE
| LamE
| CaseE Int
| LetE
| ProjectE
deriving ((forall x. KVKind -> Rep KVKind x)
-> (forall x. Rep KVKind x -> KVKind) -> Generic KVKind
forall x. Rep KVKind x -> KVKind
forall x. KVKind -> Rep KVKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. KVKind -> Rep KVKind x
from :: forall x. KVKind -> Rep KVKind x
$cto :: forall x. Rep KVKind x -> KVKind
to :: forall x. Rep KVKind x -> KVKind
Generic, KVKind -> KVKind -> Bool
(KVKind -> KVKind -> Bool)
-> (KVKind -> KVKind -> Bool) -> Eq KVKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: KVKind -> KVKind -> Bool
== :: KVKind -> KVKind -> Bool
$c/= :: KVKind -> KVKind -> Bool
/= :: KVKind -> KVKind -> Bool
Eq, Eq KVKind
Eq KVKind =>
(KVKind -> KVKind -> Ordering)
-> (KVKind -> KVKind -> Bool)
-> (KVKind -> KVKind -> Bool)
-> (KVKind -> KVKind -> Bool)
-> (KVKind -> KVKind -> Bool)
-> (KVKind -> KVKind -> KVKind)
-> (KVKind -> KVKind -> KVKind)
-> Ord KVKind
KVKind -> KVKind -> Bool
KVKind -> KVKind -> Ordering
KVKind -> KVKind -> KVKind
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
$ccompare :: KVKind -> KVKind -> Ordering
compare :: KVKind -> KVKind -> Ordering
$c< :: KVKind -> KVKind -> Bool
< :: KVKind -> KVKind -> Bool
$c<= :: KVKind -> KVKind -> Bool
<= :: KVKind -> KVKind -> Bool
$c> :: KVKind -> KVKind -> Bool
> :: KVKind -> KVKind -> Bool
$c>= :: KVKind -> KVKind -> Bool
>= :: KVKind -> KVKind -> Bool
$cmax :: KVKind -> KVKind -> KVKind
max :: KVKind -> KVKind -> KVKind
$cmin :: KVKind -> KVKind -> KVKind
min :: KVKind -> KVKind -> KVKind
Ord, Int -> KVKind -> ShowS
[KVKind] -> ShowS
KVKind -> String
(Int -> KVKind -> ShowS)
-> (KVKind -> String) -> ([KVKind] -> ShowS) -> Show KVKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> KVKind -> ShowS
showsPrec :: Int -> KVKind -> ShowS
$cshow :: KVKind -> String
show :: KVKind -> String
$cshowList :: [KVKind] -> ShowS
showList :: [KVKind] -> ShowS
Show, Typeable KVKind
Typeable KVKind =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KVKind -> c KVKind)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KVKind)
-> (KVKind -> Constr)
-> (KVKind -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KVKind))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KVKind))
-> ((forall b. Data b => b -> b) -> KVKind -> KVKind)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KVKind -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KVKind -> r)
-> (forall u. (forall d. Data d => d -> u) -> KVKind -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> KVKind -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind)
-> Data KVKind
KVKind -> Constr
KVKind -> DataType
(forall b. Data b => b -> b) -> KVKind -> KVKind
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) -> KVKind -> u
forall u. (forall d. Data d => d -> u) -> KVKind -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KVKind
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KVKind -> c KVKind
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KVKind)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KVKind)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KVKind -> c KVKind
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KVKind -> c KVKind
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KVKind
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KVKind
$ctoConstr :: KVKind -> Constr
toConstr :: KVKind -> Constr
$cdataTypeOf :: KVKind -> DataType
dataTypeOf :: KVKind -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KVKind)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KVKind)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KVKind)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KVKind)
$cgmapT :: (forall b. Data b => b -> b) -> KVKind -> KVKind
gmapT :: (forall b. Data b => b -> b) -> KVKind -> KVKind
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KVKind -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> KVKind -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> KVKind -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> KVKind -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> KVKind -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KVKind -> m KVKind
Data, Typeable)
instance Hashable KVKind
newtype KVProf = KVP (M.HashMap KVKind Int) deriving ((forall x. KVProf -> Rep KVProf x)
-> (forall x. Rep KVProf x -> KVProf) -> Generic KVProf
forall x. Rep KVProf x -> KVProf
forall x. KVProf -> Rep KVProf x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. KVProf -> Rep KVProf x
from :: forall x. KVProf -> Rep KVProf x
$cto :: forall x. Rep KVProf x -> KVProf
to :: forall x. Rep KVProf x -> KVProf
Generic)
emptyKVProf :: KVProf
emptyKVProf :: KVProf
emptyKVProf = HashMap KVKind Int -> KVProf
KVP HashMap KVKind Int
forall k v. HashMap k v
M.empty
updKVProf :: KVKind -> F.Kuts -> KVProf -> KVProf
updKVProf :: KVKind -> Kuts -> KVProf -> KVProf
updKVProf KVKind
k Kuts
kvs (KVP HashMap KVKind Int
m) = HashMap KVKind Int -> KVProf
KVP (HashMap KVKind Int -> KVProf) -> HashMap KVKind Int -> KVProf
forall a b. (a -> b) -> a -> b
$ KVKind -> Int -> HashMap KVKind Int -> HashMap KVKind Int
forall k v.
(Eq k, Hashable k) =>
k -> v -> HashMap k v -> HashMap k v
M.insert KVKind
k (Int
kn Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
n) HashMap KVKind Int
m
where
kn :: Int
kn = Int -> KVKind -> HashMap KVKind Int -> Int
forall k v. (Eq k, Hashable k) => v -> k -> HashMap k v -> v
M.lookupDefault Int
0 KVKind
k HashMap KVKind Int
m
n :: Int
n = HashSet KVar -> Int
forall a. HashSet a -> Int
S.size (Kuts -> HashSet KVar
F.ksVars Kuts
kvs)
instance NFData KVKind
instance F.PPrint KVKind where
pprintTidy :: Tidy -> KVKind -> Doc
pprintTidy Tidy
_ = String -> Doc
text (String -> Doc) -> (KVKind -> String) -> KVKind -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVKind -> String
forall a. Show a => a -> String
show
instance F.PPrint KVProf where
pprintTidy :: Tidy -> KVProf -> Doc
pprintTidy Tidy
k (KVP HashMap KVKind Int
m) = Tidy -> [(KVKind, Int)] -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (HashMap KVKind Int -> [(KVKind, Int)]
forall k v. HashMap k v -> [(k, v)]
M.toList HashMap KVKind Int
m)
instance NFData KVProf
hole :: F.ExprV v
hole :: forall v. ExprV v
hole = KVar -> SubstV v -> ExprV v
forall v. KVar -> SubstV v -> ExprV v
F.PKVar KVar
"HOLE" (HashMap Symbol (ExprV v) -> SubstV v
forall v. HashMap Symbol (ExprV v) -> SubstV v
F.Su HashMap Symbol (ExprV v)
forall a. Monoid a => a
mempty)
isHole :: Expr -> Bool
isHole :: Expr -> Bool
isHole (F.PKVar KVar
"HOLE" Subst
_) = Bool
True
isHole Expr
_ = Bool
False
hasHole :: Reftable r => r -> Bool
hasHole :: forall r. Reftable r => r -> Bool
hasHole = (Expr -> Bool) -> [Expr] -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
any Expr -> Bool
isHole ([Expr] -> Bool) -> (r -> [Expr]) -> r -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expr -> [Expr]
forall v. Eq v => ExprV v -> [ExprV v]
F.conjuncts (Expr -> [Expr]) -> (r -> Expr) -> r -> [Expr]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ReftV Symbol -> Expr
forall v. ReftV v -> ExprV v
F.reftPred (ReftV Symbol -> Expr) -> (r -> ReftV Symbol) -> r -> Expr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. r -> ReftV Symbol
forall r. Reftable r => r -> ReftV Symbol
toReft
instance F.Symbolic DataCon where
symbol :: DataCon -> Symbol
symbol = Var -> Symbol
forall a. Symbolic a => a -> Symbol
F.symbol (Var -> Symbol) -> (DataCon -> Var) -> DataCon -> Symbol
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DataCon -> Var
dataConWorkId
instance Ord TyCon where
compare :: TyCon -> TyCon -> Ordering
compare = Symbol -> Symbol -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (Symbol -> Symbol -> Ordering)
-> (TyCon -> Symbol) -> TyCon -> TyCon -> Ordering
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` TyCon -> Symbol
forall a. Symbolic a => a -> Symbol
F.symbol
instance Ord DataCon where
compare :: DataCon -> DataCon -> Ordering
compare = Symbol -> Symbol -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (Symbol -> Symbol -> Ordering)
-> (DataCon -> Symbol) -> DataCon -> DataCon -> Ordering
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` DataCon -> Symbol
forall a. Symbolic a => a -> Symbol
F.symbol
instance F.PPrint TyThing where
pprintTidy :: Tidy -> TyThing -> Doc
pprintTidy Tidy
_ = String -> Doc
text (String -> Doc) -> (TyThing -> String) -> TyThing -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TyThing -> String
forall a. Outputable a => a -> String
showPpr
liquidBegin :: String
liquidBegin :: String
liquidBegin = [Char
'{', Char
'-', Char
'@']
liquidEnd :: String
liquidEnd :: String
liquidEnd = [Char
'@', Char
'-', Char
'}']
data MSpec ty ctor = MSpec
{ forall ty ctor. MSpec ty ctor -> HashMap LHName [Def ty ctor]
ctorMap :: M.HashMap LHName [Def ty ctor]
, forall ty ctor.
MSpec ty ctor -> HashMap (Located LHName) (Measure ty ctor)
measMap :: M.HashMap (F.Located LHName) (Measure ty ctor)
, forall ty ctor.
MSpec ty ctor -> HashMap (Located LHName) (Measure ty ())
cmeasMap :: M.HashMap (F.Located LHName) (Measure ty ())
, forall ty ctor. MSpec ty ctor -> [Measure ty ctor]
imeas :: ![Measure ty ctor]
} deriving (Typeable (MSpec ty ctor)
Typeable (MSpec ty ctor) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor))
-> (MSpec ty ctor -> Constr)
-> (MSpec ty ctor -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MSpec ty ctor)))
-> ((forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r)
-> (forall u. (forall d. Data d => d -> u) -> MSpec ty ctor -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> MSpec ty ctor -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor))
-> Data (MSpec ty ctor)
MSpec ty ctor -> Constr
MSpec ty ctor -> DataType
(forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor
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) -> MSpec ty ctor -> u
forall u. (forall d. Data d => d -> u) -> MSpec ty ctor -> [u]
forall ty ctor. (Data ty, Data ctor) => Typeable (MSpec ty ctor)
forall ty ctor. (Data ty, Data ctor) => MSpec ty ctor -> Constr
forall ty ctor. (Data ty, Data ctor) => MSpec ty ctor -> DataType
forall ty ctor.
(Data ty, Data ctor) =>
(forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor
forall ty ctor u.
(Data ty, Data ctor) =>
Int -> (forall d. Data d => d -> u) -> MSpec ty ctor -> u
forall ty ctor u.
(Data ty, Data ctor) =>
(forall d. Data d => d -> u) -> MSpec ty ctor -> [u]
forall ty ctor r r'.
(Data ty, Data ctor) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
forall ty ctor r r'.
(Data ty, Data ctor) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
forall ty ctor (m :: * -> *).
(Data ty, Data ctor, Monad m) =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
forall ty ctor (m :: * -> *).
(Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
forall ty ctor (c :: * -> *).
(Data ty, Data ctor) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor)
forall ty ctor (c :: * -> *).
(Data ty, Data ctor) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor)
forall ty ctor (t :: * -> *) (c :: * -> *).
(Data ty, Data ctor, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor))
forall ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data ty, Data ctor, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MSpec ty ctor))
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MSpec ty ctor))
$cgfoldl :: forall ty ctor (c :: * -> *).
(Data ty, Data ctor) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor)
$cgunfold :: forall ty ctor (c :: * -> *).
(Data ty, Data ctor) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor)
$ctoConstr :: forall ty ctor. (Data ty, Data ctor) => MSpec ty ctor -> Constr
toConstr :: MSpec ty ctor -> Constr
$cdataTypeOf :: forall ty ctor. (Data ty, Data ctor) => MSpec ty ctor -> DataType
dataTypeOf :: MSpec ty ctor -> DataType
$cdataCast1 :: forall ty ctor (t :: * -> *) (c :: * -> *).
(Data ty, Data ctor, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor))
$cdataCast2 :: forall ty ctor (t :: * -> * -> *) (c :: * -> *).
(Data ty, Data ctor, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MSpec ty ctor))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (MSpec ty ctor))
$cgmapT :: forall ty ctor.
(Data ty, Data ctor) =>
(forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor
gmapT :: (forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor
$cgmapQl :: forall ty ctor r r'.
(Data ty, Data ctor) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
$cgmapQr :: forall ty ctor r r'.
(Data ty, Data ctor) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r
$cgmapQ :: forall ty ctor u.
(Data ty, Data ctor) =>
(forall d. Data d => d -> u) -> MSpec ty ctor -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> MSpec ty ctor -> [u]
$cgmapQi :: forall ty ctor u.
(Data ty, Data ctor) =>
Int -> (forall d. Data d => d -> u) -> MSpec ty ctor -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MSpec ty ctor -> u
$cgmapM :: forall ty ctor (m :: * -> *).
(Data ty, Data ctor, Monad m) =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
$cgmapMp :: forall ty ctor (m :: * -> *).
(Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
$cgmapMo :: forall ty ctor (m :: * -> *).
(Data ty, Data ctor, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> MSpec ty ctor -> m (MSpec ty ctor)
Data, Typeable, (forall x. MSpec ty ctor -> Rep (MSpec ty ctor) x)
-> (forall x. Rep (MSpec ty ctor) x -> MSpec ty ctor)
-> Generic (MSpec ty ctor)
forall x. Rep (MSpec ty ctor) x -> MSpec ty ctor
forall x. MSpec ty ctor -> Rep (MSpec ty ctor) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall ty ctor x. Rep (MSpec ty ctor) x -> MSpec ty ctor
forall ty ctor x. MSpec ty ctor -> Rep (MSpec ty ctor) x
$cfrom :: forall ty ctor x. MSpec ty ctor -> Rep (MSpec ty ctor) x
from :: forall x. MSpec ty ctor -> Rep (MSpec ty ctor) x
$cto :: forall ty ctor x. Rep (MSpec ty ctor) x -> MSpec ty ctor
to :: forall x. Rep (MSpec ty ctor) x -> MSpec ty ctor
Generic, (forall a b. (a -> b) -> MSpec ty a -> MSpec ty b)
-> (forall a b. a -> MSpec ty b -> MSpec ty a)
-> Functor (MSpec ty)
forall a b. a -> MSpec ty b -> MSpec ty a
forall a b. (a -> b) -> MSpec ty a -> MSpec ty b
forall ty a b. a -> MSpec ty b -> MSpec ty a
forall ty a b. (a -> b) -> MSpec ty a -> MSpec ty b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall ty a b. (a -> b) -> MSpec ty a -> MSpec ty b
fmap :: forall a b. (a -> b) -> MSpec ty a -> MSpec ty b
$c<$ :: forall ty a b. a -> MSpec ty b -> MSpec ty a
<$ :: forall a b. a -> MSpec ty b -> MSpec ty a
Functor)
instance Bifunctor MSpec where
first :: forall a b c. (a -> b) -> MSpec a c -> MSpec b c
first a -> b
f (MSpec HashMap LHName [Def a c]
c HashMap (Located LHName) (Measure a c)
m HashMap (Located LHName) (Measure a ())
cm [Measure a c]
im) = HashMap LHName [Def b c]
-> HashMap (Located LHName) (Measure b c)
-> HashMap (Located LHName) (Measure b ())
-> [Measure b c]
-> MSpec b c
forall ty ctor.
HashMap LHName [Def ty ctor]
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ())
-> [Measure ty ctor]
-> MSpec ty ctor
MSpec (([Def a c] -> [Def b c])
-> HashMap LHName [Def a c] -> HashMap LHName [Def b c]
forall a b. (a -> b) -> HashMap LHName a -> HashMap LHName b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Def a c -> Def b c) -> [Def a c] -> [Def b c]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> b) -> Def a c -> Def b c
forall a b c. (a -> b) -> DefV Symbol a c -> DefV Symbol b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first a -> b
f)) HashMap LHName [Def a c]
c)
((Measure a c -> Measure b c)
-> HashMap (Located LHName) (Measure a c)
-> HashMap (Located LHName) (Measure b c)
forall a b.
(a -> b)
-> HashMap (Located LHName) a -> HashMap (Located LHName) b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> b) -> Measure a c -> Measure b c
forall a b c.
(a -> b) -> MeasureV Symbol a c -> MeasureV Symbol b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first a -> b
f) HashMap (Located LHName) (Measure a c)
m)
((Measure a () -> Measure b ())
-> HashMap (Located LHName) (Measure a ())
-> HashMap (Located LHName) (Measure b ())
forall a b.
(a -> b)
-> HashMap (Located LHName) a -> HashMap (Located LHName) b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> b) -> Measure a () -> Measure b ()
forall a b c.
(a -> b) -> MeasureV Symbol a c -> MeasureV Symbol b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first a -> b
f) HashMap (Located LHName) (Measure a ())
cm)
((Measure a c -> Measure b c) -> [Measure a c] -> [Measure b c]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> b) -> Measure a c -> Measure b c
forall a b c.
(a -> b) -> MeasureV Symbol a c -> MeasureV Symbol b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first a -> b
f) [Measure a c]
im)
second :: forall b c a. (b -> c) -> MSpec a b -> MSpec a c
second = (b -> c) -> MSpec a b -> MSpec a c
forall a b. (a -> b) -> MSpec a a -> MSpec a b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
instance (F.PPrint t, F.PPrint a) => F.PPrint (MSpec t a) where
pprintTidy :: Tidy -> MSpec t a -> Doc
pprintTidy Tidy
k = [Doc] -> Doc
vcat ([Doc] -> Doc) -> (MSpec t a -> [Doc]) -> MSpec t a -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Located LHName, Measure t a) -> Doc)
-> [(Located LHName, Measure t a)] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Tidy -> Measure t a -> Doc
forall a. PPrint a => Tidy -> a -> Doc
F.pprintTidy Tidy
k (Measure t a -> Doc)
-> ((Located LHName, Measure t a) -> Measure t a)
-> (Located LHName, Measure t a)
-> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Located LHName, Measure t a) -> Measure t a
forall a b. (a, b) -> b
snd) ([(Located LHName, Measure t a)] -> [Doc])
-> (MSpec t a -> [(Located LHName, Measure t a)])
-> MSpec t a
-> [Doc]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Located LHName) (Measure t a)
-> [(Located LHName, Measure t a)]
forall k v. HashMap k v -> [(k, v)]
M.toList (HashMap (Located LHName) (Measure t a)
-> [(Located LHName, Measure t a)])
-> (MSpec t a -> HashMap (Located LHName) (Measure t a))
-> MSpec t a
-> [(Located LHName, Measure t a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MSpec t a -> HashMap (Located LHName) (Measure t a)
forall ty ctor.
MSpec ty ctor -> HashMap (Located LHName) (Measure ty ctor)
measMap
instance (Show ty, Show ctor, F.PPrint ctor, F.PPrint ty) => Show (MSpec ty ctor) where
show :: MSpec ty ctor -> String
show (MSpec HashMap LHName [Def ty ctor]
ct HashMap (Located LHName) (Measure ty ctor)
m HashMap (Located LHName) (Measure ty ())
cm [Measure ty ctor]
im)
= String
"\nMSpec:\n" String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nctorMap:\t " String -> ShowS
forall a. [a] -> [a] -> [a]
++ HashMap LHName [Def ty ctor] -> String
forall a. Show a => a -> String
show HashMap LHName [Def ty ctor]
ct String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nmeasMap:\t " String -> ShowS
forall a. [a] -> [a] -> [a]
++ HashMap (Located LHName) (Measure ty ctor) -> String
forall a. Show a => a -> String
show HashMap (Located LHName) (Measure ty ctor)
m String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\ncmeasMap:\t " String -> ShowS
forall a. [a] -> [a] -> [a]
++ HashMap (Located LHName) (Measure ty ()) -> String
forall a. Show a => a -> String
show HashMap (Located LHName) (Measure ty ())
cm String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\nimeas:\t " String -> ShowS
forall a. [a] -> [a] -> [a]
++ [Measure ty ctor] -> String
forall a. Show a => a -> String
show [Measure ty ctor]
im String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
"\n"
instance Eq ctor => Semigroup (MSpec ty ctor) where
MSpec HashMap LHName [Def ty ctor]
c1 HashMap (Located LHName) (Measure ty ctor)
m1 HashMap (Located LHName) (Measure ty ())
cm1 [Measure ty ctor]
im1 <> :: MSpec ty ctor -> MSpec ty ctor -> MSpec ty ctor
<> MSpec HashMap LHName [Def ty ctor]
c2 HashMap (Located LHName) (Measure ty ctor)
m2 HashMap (Located LHName) (Measure ty ())
cm2 [Measure ty ctor]
im2
| (Located LHName
k1, Located LHName
k2) : [(Located LHName, Located LHName)]
_ <- [(Located LHName, Located LHName)]
dups
= UserError -> MSpec ty ctor
forall a. UserError -> a
uError (UserError -> MSpec ty ctor) -> UserError -> MSpec ty ctor
forall a b. (a -> b) -> a -> b
$ Located LHName -> Located LHName -> UserError
forall {a} {t}. PPrint a => Located a -> Located a -> TError t
err Located LHName
k1 Located LHName
k2
| Bool
otherwise
= HashMap LHName [Def ty ctor]
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ())
-> [Measure ty ctor]
-> MSpec ty ctor
forall ty ctor.
HashMap LHName [Def ty ctor]
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ())
-> [Measure ty ctor]
-> MSpec ty ctor
MSpec (([Def ty ctor] -> [Def ty ctor] -> [Def ty ctor])
-> HashMap LHName [Def ty ctor]
-> HashMap LHName [Def ty ctor]
-> HashMap LHName [Def ty ctor]
forall k v.
Eq k =>
(v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
M.unionWith [Def ty ctor] -> [Def ty ctor] -> [Def ty ctor]
forall a. [a] -> [a] -> [a]
(++) HashMap LHName [Def ty ctor]
c1 HashMap LHName [Def ty ctor]
c2) (HashMap (Located LHName) (Measure ty ctor)
m1 HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ctor)
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
`M.union` HashMap (Located LHName) (Measure ty ctor)
m2) (HashMap (Located LHName) (Measure ty ())
cm1 HashMap (Located LHName) (Measure ty ())
-> HashMap (Located LHName) (Measure ty ())
-> HashMap (Located LHName) (Measure ty ())
forall k v. Eq k => HashMap k v -> HashMap k v -> HashMap k v
`M.union` HashMap (Located LHName) (Measure ty ())
cm2) ([Measure ty ctor]
im1 [Measure ty ctor] -> [Measure ty ctor] -> [Measure ty ctor]
forall a. [a] -> [a] -> [a]
++ [Measure ty ctor]
im2)
where
dups :: [(Located LHName, Located LHName)]
dups = [(Located LHName
k1, Located LHName
k2) | Located LHName
k1 <- HashMap (Located LHName) (Measure ty ctor) -> [Located LHName]
forall k v. HashMap k v -> [k]
M.keys HashMap (Located LHName) (Measure ty ctor)
m1 , Located LHName
k2 <- HashMap (Located LHName) (Measure ty ctor) -> [Located LHName]
forall k v. HashMap k v -> [k]
M.keys HashMap (Located LHName) (Measure ty ctor)
m2, Located LHName -> LHName
forall a. Located a -> a
F.val Located LHName
k1 LHName -> LHName -> Bool
forall a. Eq a => a -> a -> Bool
== Located LHName -> LHName
forall a. Located a -> a
F.val Located LHName
k2, Located LHName -> SourcePos
forall a. Located a -> SourcePos
F.loc Located LHName
k1 SourcePos -> SourcePos -> Bool
forall a. Eq a => a -> a -> Bool
/= Located LHName -> SourcePos
forall a. Located a -> SourcePos
F.loc Located LHName
k2]
err :: Located a -> Located a -> TError t
err Located a
k1 Located a
k2 = SrcSpan -> Doc -> [SrcSpan] -> TError t
forall t. SrcSpan -> Doc -> [SrcSpan] -> TError t
ErrDupMeas (Located a -> SrcSpan
forall a. Loc a => a -> SrcSpan
fSrcSpan Located a
k1) (a -> Doc
forall a. PPrint a => a -> Doc
F.pprint (Located a -> a
forall a. Located a -> a
F.val Located a
k1)) (Located a -> SrcSpan
forall a. Loc a => a -> SrcSpan
fSrcSpan (Located a -> SrcSpan) -> [Located a] -> [SrcSpan]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Located a
k1, Located a
k2])
instance Eq ctor => Monoid (MSpec ty ctor) where
mempty :: MSpec ty ctor
mempty = HashMap LHName [Def ty ctor]
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ())
-> [Measure ty ctor]
-> MSpec ty ctor
forall ty ctor.
HashMap LHName [Def ty ctor]
-> HashMap (Located LHName) (Measure ty ctor)
-> HashMap (Located LHName) (Measure ty ())
-> [Measure ty ctor]
-> MSpec ty ctor
MSpec HashMap LHName [Def ty ctor]
forall k v. HashMap k v
M.empty HashMap (Located LHName) (Measure ty ctor)
forall k v. HashMap k v
M.empty HashMap (Located LHName) (Measure ty ())
forall k v. HashMap k v
M.empty []
mappend :: MSpec ty ctor -> MSpec ty ctor -> MSpec ty ctor
mappend = MSpec ty ctor -> MSpec ty ctor -> MSpec ty ctor
forall a. Semigroup a => a -> a -> a
(<>)