mirror of
https://github.com/anoma/juvix.git
synced 2024-07-14 19:30:34 +03:00
fix rebase
This commit is contained in:
parent
bfd9e15024
commit
19ad4e9730
@ -58,12 +58,12 @@ type family FieldArgIxType s = res | res -> s where
|
||||
FieldArgIxType 'Parsed = ()
|
||||
FieldArgIxType 'Scoped = Int
|
||||
|
||||
type SideIfBranchConditionType :: Stage -> IfBranchKind -> GHC.Type
|
||||
type SideIfBranchConditionType :: Stage -> IfBranchKind -> GHCType
|
||||
type family SideIfBranchConditionType s k = res where
|
||||
SideIfBranchConditionType s 'BranchIfBool = ExpressionType s
|
||||
SideIfBranchConditionType _ 'BranchIfElse = ()
|
||||
|
||||
type IfBranchConditionType :: Stage -> IfBranchKind -> GHC.Type
|
||||
type IfBranchConditionType :: Stage -> IfBranchKind -> GHCType
|
||||
type family IfBranchConditionType s k = res where
|
||||
IfBranchConditionType s 'BranchIfBool = ExpressionType s
|
||||
IfBranchConditionType _ 'BranchIfElse = Irrelevant KeywordRef
|
||||
|
@ -104,41 +104,29 @@ instance HasExpressions Pattern where
|
||||
PatternConstructorApp a -> PatternConstructorApp <$> directExpressions f a
|
||||
PatternWildcardConstructor {} -> pure p
|
||||
|
||||
leafExpressions f p = case p of
|
||||
PatternVariable {} -> pure p
|
||||
PatternConstructorApp a -> PatternConstructorApp <$> leafExpressions f a
|
||||
PatternWildcardConstructor {} -> pure p
|
||||
|
||||
instance HasExpressions SideIfBranch where
|
||||
leafExpressions f b = do
|
||||
_sideIfBranchCondition <- leafExpressions f (b ^. sideIfBranchCondition)
|
||||
_sideIfBranchBody <- leafExpressions f (b ^. sideIfBranchBody)
|
||||
directExpressions f b = do
|
||||
_sideIfBranchCondition <- directExpressions f (b ^. sideIfBranchCondition)
|
||||
_sideIfBranchBody <- directExpressions f (b ^. sideIfBranchBody)
|
||||
pure SideIfBranch {..}
|
||||
|
||||
instance HasExpressions SideIfs where
|
||||
leafExpressions f b = do
|
||||
_sideIfBranches <- traverse (leafExpressions f) (b ^. sideIfBranches)
|
||||
_sideIfElse <- traverse (leafExpressions f) (b ^. sideIfElse)
|
||||
directExpressions f b = do
|
||||
_sideIfBranches <- directExpressions f (b ^. sideIfBranches)
|
||||
_sideIfElse <- directExpressions f (b ^. sideIfElse)
|
||||
pure SideIfs {..}
|
||||
|
||||
instance HasExpressions CaseBranchRhs where
|
||||
leafExpressions f = \case
|
||||
CaseBranchRhsExpression e -> CaseBranchRhsExpression <$> leafExpressions f e
|
||||
CaseBranchRhsIf e -> CaseBranchRhsIf <$> leafExpressions f e
|
||||
directExpressions f = \case
|
||||
CaseBranchRhsExpression e -> CaseBranchRhsExpression <$> directExpressions f e
|
||||
CaseBranchRhsIf e -> CaseBranchRhsIf <$> directExpressions f e
|
||||
|
||||
instance HasExpressions CaseBranch where
|
||||
directExpressions f b = do
|
||||
_caseBranchPattern <- directExpressions f (b ^. caseBranchPattern)
|
||||
_caseBranchExpression <- directExpressions f (b ^. caseBranchExpression)
|
||||
_caseBranchRhs <- directExpressions f (b ^. caseBranchRhs)
|
||||
pure CaseBranch {..}
|
||||
|
||||
leafExpressions f b = do
|
||||
_caseBranchPattern <- leafExpressions f (b ^. caseBranchPattern)
|
||||
_caseBranchRhs <- leafExpressions f (b ^. caseBranchRhs)
|
||||
pure CaseBranch {..}
|
||||
|
||||
instance RecHasExpressions Case
|
||||
|
||||
instance HasExpressions Case where
|
||||
directExpressions f l = do
|
||||
_caseBranches <- directExpressions f (l ^. caseBranches)
|
||||
|
Loading…
Reference in New Issue
Block a user