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

Add a trace command #15

Open
OlegAlexander opened this issue Oct 30, 2021 · 3 comments
Open

Add a trace command #15

OlegAlexander opened this issue Oct 30, 2021 · 3 comments

Comments

@OlegAlexander
Copy link

Hello and thank you for creating Husk.

I was wondering if it's not too late to add a trace command--a function that prints x to the console and returns x. For example, let's assume that * is the trace command in the following:

Husk.exe -u w*m↔*w "How is this even possible?"
["How", "is", "this", "even", "possible?"]
["woH", "si", "siht", "neve", "?elbissop"]
woH si siht neve ?elbissop

I think a trace command would make it much easier to debug programs and to learn Husk.

I tried setting debug level to 1 and 2 in Debug.hs, but those options don't do what I want.

It's also possible that the trace command already exists in Husk, but I missed it?

Thank you.

@barbuz
Copy link
Owner

barbuz commented Nov 4, 2021

Hi, thanks for taking interest in Husk!
The trace command is not currently included, due to the focus being on pure functions as much as possible, but a future update with some impure commands is planned.
At the moment the project is on a (way too long) break due to a bunch of things going on in life, but I'll try to come back to it as soon as circumstances allow and implement this and more.

@razetime
Copy link

razetime commented Nov 2, 2023

might be an idea to add this outside the codepage.

@OlegAlexander
Copy link
Author

@razetime that's a great idea. And now that I'm officially learning Haskell, I know that this function is simply traceShowId from Debug.Trace :)

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

No branches or pull requests

3 participants