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

use of partial function (!!) #17

Open
imalsogreg opened this issue Jan 19, 2014 · 3 comments
Open

use of partial function (!!) #17

imalsogreg opened this issue Jan 19, 2014 · 3 comments
Labels

Comments

@imalsogreg
Copy link
Owner

At
CrossRef.hs line 68
FieldTag.hs line 94

Possibly elsewhere? If I remember, I found a crash when trying to add a paper, after erasing all the state (was trying to either render or process the New Document form). The crash was caused by DocumentClass being [].

@AnneTheAgile
Copy link

Sorry for dumb q, but what does this mean? How does partial function relate to the problem found?
//AnneTheAgile

@imalsogreg
Copy link
Owner Author

Problem found was that reffit server crashed while I was testing because I tried to call (!!) on an empty list. (!!) is undefined for empty list (a 'partial function' is one that isn't defined over all well-typed inputs, and [] is a well-typed input). I try not to use partial functions because it's easy to forget where they are, and whether or not you proved that they're safe in the context they're in, even as you refactor that context. I'm sure that this one got in because i was lazily hacking something together, and forgot to come back and clean up. That's no good b/c if the server crashes my site goes down :/

@AnneTheAgile
Copy link

ah, ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants