From cef70019330bb482a1418c026c57045ed731d51b Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 10 Oct 2024 18:43:13 -0600 Subject: Change Witness to be a GADT. This makes is much simpler to represent. Surprised I missed this ability. --- src/Language/Fiddle/Parser.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Language/Fiddle/Parser.hs') diff --git a/src/Language/Fiddle/Parser.hs b/src/Language/Fiddle/Parser.hs index ef40cc9..b3eed63 100644 --- a/src/Language/Fiddle/Parser.hs +++ b/src/Language/Fiddle/Parser.hs @@ -140,7 +140,7 @@ fiddleDeclP = do PackageDecl (pure ()) <$> name <*> defer body packageBodyP - KWUsing -> UsingDecl (Witness ()) <$> name + KWUsing -> UsingDecl Witness <$> name KWLocation -> LocationDecl (pure ()) <$> ident <*> (tok TokEq >> expressionP) KWBits -> BitsDecl (pure ()) <$> ident <*> (tok TokColon >> bitTypeP) KWImport -> ImportDecl <$> importStatementP @@ -182,7 +182,7 @@ objTypeP = do (ReferencedObjType (pure ()) <$> name) <|> ( do t <- bodyTypeP - AnonymousObjType (Witness ()) <$> defer body (objTypeBodyP t) + AnonymousObjType Witness <$> defer body (objTypeBodyP t) ) exprInParenP :: Pa Expression @@ -198,7 +198,7 @@ objTypeDeclP = withMeta $ ( do tok_ KWAssertPos - AssertPosStatement (Witness ()) <$> exprInParenP + AssertPosStatement Witness <$> exprInParenP ) <|> ( do tok_ KWReserved @@ -278,7 +278,7 @@ registerBitsTypeRefP = do baseTypeRef = withMeta $ (RegisterBitsJustBits <$> exprInParenP) - <|> (RegisterBitsAnonymousType (Witness ()) <$> anonymousBitsTypeP) + <|> (RegisterBitsAnonymousType Witness <$> anonymousBitsTypeP) <|> (RegisterBitsReference (pure ()) <$> name) anonymousBitsTypeP :: Pa AnonymousBitsType -- cgit