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

Investigate IsList instance #16

Open
ilyakooo0 opened this issue May 31, 2020 · 2 comments
Open

Investigate IsList instance #16

ilyakooo0 opened this issue May 31, 2020 · 2 comments

Comments

@ilyakooo0
Copy link
Contributor

ilyakooo0 commented May 31, 2020

I think it might be possible to define an IsList instance for matrices.

@bolt12
Copy link
Owner

bolt12 commented May 31, 2020 via email

@leftaroundabout
Copy link

leftaroundabout commented Sep 1, 2020

The problem with an IsList instance is that it would have to generate either a runtime error or even worse unexpected behaviour when supplying a list of wrong length. There is some discussion in a GHC issue concerning proper vector literals. I suggested adding the possibility to constrain the allowed length for IsList instances, which would make it suitable also for this library.

class IsList l where
  type Item l
  type AllowedLength l (n :: Nat) :: Constraint

and am thinking about submitting this as a GHC proposal.

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