mirror of
https://github.com/anoma/juvix.git
synced 2025-01-06 06:53:33 +03:00
[concrete] optional universe level in parser and pretty printer
This commit is contained in:
parent
4155898883
commit
4d77d8f696
@ -624,7 +624,9 @@ deriving stock instance
|
||||
-- Universe expression
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
newtype Universe = Universe Natural
|
||||
newtype Universe = Universe {
|
||||
universeLevel :: Maybe Natural
|
||||
}
|
||||
deriving stock (Show, Eq, Ord, Lift)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -181,11 +181,10 @@ letBlock = do
|
||||
-- Universe expression
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
defaultUniverse :: Universe
|
||||
defaultUniverse = Universe 0
|
||||
|
||||
universe :: MonadParsec e Text m => m Universe
|
||||
universe = defaultUniverse <$ kwType
|
||||
universe = do
|
||||
kwType
|
||||
Universe <$> optional decimal
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Type signature declaration
|
||||
|
@ -309,7 +309,7 @@ ppFunction Function {..} = do
|
||||
return $ parens (paramName' <+> ppUsage paramUsage <+> paramType')
|
||||
|
||||
ppUniverse :: Members '[Reader Options] r => Universe -> Sem r (Doc Ann)
|
||||
ppUniverse (Universe n) = return $ kwType <+> pretty n
|
||||
ppUniverse (Universe n) = return $ kwType <+?> (pretty <$> n)
|
||||
|
||||
ppLetBlock :: forall r. Members '[Reader Options] r => LetBlock 'Scoped -> Sem r (Doc Ann)
|
||||
ppLetBlock LetBlock {..} = do
|
||||
|
Loading…
Reference in New Issue
Block a user