-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pretty-print n => Char
tables as string literals.
#329
Conversation
2340983
to
9ddd1f5
Compare
This needs a rebase now. @dougalm this is going to conflict with your PR. What order should we merge those in? |
9ddd1f5
to
29c6c80
Compare
Make `prettyVal` print `n=>Char` tables as string literals. Add `make update-all` command for updating all test files. Update tests.
2e25404
to
41c0d5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased on dev
after #315 was merged. Tests pass again.
return $ pretty elems <> idxSetStr | ||
atom <- evalBlock mempty $ snd $ applyAbs abs idx | ||
case atom of | ||
Con (Lit (Word8Lit c)) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: #315 removed the pattern CharLit c
, so the replacement is now Con (Lit (Word8Lit c))
.
Could we add a new abbreviated pattern for this, while being future-facing for potential Unicode support? I wonder what would be a good name.
let bodyType = getType body | ||
let elemsDoc = case bodyType of | ||
-- Print table of characters as a string literal. | ||
TC (BaseType (Scalar Word8Type)) -> pretty ('"': concat elems ++ "\"") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: #315 removed the pattern CharType
, so the replacement is now TC (BaseType (Scalar Word8Type))
.
Could we add a new abbreviated pattern for this, while being future-facing for potential Unicode support? I wonder what would be a good name.
Thanks, Dan! |
Make
prettyVal
printn => Char
tables as string literals.Add
make update-all
command for updating all test files. Update tests.Resolves #321.
Depends on #327, which should be reviewed and merged first.
Examples: