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

Change the definition of Df to use Maybe instead of Data. #87

Open
t-wallet opened this issue Jul 17, 2024 · 0 comments · May be fixed by #89
Open

Change the definition of Df to use Maybe instead of Data. #87

t-wallet opened this issue Jul 17, 2024 · 0 comments · May be fixed by #89

Comments

@t-wallet
Copy link
Collaborator

t-wallet commented Jul 17, 2024

Currently, Df uses its own type Data, which is isomorphic to Maybe. This is very inconvenient, because we need convert between these types via Df.dataToMaybe and Df.maybeToData every time we need a function that specifically works on Maybe.

The original motivation for this design choice was that Maybe is lazy, but that does not seem to be a problem anymore. Moreover, other protocols such as Axi4Stream and PacketStream also use Maybe to indicate validity.

We can also use https://hackage.haskell.org/package/strict-0.5.1/docs/Data-Strict-Maybe.html, but that does require an extra dependency.

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 a pull request may close this issue.

1 participant