ssm-lang / Scoria

This is an embedding of the Sparse Synchronous Model, in Haskell!
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Rebase common ident runtime refactor #56

Closed Rewbert closed 3 years ago

Rewbert commented 3 years ago

Same as PR #52, but I've rebased it off runtime-refactor, and now open the PR towards that branch instead.

j-hui commented 3 years ago

Btw, just a thought: what do you think of defining Ident a record? i.e.,

data Ident = Ident { identName :: String, identSrcInfo :: SrcInformation }

We get the identName getter for free, and we get to pattern match within the record.

Not a suggestions strictly limited to this PR, but just as a possible code pattern we can adopt for aggregate data structures within this codebase.

Rewbert commented 3 years ago

No objections! The only thing I really dislike about records is that they populate the global namespace. It's not a big issue but that's why I usually opt for these simpler types if I only have a low number of fields.

That said, I am not against making this change. As I don't rely on patternmatches anywhere (I think!) The change should be extremely simple :)

Rewbert commented 3 years ago

Btw, just a thought: what do you think of defining Ident a record? i.e.,

data Ident = Ident { identName :: String, identSrcInfo :: SrcInformation }

We get the identName getter for free, and we get to pattern match within the record.

Not a suggestions strictly limited to this PR, but just as a possible code pattern we can adopt for aggregate data structures within this codebase.

Fix by 72e8b01 .