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

proof-of-concept decode XLS from ByteString, typed cells #9

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

olafklinke
Copy link
Collaborator

No description provided.

, conduit >= 1.1 && < 1.4
, filepath >= 1.0 && < 1.5
, resourcet >= 0.3 && < 1.3
, temporary
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add bounds here. Also, bounds of transformers and resourcet can be bumped up.

xls.cabal Outdated Show resolved Hide resolved
decodeXlsIO filePath

-- | Experimental: This function uses the @xls_open_buffer@ function of libxls.
decodeXlsByteString' :: ByteString -> IO (Either XLSError [[[Cell]]])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It would be better to have the same signature as decodeXlsByteString. The only difference between the two is exception vs either return. Both are IO, so can use exception.
  2. We can say in the docs, that it does not use a temporary file, instead uses ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you suggest to make XLSError an instance of Exception and use throwIO instead of explicitly returning Either?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is somewhat odd that there are two exception types: XLSError from libxls and the XlsException defined in this package. Proposal: We add XLSError into the XlsException type so that only one exception type is thrown by this library.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a branch in my fork for unifying the error types.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a branch in my fork for unifying the error types.

lib/Data/Xls.hs Outdated Show resolved Hide resolved
@harendra-kumar
Copy link
Owner

@olafklinke just a few minor suggestions. I also added you to the repo, please check your email for the invite.

Once we have resolved and merged this, can you please also upload it to hackage? Let me know your hackage user name, I will add you to maintainers.

@olafklinke
Copy link
Collaborator Author

this is my hackage identity: olf

Copy link
Owner

@harendra-kumar harendra-kumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Minor points. Plus a comment on the aux change in your fork.

| TextCell String
| BoolCell Bool
| OtherCell o
deriving (Functor,Show,Eq)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way/possiblity for users to use this type? otherwise we should not expose this type and if that's the case then we can just use a Cell type instead of using it as a synonym to CellF (). Will keep things simple for users.

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 this pull request may close these issues.

2 participants