mirror of
https://github.com/github/semantic.git
synced 2025-01-04 13:34:31 +03:00
Parsing, analyzing, and comparing source code across many languages
61c63e0dcc
Rather than writing Either-aware functions for all uses of division and modulus and replumbing all of `liftIntegralFrac` to account for these changed type signatures, the simplest and most robust solution is to use `unsafePerformIO` to lift `Control.Exception.try` into pure code, then dispatch on the returned `Either` value and inject the resulting `ArithException`, if any, into a `ValueError`. A post on Haskell-cafe by Wren N. G. Thornton asserts that this particular use of unsafePerformIO does the right thing. Ultimately, if the world were a better place, the type signatures of `/` and `div` would indicate that they are the partial functions that in actuality they are. Unfortunately, Haskell chose to make the pragmatic but immoral choice. |
||
---|---|---|
app | ||
bench | ||
bin | ||
preludes | ||
script | ||
src | ||
test | ||
vendor | ||
.ghci | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.hspec | ||
.stylish-haskell.yaml | ||
Dockerfile.release | ||
HLint.hs | ||
semantic.cabal | ||
Setup.hs |