Skip to content
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

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open

Sean/monomorph #27

wants to merge 63 commits into from

Conversation

klntsky
Copy link
Member

@klntsky klntsky commented Apr 4, 2024

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:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md)
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution or a justification for the absence of tests

gnumonik and others added 30 commits November 28, 2023 19:00
…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
…e expressions, necessary for fully typing the desugared typeclass declarations
…s-wip

Sean/typed core fn.typeclasses wip
…g dictionary types, (sort of) fixed let-generalization, ported over more tests
…inery. (We're now properly *reconstructing* the types)
t4ccer and others added 25 commits March 5, 2024 19:38
Too many of them to fix now
…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
Copy link
Member Author

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)
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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)
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants