Revert "Use fromRight instead of reimplementing it"

We still support GHC 8.0, which didn't have fromRight.

This reverts commit 64c31d9142.
This commit is contained in:
Joseph C. Sible 2020-04-24 22:14:08 -04:00
parent 75863a887e
commit e0daa936d2
3 changed files with 3 additions and 6 deletions

View file

@ -25,7 +25,6 @@ import ShellCheck.Formatter.Format
import Control.Monad
import Data.Array
import Data.Either
import Data.Foldable
import Data.Ord
import Data.IORef
@ -123,7 +122,7 @@ outputResult options ref result sys = do
outputForFile color sys comments = do
let fileName = sourceFile (head comments)
result <- (siReadFile sys) fileName
let contents = fromRight "" result
let contents = either (const "") id result
let fileLinesList = lines contents
let lineCount = length fileLinesList
let fileLines = listArray (1, lineCount) fileLinesList