Skip to content

Commit

Permalink
Now working with simple constructor pattern matching (no type
Browse files Browse the repository at this point in the history
annotation) no infix constructors yet.
  • Loading branch information
Montmorency committed Sep 26, 2022
1 parent 1812fab commit e318951
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ihp-hsx/IHP/HSX/HsExpToTH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ toPat :: Pat.Pat GhcPs -> TH.Pat
toPat (Pat.VarPat _ (unLoc -> name)) = TH.VarP (toName name)
toPat (TuplePat _ p _) = TH.TupP (map (toPat . unLoc) p)
toPat (ParPat xP lP) = (toPat . unLoc) lP --error "TH.ParPat not implemented"
toPat (ConPat pat_con_ext pat_con pat_args) = TH.ConP (toName pat_con_ext) (map toType (map hsLPatType (Pat.hsConPatArgs pat_args))) (map (toPat . unLoc) (Pat.hsConPatArgs pat_args)) --error "TH.ConstructorPattern not implemented"
toPat (ConPat pat_con_ext ((unLoc -> name)) pat_args) = TH.ConP (toName name) (map toType []) (map (toPat . unLoc) (Pat.hsConPatArgs pat_args)) --error "TH.ConstructorPattern not implemented"
--toPat (ConPat pat_con_ext pat_con pat_args) = TH.ConP (toName pat_con_ext) (map (toType . unLoc) (hsPatSigType pat_args)) (map (toPat . unLoc) (Pat.hsConPatArgs pat_args)) --error "TH.ConstructorPattern not implemented"
toPat (ViewPat pat_con pat_args pat_con_ext) = error "TH.ViewPattern not implemented"
toPat (SumPat _ _ _ _) = error "TH.SumPat not implemented"
toPat (WildPat _ ) = error "TH.WildPat not implemented"
Expand Down

0 comments on commit e318951

Please sign in to comment.