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

X.L.Magnifier: Expose types #583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

colonelpanic8
Copy link
Contributor

Description

It is important for these types to be exposed to access the underlying LayoutModifier. It is not possible to interact with it without these.

In particular I needed these changes for compatibility with this PR #582

Checklist

  • I've read CONTRIBUTING.md

  • I've considered how to best test these changes (property, unit,
    manually, ...) and concluded: XXX

  • I updated the CHANGES.md file

  • I updated the XMonad.Doc.Extending file (if appropriate)

@liskin
Copy link
Member

liskin commented Aug 6, 2021

Is this useful without the layout inspection bits? Do you have an example?

@colonelpanic8
Copy link
Contributor Author

Yes -- I actually don't see how this would be related to layout inspection at all.

This is needed for use with my conditional layout modifier module. Atm, Magnify only provides functions that return functions Modified Payouts, not the layout modifiers themselves. My conditionallayout modifier needs to interact directly with the layout modifier obejcts so it cannot use these functions.

@liskin
Copy link
Member

liskin commented Aug 8, 2021

Oh, mea culpa, now I see. For some reason I though this is because you wanted to make a condition that looks into Magnifier and completely overlooked the “little” issue that ConditionalLayoutModifier doesn't work with a l a -> ModifiedLayout Magnifier l a. Sorry. 🙇

What about trying to deal with that issue directly instead of exposing internals of every LayoutModifier someone wants to use with the ConditionalLayoutModifier? Should be easy to create a function

conditional    c  ModifiedLayout m l a  ModifiedLayout (ConditionalLayoutModifier m c) l a

so then you just do conditional c $ magnifier $ Tall … ||| ….
Or perhaps

conditional    c  (l a  ModifiedLayout m l a)  (l a  ModifiedLayout (ConditionalLayoutModifier m c) l a)

and then the usage is conditional c magnifier $ Tall … ||| ….

(Also, a random thought for #582 before I get to replying in detail to your other questions: if you implement it as an instance LayoutClass (ConditionalModifiedLayout c m l) a instead of instance LayoutModifier (ConditionalLayoutModifier m c) a, you won't need to implement as many functions and the reasoning may be easier, too. Or not. Just a random thought, really.)

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.

None yet

2 participants