Literal -> Lit, LitE -> Lit

This commit is contained in:
crumbtoo
2023-12-18 15:36:17 -07:00
parent 585130cfac
commit 136e3687b0
5 changed files with 12 additions and 12 deletions

View File

@@ -123,7 +123,7 @@ Alter :: { Alter Name }
Alter : litint ParList '->' Expr { Alter (AltData $1) $2 $4 }
Expr1 :: { Expr Name }
Expr1 : litint { LitE $ IntL $1 }
Expr1 : litint { Lit $ IntL $1 }
| Id { Var $1 }
| PackCon { $1 }
| ExprPragma { $1 }

View File

@@ -7,7 +7,7 @@ Description : Core ASTs and the like
module Core.Syntax
( Expr(..)
, Type(..)
, Literal(..)
, Lit(..)
, pattern (:$)
, Binding(..)
, AltCon(..)
@@ -47,7 +47,7 @@ data Expr b = Var Name
| Lam [b] (Expr b)
| Let Rec [Binding b] (Expr b)
| App (Expr b) (Expr b)
| LitE Literal
| Lit Lit
| Type Type
deriving (Show, Read, Lift)
@@ -87,11 +87,11 @@ data Rec = Rec
deriving (Show, Read, Eq, Lift)
data AltCon = AltData Tag
| AltLiteral Literal
| AltLit Lit
| Default
deriving (Show, Read, Eq, Lift)
data Literal = IntL Int
data Lit = IntL Int
deriving (Show, Read, Eq, Lift)
type Name = String

View File

@@ -32,7 +32,7 @@ rhssOf = fromList . fmap f
isAtomic :: Expr b -> Bool
isAtomic (Var _) = True
isAtomic (LitE _) = True
isAtomic (Lit _) = True
isAtomic _ = False
----------------------------------------------------------------------------------