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

Created isLabel and HasLabel classes #643

Merged
merged 3 commits into from
Jun 14, 2018
Merged

Conversation

niazim3
Copy link
Collaborator

@niazim3 niazim3 commented Jun 13, 2018

This is for issue #629.

In this PR, the classes IsLabel and HasLabel are created, addressing the isLabel section under in #567.

@JacquesCarette @szymczdm Is it not desirable to have classes defined anywhere other than the Classes.hs file? I had to move the definitions into the Label.hs file due to cyclic imports (i.e. data type Label needs a UID, which means Label is an instance of HasUID, which needs to be imported from Classes.hs; this meant that defining the new classes in Classes.hs wouldn't work because in order to lens to a Label, the data type Label needs to be recognized in that file (i.e. Label.hs needs to be imported into Classes.hs)).

@niazim3 niazim3 self-assigned this Jun 13, 2018
@@ -0,0 +1,21 @@
module Language.Drasil.LabelHelpers (Label) where
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Open to naming suggestions for this file.

@JacquesCarette
Copy link
Owner

The convention that I have used is to create Language.Drasil.Label.Core that defines the types and requires minimal imports. Then Language.Drasil.Label can re-export that, as well as various utilities.

i.e. your Label would become Label.Core and your LabelHelper, Label.

@niazim3
Copy link
Collaborator Author

niazim3 commented Jun 14, 2018

This PR is ready for merge.

@JacquesCarette JacquesCarette merged commit be8ed14 into master Jun 14, 2018
@JacquesCarette JacquesCarette deleted the workingOnIsLabel branch June 14, 2018 20:57
samm82 pushed a commit that referenced this pull request Jun 22, 2018
* created isLabel and HasLabel classes

* moved newly created classes to Classes file; created new file to avoid cyclic imports

* Renamed some files as suggested
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.

2 participants