Open kostmo opened 1 year ago
It looks like we don't have any uses of fromJust
, so we could just add that to the hlint
config.
There may be other more obscure functions - for example in tests, I use the sneaky (^?!)
. 🙂
I'm not as concerned about tests, since those don't directly affect users if they crash. But yes, we should disallow (^?!) and its ilk.
Ideally we don't want any instances of
error
in the codebase (https://github.com/swarm-game/swarm/pull/1484#discussion_r1315211065). For similar reasons, we should restrict use of partial functions like(!!)
,fromJust
, andhead
to a vetted subset of modules.hlint
can whitelist where certain functions may be used.NonEmpty.fromList
(#1503)Prelude.head
(#1503)Prelude.tail
(!!)
(Data.Map.!)
error
fromJust
undefined