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

<\> without IO #59

Open
JamieBallingall opened this issue Apr 6, 2018 · 3 comments
Open

<\> without IO #59

JamieBallingall opened this issue Apr 6, 2018 · 3 comments

Comments

@JamieBallingall
Copy link

I was messing around trying to replace HMatrix with this library. I was hoping to see something like:

(<\>) :: MatrixType v -> v -> Maybe v

or

(<\>) :: MatrixType v -> v -> Either String v

which would allow a drop-in replacement. I thought that it was my lack of understanding of the relevant monads so I asked a question on Stack Exchange. Reading past the rather negative tone of the comments, the consensus seems to be that what I want isn't possible without changes to the library.

So I guess I'm asking for one of the following:

  1. Some documentation showing how one can, in fact, suppress IO and get a Maybe
  2. A fix to Use logging-effect for structured logging #20 which a comment on Stack Overflow seems to imply would help
  3. A version of <\> with one of the types above
@ocramz
Copy link
Owner

ocramz commented Apr 6, 2018

Hi @JamieBallingall , thanks for getting in touch. Indeed, I agree that MonadIO constraint is unsightly and unnecessary, however the most appropriate place to discuss these interface design issues is this issue tracker and not stackoverflow. I see you filed the question on March 23 and I was completely unaware of it until now.

In fact the correct constraint on the result monad would be MonadThrow alone, of which Either e and Maybe are instances.

@JamieBallingall
Copy link
Author

I was in the middle of typing a comment about how I'm just getting used to Github and didn't realize that this was an interface question. I guess that is illustrated by the fact that I accidentally closed the issue. Sorry about that.

@ocramz
Copy link
Owner

ocramz commented Apr 6, 2018

No worries! I'll try to address this issue soon, however I'm also in the middle of a large redesign that involves other libraries (and people) as well, so this might take a few weeks.

@ocramz ocramz added this to In development in sparse-linear-algebra Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
sparse-linear-algebra
  
In development
Development

No branches or pull requests

2 participants