Advertisement
Guest User

Untitled

a guest
May 23rd, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data EType = EInt | EReal | ECVec | ERVec | EMat | EArray Nat EType
  2.  
  3. data UExprF :: EType -> Type where
  4.   DeclareE :: StanType t -> IndexVec t -> UExprF t
  5.   NamedE :: Text -> SType t -> UExprF t
  6.   IntE :: Int -> UExprF EInt
  7.   RealE :: Double -> UExprF EReal
  8.   BinaryOpE :: SBinaryOp op -> UExprF ta -> UExprF tb -> UExprF (BinaryResultT op ta tb)
  9.   SliceE :: SNat n -> UExprF EInt -> UExprF t -> UExprF (Sliced n t)
  10.   NamedIndexE :: SME.IndexKey -> UExprF EInt
  11.  
  12. -- recursive version?? But not of kind (Type -> Type) -> Type -> Type ...
  13. data UExprF1 :: (EType -> Type) -> EType -> Type where
  14.   DeclareE :: StanType t -> IndexVec r t -> UExprF r t
  15.   NamedE :: Text -> SType t -> UExprF r t
  16.   IntE :: Int -> UExprF r EInt
  17.   RealE :: Double -> UExprF r EReal
  18.   BinaryOpE :: SBinaryOp op -> r ta -> r tb -> UExprF r (BinaryResultT op ta tb)
  19.   SliceE :: SNat n -> r EInt -> r t -> UExprF r (Sliced n t)
  20.   NamedIndexE :: SME.IndexKey -> UExprF r EInt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement