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

Making Glassbr compatible with Strict Data #3818

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/drasil-build/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ghc-options:
- -Wall
- -Wredundant-constraints

default-extensions:
- StrictData

library:
source-dirs: lib
exposed-modules:
Expand Down
3 changes: 3 additions & 0 deletions code/drasil-code/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ghc-options:
- -Wall
- -Wredundant-constraints

default-extensions:
- StrictData

library:
source-dirs: lib
exposed-modules:
Expand Down
3 changes: 3 additions & 0 deletions code/drasil-codeLang/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ ghc-options:
- -Wall
- -Wredundant-constraints

default-extensions:
- StrictData

library:
source-dirs: lib
exposed-modules:
Expand Down
3 changes: 3 additions & 0 deletions code/drasil-data/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ghc-options:
- -Wall
- -Wredundant-constraints

default-extensions:
- StrictData

library:
source-dirs: lib
exposed-modules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ standOffDist = uq (constrained' (uc sD (variable "SD") Real metre)

nomThick = cuc "nomThick"
(nounPhraseSent $ S "nominal thickness" +:+ displayDblConstrntsAsSet
nomThick nominalThicknesses)
(mkQuant "nomThick" (nounPhraseSent $ S "nominal thickness") lT Rational Nothing Nothing) nominalThicknesses)
Copy link
Collaborator

@balacij balacij Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this added here, I would imagine it should be removed from somewhere else, no? Does this result in code duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you are referring to, could you be more specific?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the underlying question is "is this information written anywhere else in our code base"?

A similar thought I had: the duplication of S "nominal thickness" and the use of the Nothings seems to suggest that this chunk could be built with a different constructor than cuc that builds it more "logically", but I'm not sure what other constructors are available.…

Copy link
Collaborator

@samm82 samm82 Jun 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean by this is that we are duplicating the arguments "nomThick", nounPhraseSent $ S "nominal thickness" +:+ x, lT, and Rational, which seems redundant. Are these defined anywhere else in the code that we could borrow from instead of redefining it (there may not be)? Looking at the constructors for ConstrainedChunk, it looks like they all require some "base" "chunk" to build off of (which is one argument for moving away from our "nested" infrastructure), so we might be stuck using cuc.

While investigating this, I noticed that the reason we have this "circular definition" is because we seem to be attempting to define it in terms of itself, instead of just actually giving it a definition, which prompted a potential agenda item for our next meeting. 👀

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this "smells bad". Feels like the wrong constructor is being used.

lT millimetre {-Discrete nominalThicknesses, but not implemented-} Rational
[{- TODO: add back constraint: enumc nominalThicknesses -}] $ exactDbl 8

Expand Down
3 changes: 3 additions & 0 deletions code/drasil-example/glassbr/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ dependencies:
- drasil-theory
- drasil-utils

default-extensions:
- StrictData

library:
source-dirs: lib
when:
Expand Down