Rlp2Core: simple let binds

This commit is contained in:
crumbtoo
2024-02-09 14:46:50 -07:00
parent 5749c0efd3
commit 2492660da4
5 changed files with 56 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ module Rlp.Syntax
, ConAlt(..)
, Binding(..), Binding'
, _PatB, _FunB
, _VarP, _LitP, _ConP
-- * Trees That Grow boilerplate
@@ -41,6 +42,8 @@ module Rlp.Syntax
, pattern ConT''
-- *** Pat
, pattern VarP'', pattern LitP'', pattern ConP''
-- *** Binding
, pattern PatB''
)
where
----------------------------------------------------------------------------------
@@ -253,6 +256,9 @@ data Binding p = PatB (Pat' p) (RlpExpr' p)
type Binding' p = XRec p (Binding p)
pattern PatB'' :: (UnXRec p) => Pat' p -> RlpExpr' p -> Binding' p
pattern PatB'' p e <- (unXRec -> PatB p e)
deriving instance (Show (XRec p (Pat p)), Show (XRec p (RlpExpr p)), Show (IdP p)
) => Show (Binding p)
@@ -308,6 +314,7 @@ type Lit' p = XRec p (Lit p)
makeLenses ''RlpModule
makePrisms ''Pat
makePrisms ''Binding
--------------------------------------------------------------------------------