yellowtides / owenbot-hs

A utility bot written in Haskell for the Edinburgh Informatics Class of ‘24’s main messaging platform (Discord server).
https://yellowtid.es/owenbot-hs/
BSD 3-Clause "New" or "Revised" License
8 stars 7 forks source link

Crash with `:pf` #41

Closed jacobjwalters closed 2 years ago

jacobjwalters commented 3 years ago

Upon calling :pf f (a,b,c) = g a b c, pointfree' throws an exception and crashes the entire bot. This should be properly caught.

owenbot-exe: pointfree: not supported: PTuple () Boxed [PVar () (Ident () "a"),PVar () (Ident () "b"),PVar () (Ident () "c")]
CallStack (from HasCallStack):
error, called at ./Plugin/Pl/Parser.hs:8:14 in pointfree-1.1.1.8-I2W1iGuieXp7A9292pxyGI:Plugin.Pl.Parser

I had a peek at the source, and I can't immediately see any exception throwing (in fact, the function returns Maybe String, so I'm surprised we have this problem).

social-anthrax commented 3 years ago

Is the error thrown due to the mishandling of the Maybe or within the function itself?

jacobjwalters commented 3 years ago

Within the function it seems, as it's a custom error thrown by pointfree.

Exceptions should be caught by the Command stuff (according to yuto), so it's doubly strange.

social-anthrax commented 3 years ago

Time to go open a PR with them I guess That or it could be worth trying to catch any errors raised by that function.