-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sean/monomorph #27
base: master
Are you sure you want to change the base?
Sean/monomorph #27
Conversation
…HaP, added basic nix shell with build deps & locale config, placeholder UPLC codegen module & functions. You almost certainly need the hie.yaml and .envrc to work on this so I committed those intentionally.
…n the annotation) + reworked pretty printer to... print prettily
… this as a temporary work branch)
…e expressions, necessary for fully typing the desugared typeclass declarations
…gly CoreFn desugaring code
…s-wip Sean/typed core fn.typeclasses wip
…Unknowns, small tweak to pretty printer
Sean/typed core fn.wip
…instantiatePolyTypes
…g dictionary types, (sort of) fixed let-generalization, ported over more tests
…inery. (We're now properly *reconstructing* the types)
Too many of them to fix now
…ps if we inline, working on recursive)
…le (bugs almost certainly remain)
…worked the IndexedPlated instance to be indexed on a name-context
…r and object desugarer, started working on final translation to PIR
…orking. TONS Of bugs. TONS of errors and undefineds and missing branches and etc.
-- This gives us a way to report the exact location of the error (which may no longer correspond *at all* to | ||
-- the location given in the SourcePos annotations due to inlining and monomorphization) | ||
data TypeConvertError | ||
= TypeConvertError (SourceType -> SourceType ) SourceType String |
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.
Please defunctionalize this
-- idk if we need to specialize the whole group? | ||
Just _ -> Just (Rec xs) | ||
|
||
monomorphizeA :: Context -> Expr Ann -> Monomorphizer (Expr Ann) |
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.
Please use a more descriptive name
<> "\n is not an abstraction or variable" | ||
|
||
-- I *think* all CTors should be translated to functions at this point? | ||
-- TODO: We can make sure the variables are well-scoped too |
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.
What do you mean?
dict <- collectRecBinds initialRecDict ty d targExpr | ||
let renameMap = (\(i,t,_) -> (i,t)) <$> dict | ||
bindingMap = M.elems dict | ||
cxt = foldl' (\acc (idx,tyx)-> M.insert idx tyx acc) d $ (\(a,b,_) -> (a,b)) <$> M.elems dict |
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.
Use flip and uncurry for the folding function
assembleDesugaredObjectLit expr _ [] = pure expr -- TODO better error | ||
assembleDesugaredObjectLit _ _ _ = error "something went wrong in assembleDesugaredObjectLit" | ||
|
||
desugarObjectAccessor :: SourceType -> PSString -> Expr Ann -> Maybe (Expr Ann) |
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.
Could you please add a small illustration in a comment above every function like this? Perhaps containing some semi-real PS code snippet
Description of the change
Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include any other background context that would help reviewers understand the motivation for this PR.
Checklist: