oh boy am i going to hate this code in 12 hours

This commit is contained in:
crumbtoo
2024-01-02 06:26:48 -07:00
parent c15f9b6546
commit 6130a91668

View File

@@ -71,7 +71,8 @@ funD = FunD <$> varid <*> many pat1 <*> (symbol "=" *> fmap Const partialExpr)
partialExpr :: Parser PartialExpr'
partialExpr = choice
[ fmap Y $ U <$> varid' <*> lexeme infixOp <*> varid'
[ try $ fmap Y $ U <$> varid' <*> lexeme infixOp <*> fmap unY partialExpr
, fmap Y $ varid'
]
where varid' = E . VarEF <$> varid
@@ -128,6 +129,9 @@ type PartialDecl' = Decl (Const PartialExpr') Name
newtype Y f = Y (f (Y f))
unY :: Y f -> f (Y f)
unY (Y f) = f
instance (Show (f (Y f))) => Show (Y f) where
showsPrec p (Y f) = showsPrec p f