Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Clean warnings - #1133

Merged
yaxu merged 7 commits into
devfrom
clean-warnings
Jan 30, 2025
Merged

yaxu merged 7 commits into
devfrom
clean-warnings

Conversation

@yaxu

@yaxu yaxu commented Jan 30, 2025

Copy link
Copy Markdown
Member

No description provided.

@yaxu

yaxu commented Jan 30, 2025

Copy link
Copy Markdown
Member Author

@sss-create Just checking you're not already working on this?

@yaxu
yaxu merged commit 327d995 into dev Jan 30, 2025
@yaxu

yaxu commented Jan 30, 2025

Copy link
Copy Markdown
Member Author

That was easier than I thought!

@yaxu
yaxu deleted the clean-warnings branch January 30, 2025 15:22
@sss-create

sss-create commented Jan 30, 2025 •

Copy link
Copy Markdown
Collaborator

nice! I started working on this in my fork but did not get too far yet. Did you replace the head/tail functions yet? I thought we could maybe use Debug.Trace to message the user in case of empty lists. What is your take on this?

@yaxu

yaxu commented Jan 30, 2025

Copy link
Copy Markdown
Member Author

Hm I'm not seeing any warnings about head/tail functions.. How are you getting them?

@yaxu

yaxu commented Jan 30, 2025

Copy link
Copy Markdown
Member Author

Ah I see them with the latest rather than the recommended ghc, along with some other new warnings. I don't have any strong opinions about head/tail really.

@sss-create

Copy link
Copy Markdown
Collaborator

head/tail warnings are annoying imo. However a strategy to get rid of them is needed. On one hand, the exception head and tail may throw are good to inform the user about a mistake when e.g. passing an empty list. OTOH, it's a scary error message. Same goes for '!!'.

So we'd have to decide what we want to replace head/tail with:
Data.uncons, pattern matching, listToMaybe, NonEmpty or whatever.

@yaxu

yaxu commented Feb 1, 2025

Copy link
Copy Markdown
Member Author

I think tail can probably be replaced with drop 1 in most/all cases. Maybe we don't need to warn the user. There might be some cases where it could be useful but it might result in spamming the console if it's triggered each time a pattern is queried.

@sss-create

Copy link
Copy Markdown
Collaborator

I'm undecided but I'd be in favor of removing head/tail from the code base since Tidal's install procedure exposes the user to GHC's warnings. No warning/exception when evaluating a pattern could be irritating though.
do i use the apostrophs correctly? ๐Ÿ‘€

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants