{-# OPTIONS_GHC -fno-warn-orphans #-}

module Agda.TypeChecking.Serialise.Instances.Highlighting where

import qualified Data.Map.Strict as Map
import Data.Strict.Tuple (Pair(..))

import qualified Agda.Interaction.Highlighting.Range   as HR
import qualified Agda.Interaction.Highlighting.Precise as HP
import qualified Agda.Utils.RangeMap                   as RM

import Agda.TypeChecking.Serialise.Base
import Agda.TypeChecking.Serialise.Instances.Common () --instance only

instance EmbPrj HR.Range where
  icod_ :: Range -> S Int32
icod_ (HR.Range Int
a Int
b) = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' Int -> Int -> Range
HR.Range Int
a Int
b

  value :: Int32 -> R Range
value = forall t.
(VALU t (IsBase t), All EmbPrj (CoDomain t : Domains t)) =>
t -> Int32 -> R (CoDomain t)
valueN Int -> Int -> Range
HR.Range

instance EmbPrj HP.NameKind where
  icod_ :: NameKind -> S Int32
icod_ NameKind
HP.Bound           = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' NameKind
HP.Bound
  icod_ (HP.Constructor Induction
a) = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
1 Induction -> NameKind
HP.Constructor Induction
a
  icod_ NameKind
HP.Datatype        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
2 ()
  icod_ NameKind
HP.Field           = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
3 ()
  icod_ NameKind
HP.Function        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
4 ()
  icod_ NameKind
HP.Module          = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
5 ()
  icod_ NameKind
HP.Postulate       = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
6 ()
  icod_ NameKind
HP.Primitive       = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
7 ()
  icod_ NameKind
HP.Record          = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
8 ()
  icod_ NameKind
HP.Argument        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
9 ()
  icod_ NameKind
HP.Macro           = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
10 ()
  icod_ NameKind
HP.Generalizable   = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
11 ()

  value :: Int32 -> R NameKind
value = forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
vcase Node -> R NameKind
valu where
    valu :: Node
-> Arrows
     (Constant Int32 (Domains NameKind)) (R (CoDomain NameKind))
valu []      = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Bound
    valu [Int32
1 , Int32
a] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Induction -> NameKind
HP.Constructor Int32
a
    valu [Int32
2]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Datatype
    valu [Int32
3]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Field
    valu [Int32
4]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Function
    valu [Int32
5]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Module
    valu [Int32
6]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Postulate
    valu [Int32
7]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Primitive
    valu [Int32
8]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Record
    valu [Int32
9]     = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Argument
    valu [Int32
10]    = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Macro
    valu [Int32
11]    = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN NameKind
HP.Generalizable
    valu Node
_       = forall a. R a
malformed

instance EmbPrj HP.Aspect where
  icod_ :: Aspect -> S Int32
icod_ Aspect
HP.Comment        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
0 ()
  icod_ Aspect
HP.Keyword       = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
1 ()
  icod_ Aspect
HP.String        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
2 ()
  icod_ Aspect
HP.Number        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
3 ()
  icod_ Aspect
HP.Symbol        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' Aspect
HP.Symbol
  icod_ Aspect
HP.PrimitiveType = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
4 ()
  icod_ (HP.Name Maybe NameKind
mk Bool
b)   = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
5 Maybe NameKind -> Bool -> Aspect
HP.Name Maybe NameKind
mk Bool
b
  icod_ Aspect
HP.Pragma        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
6 ()
  icod_ Aspect
HP.Background    = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
7 ()
  icod_ Aspect
HP.Markup        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
8 ()
  icod_ Aspect
HP.Hole          = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
9 ()

  value :: Int32 -> R Aspect
value = forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
vcase Node -> R Aspect
valu where
    valu :: Node
-> Arrows (Constant Int32 (Domains Aspect)) (R (CoDomain Aspect))
valu [Int32
0]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Comment
    valu [Int32
1]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Keyword
    valu [Int32
2]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.String
    valu [Int32
3]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Number
    valu []         = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Symbol
    valu [Int32
4]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.PrimitiveType
    valu [Int32
5, Int32
mk, Int32
b] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Maybe NameKind -> Bool -> Aspect
HP.Name Int32
mk Int32
b
    valu [Int32
6]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Pragma
    valu [Int32
7]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Background
    valu [Int32
8]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Markup
    valu [Int32
9]        = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN Aspect
HP.Hole
    valu Node
_          = forall a. R a
malformed

instance EmbPrj HP.OtherAspect where
  icod_ :: OtherAspect -> S Int32
icod_ OtherAspect
HP.Error                = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
0 ()
  icod_ OtherAspect
HP.ErrorWarning         = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
1 ()
  icod_ OtherAspect
HP.DottedPattern        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' OtherAspect
HP.DottedPattern
  icod_ OtherAspect
HP.UnsolvedMeta         = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
2 ()
  icod_ OtherAspect
HP.TerminationProblem   = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
3 ()
  icod_ OtherAspect
HP.IncompletePattern    = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
4 ()
  icod_ OtherAspect
HP.TypeChecks           = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
5 ()
  icod_ OtherAspect
HP.UnsolvedConstraint   = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
6 ()
  icod_ OtherAspect
HP.PositivityProblem    = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
7 ()
  icod_ OtherAspect
HP.Deadcode             = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
8 ()
  icod_ OtherAspect
HP.CoverageProblem      = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
9 ()
  icod_ OtherAspect
HP.CatchallClause       = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
10 ()
  icod_ OtherAspect
HP.ConfluenceProblem    = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
11 ()
  icod_ OtherAspect
HP.MissingDefinition    = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
12 ()
  icod_ OtherAspect
HP.ShadowingInTelescope = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
13 ()

  value :: Int32 -> R OtherAspect
value = forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
vcase forall {a}. (Eq a, Num a) => [a] -> R OtherAspect
valu where
    valu :: [a]
-> Arrows
     (Constant Int32 (Domains OtherAspect)) (R (CoDomain OtherAspect))
valu [a
0] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.Error
    valu [a
1] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.ErrorWarning
    valu []  = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.DottedPattern
    valu [a
2] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.UnsolvedMeta
    valu [a
3] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.TerminationProblem
    valu [a
4] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.IncompletePattern
    valu [a
5] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.TypeChecks
    valu [a
6] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.UnsolvedConstraint
    valu [a
7] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.PositivityProblem
    valu [a
8] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.Deadcode
    valu [a
9] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.CoverageProblem
    valu [a
10] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.CatchallClause
    valu [a
11] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.ConfluenceProblem
    valu [a
12] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.MissingDefinition
    valu [a
13] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN OtherAspect
HP.ShadowingInTelescope
    valu [a]
_   = forall a. R a
malformed

instance EmbPrj HP.Aspects where
  icod_ :: Aspects -> S Int32
icod_ (HP.Aspects Maybe Aspect
a Set OtherAspect
b String
c Maybe DefinitionSite
d TokenBased
e) = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' Maybe Aspect
-> Set OtherAspect
-> String
-> Maybe DefinitionSite
-> TokenBased
-> Aspects
HP.Aspects Maybe Aspect
a Set OtherAspect
b String
c Maybe DefinitionSite
d TokenBased
e

  value :: Int32 -> R Aspects
value = forall t.
(VALU t (IsBase t), All EmbPrj (CoDomain t : Domains t)) =>
t -> Int32 -> R (CoDomain t)
valueN Maybe Aspect
-> Set OtherAspect
-> String
-> Maybe DefinitionSite
-> TokenBased
-> Aspects
HP.Aspects

instance EmbPrj HP.DefinitionSite where
  icod_ :: DefinitionSite -> S Int32
icod_ (HP.DefinitionSite TopLevelModuleName
a Int
b Bool
c Maybe String
d) = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' TopLevelModuleName -> Int -> Bool -> Maybe String -> DefinitionSite
HP.DefinitionSite TopLevelModuleName
a Int
b Bool
c Maybe String
d

  value :: Int32 -> R DefinitionSite
value = forall t.
(VALU t (IsBase t), All EmbPrj (CoDomain t : Domains t)) =>
t -> Int32 -> R (CoDomain t)
valueN TopLevelModuleName -> Int -> Bool -> Maybe String -> DefinitionSite
HP.DefinitionSite

instance EmbPrj a => EmbPrj (RM.RangeMap a) where
  -- Write the RangeMap as flat list rather than a list of (Int, (Int, x)). Much
  -- like Map, we need to call `convert' in the tail position and so the output
  -- list is written (and read) in reverse order.
  icod_ :: RangeMap a -> S Int32
icod_ (RM.RangeMap Map Int (PairInt a)
f) = Node -> S Int32
icodeNode forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< forall {a} {a}.
(EmbPrj a, EmbPrj a) =>
Node -> [(a, PairInt a)] -> ReaderT Dict IO Node
convert [] (forall k a. Map k a -> [(k, a)]
Map.toAscList Map Int (PairInt a)
f) where
    convert :: Node -> [(a, PairInt a)] -> ReaderT Dict IO Node
convert Node
ys [] = forall (m :: * -> *) a. Monad m => a -> m a
return Node
ys
    convert Node
ys ((a
start, RM.PairInt (Int
end :!: a
entry)):[(a, PairInt a)]
xs) = do
      Int32
start <- forall a. EmbPrj a => a -> S Int32
icode a
start
      Int32
end <- forall a. EmbPrj a => a -> S Int32
icode Int
end
      Int32
entry <- forall a. EmbPrj a => a -> S Int32
icode a
entry
      Node -> [(a, PairInt a)] -> ReaderT Dict IO Node
convert (Int32
startforall a. a -> [a] -> [a]
:Int32
endforall a. a -> [a] -> [a]
:Int32
entryforall a. a -> [a] -> [a]
:Node
ys) [(a, PairInt a)]
xs

  value :: Int32 -> R (RangeMap a)
value = forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
vcase (forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall a. Map Int (PairInt a) -> RangeMap a
RM.RangeMap forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. [(k, a)] -> Map k a
Map.fromDistinctAscList) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall {a} {a}.
(EmbPrj a, EmbPrj a) =>
[(a, PairInt a)]
-> Node -> ExceptT TypeError (StateT St IO) [(a, PairInt a)]
convert []) where
    convert :: [(a, PairInt a)]
-> Node -> ExceptT TypeError (StateT St IO) [(a, PairInt a)]
convert [(a, PairInt a)]
ys [] = forall (m :: * -> *) a. Monad m => a -> m a
return [(a, PairInt a)]
ys
    convert [(a, PairInt a)]
ys (Int32
start:Int32
end:Int32
entry:Node
xs) = do
      a
start <- forall a. EmbPrj a => Int32 -> R a
value Int32
start
      Int
end <- forall a. EmbPrj a => Int32 -> R a
value Int32
end
      a
entry <- forall a. EmbPrj a => Int32 -> R a
value Int32
entry
      [(a, PairInt a)]
-> Node -> ExceptT TypeError (StateT St IO) [(a, PairInt a)]
convert ((a
start, forall a. Pair Int a -> PairInt a
RM.PairInt (Int
end forall a b. a -> b -> Pair a b
:!: a
entry))forall a. a -> [a] -> [a]
:[(a, PairInt a)]
ys) Node
xs
    convert [(a, PairInt a)]
_ Node
_ = forall a. R a
malformed

instance EmbPrj HP.TokenBased where
  icod_ :: TokenBased -> S Int32
icod_ TokenBased
HP.TokenBased        = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
Int32 -> t -> Arrows (Domains t) (S Int32)
icodeN Int32
0 ()
  icod_ TokenBased
HP.NotOnlyTokenBased = forall t.
(ICODE t (IsBase t), Currying (Domains t) (S Int32),
 All EmbPrj (Domains t)) =>
t -> Arrows (Domains t) (S Int32)
icodeN' TokenBased
HP.NotOnlyTokenBased

  value :: Int32 -> R TokenBased
value = forall a. EmbPrj a => (Node -> R a) -> Int32 -> R a
vcase forall {a}. (Eq a, Num a) => [a] -> R TokenBased
valu where
    valu :: [a]
-> Arrows
     (Constant Int32 (Domains TokenBased)) (R (CoDomain TokenBased))
valu [a
0] = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN TokenBased
HP.TokenBased
    valu []  = forall t.
(VALU t (IsBase t),
 Currying (Constant Int32 (Domains t)) (R (CoDomain t)),
 All EmbPrj (Domains t)) =>
t -> Arrows (Constant Int32 (Domains t)) (R (CoDomain t))
valuN TokenBased
HP.NotOnlyTokenBased
    valu [a]
_   = forall a. R a
malformed