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

createLeft function is broken #4

Closed
Altai-man opened this issue Mar 26, 2017 · 3 comments
Closed

createLeft function is broken #4

Altai-man opened this issue Mar 26, 2017 · 3 comments

Comments

@Altai-man
Copy link

Thanks for your work.

Latest commit, built with stack-local ghc-8:

*Data.Sext.TH Data.Sext Data.Sext.Class Data.Sext.TH> Data.Sext.createRight ' ' "string" :: Sext 10 String
"    string"
*Data.Sext.TH Data.Sext Data.Sext.Class Data.Sext.TH> Data.Sext.createRight ' ' "string" :: Sext 1 String
"g"

createRight is okay, but createLeft gives me:

*Data.Sext.TH Data.Sext Data.Sext.Class Data.Sext.TH> Data.Sext.createLeft ' ' "string" :: Sext 1 String
"string"
*Data.Sext.TH Data.Sext Data.Sext.Class Data.Sext.TH> Data.Sext.createLeft ' ' "string" :: Sext 100 String
"string"
*Data.Sext.TH Data.Sext Data.Sext.Class Data.Sext.TH> 

It seems that the last call to C.take (C.length s) in the implementation is incorrect, since it just returns an origin string.

The correct implementation needs to use C.take t to be valid.

dzhus added a commit that referenced this issue Mar 26, 2017
Reported by Altai-Man in #4
dzhus added a commit that referenced this issue Mar 26, 2017
Reported by Altai-Man in #4
dzhus added a commit that referenced this issue Mar 26, 2017
Reported by Altai-Man in #4
dzhus added a commit that referenced this issue Mar 26, 2017
Reported by Altai-Man in #4
dzhus added a commit that referenced this issue Mar 26, 2017
Reported by Altai-Man in #4
@dzhus
Copy link
Owner

dzhus commented Mar 26, 2017

Hello, thank you for reporting the bug - this is really embarassing. Should be fixed in sext-0.1.3.

@Altai-man
Copy link
Author

Don't worry! The issue was found when I played with liquidhaskell and your package for an university paper, so I am glad to help here.
I hope it is okay to mention your library in my course paper.

The issue is resolved, hence closed.

@dzhus
Copy link
Owner

dzhus commented Mar 27, 2017

Of course. Best of luck.

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

2 participants