1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

remove uses of lens

This commit is contained in:
joshvera 2016-01-04 14:48:55 -05:00
parent 15724218b8
commit 44e9f50434
2 changed files with 9 additions and 7 deletions

View File

@ -23,6 +23,8 @@ import qualified Data.Text.ICU.Detect as Detect
import qualified Data.Text.ICU.Convert as Convert
import Data.Conduit.Binary as CB
import qualified Data.Conduit as C
import Data.Biapplicative
import Data.Bifunctor.Join
data Renderer = Unified | Split | Patch
@ -41,13 +43,11 @@ main :: IO ()
main = do
arguments <- execParser opts
let (sourceAPath, sourceBPath) = (sourceA arguments, sourceB arguments)
aSource <- readAndTranscodeFile sourceAPath
bSource <- readAndTranscodeFile sourceBPath
(aTerm, bTerm) <- let parse = (P.parserForType . T.pack . takeExtension) sourceAPath in do
aTerm <- parse aSource
bTerm <- parse bSource
return (replaceLeavesWithWordBranches aSource aTerm, replaceLeavesWithWordBranches bSource bTerm)
printDiff arguments (aSource, bSource) (aTerm, bTerm)
sources <- sequence $ fmap readAndTranscodeFile $ Join (sourceAPath, sourceBPath)
let parse = (P.parserForType . T.pack . takeExtension) sourceAPath
terms <- sequence $ parse <$> sources
let replaceLeaves = replaceLeavesWithWordBranches <$> sources
printDiff arguments (runJoin sources) (runJoin $ replaceLeaves <*> terms)
where opts = info (helper <*> arguments)
(fullDesc <> progDesc "Diff some things" <> header "semantic-diff - diff semantically")

View File

@ -64,6 +64,7 @@ executable semantic-diff-exe
, semantic-diff
, text >= 1.2.1.3
, text-icu
, bifunctors
default-language: Haskell2010
default-extensions: OverloadedStrings
@ -87,6 +88,7 @@ executable semantic-diff-profile
, semantic-diff
, text >= 1.2.1.3
, text-icu
, bifunctors
default-extensions: OverloadedStrings
default-language: Haskell2010