Commit 1b638784 authored by Jente Hidskes's avatar Jente Hidskes

Stratego: fix HLint errors

parent deebb073
# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################
# Ignore some builtin hints
- ignore: {name: "Use lambda-case"}
......@@ -6,7 +6,7 @@
{-# LANGUAGE DeriveGeneric #-}
module Data.Powerset where
import Prelude hiding (map,(.),id)
import Prelude hiding ((.))
import Control.Category
import Control.Applicative
......
......@@ -2,8 +2,6 @@
{-# LANGUAGE FlexibleContexts #-}
module Main where
import Prelude hiding (log)
import Syntax hiding (Fail)
import qualified WildcardSemantics as W
import qualified Data.AbstractPowerset as W
......@@ -31,7 +29,7 @@ import qualified Data.Term as T
import System.IO
import Text.PrettyPrint hiding (sep,(<>))
import Text.PrettyPrint
import Text.Printf
main :: IO ()
......
......@@ -2,7 +2,7 @@
module Pretty.PCF where
import WildcardSemantics
import Text.PrettyPrint hiding (sep)
import Text.PrettyPrint
ppPCF :: Term -> Doc
ppPCF t = case t of
......
......@@ -4,8 +4,7 @@ import WildcardSemantics
import Data.Foldable
import Text.PrettyPrint hiding (sep)
import Text.PrettyPrint
ppResults :: (Functor f, Foldable f) => (Term -> Doc) -> f Term -> Doc
ppResults ppTerm res = braces
......
......@@ -6,12 +6,12 @@
{-# LANGUAGE PatternSynonyms #-}
module AbstractTypedSemantics where
import Prelude hiding (id,(.),fail,all)
import Prelude hiding (fail)
import InterpreterArrow
import WildcardSemantics hiding (Term(..),TermEnv)
import Sort
import Signature hiding (lookupType)
import Signature
import qualified Signature as Sig
import Syntax(Strat,StratEnv,Module,signature,stratEnv)
import Utils
......
......@@ -11,7 +11,7 @@
{-# OPTIONS_GHC -Wno-partial-type-signatures #-}
module ConcreteSemantics where
import Prelude hiding (id,(.),all,curry,uncurry)
import Prelude hiding ((.),uncurry)
-- import InterpreterArrow
import SharedSemantics
......@@ -32,18 +32,15 @@ import Control.Monad.Reader
import Control.Monad.State
import Data.Constructor
import Data.Foldable (foldr')
import Data.HashMap.Lazy (HashMap)
import qualified Data.HashMap.Lazy as M
import Data.Hashable
import Data.Result
import Data.String (IsString(..))
import Data.Term (IsTerm(..),TermUtils(..))
import Data.TermEnv
import Data.Text (Text)
import Data.Order
import Data.Stack
import Data.Complete
import Data.Foldable (foldr')
import Data.Hashable
import Data.HashMap.Lazy (HashMap)
import qualified Data.HashMap.Lazy as M
import Test.QuickCheck hiding (Result(..))
......
......@@ -27,7 +27,7 @@ apply a = do
k <- get
let b = g k a
case M.lookup b (l k) of
Just c | otherwise -> do
Just c -> do
let c' = f k a c
put (k {l = M.insert b c' (l k)})
return c'
......
{-# LANGUAGE FunctionalDependencies #-}
module Data.Term where
import Prelude hiding (fail)
import Data.Constructor
import Data.Text(Text)
......
......@@ -4,7 +4,6 @@
{-# LANGUAGE Arrows #-}
module Data.TermEnv where
import Prelude hiding ((.),id,map)
import Syntax (TermVar)
import Control.Category
......
......@@ -5,7 +5,7 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module GrammarSemantics where
import Prelude hiding (fail,all,zipWith,id,(.))
import Prelude hiding (fail,all,id,(.))
import Result
import Syntax (Strat(..),Constructor(..),TermVar,StratEnv,TermPattern)
import qualified Syntax as S
......
......@@ -6,7 +6,7 @@
{-# LANGUAGE ConstraintKinds #-}
module SharedSemantics where
import Prelude hiding (fail,(.),id,sum,flip,uncurry,all,sequence)
import Prelude hiding (id,all,sequence)
import Syntax hiding (Fail,TermPattern(..))
import Syntax (TermPattern)
......
......@@ -6,8 +6,6 @@
module Signature(Signature, HasSignature(..), Sort(..), Fun(..), SortId(..),
empty, insertType, lookupType, insertSubtype, subtype, inhabitants) where
import Prelude hiding (lookup)
import Sort
import SubtypeRelation (SubtypeRelation)
import qualified SubtypeRelation as R
......
......@@ -3,8 +3,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Syntax where
import Prelude hiding (maybe)
import Signature (Signature,Sort,Fun)
import qualified Signature as I
......
......@@ -5,12 +5,10 @@
{-# LANGUAGE MultiParamTypeClasses #-}
module TypedSemantics where
import Prelude hiding (id,(.),fail,all)
import InterpreterArrow
import ConcreteSemantics hiding (Term(..),TermEnv,eval)
import Sort
import Signature hiding (lookupType,lub)
import Signature hiding (lub)
import qualified Signature as Sig
import Syntax(Module,Strat,StratEnv,stratEnv,signature)
import Utils
......@@ -44,7 +42,7 @@ eval :: Signature -> StratEnv -> Strat -> (Term,TermEnv) -> TypedResult (Term,Te
eval sig senv s = runInterp (eval' s) (sig, senv)
instance HasTerm Term (Interp (Signature,senv) s TypedResult) where
matchTerm = arr $ \t -> case t of
matchTerm = arr $ \case
Cons c ts _ -> T.Cons c ts
StringLiteral s -> T.StringLiteral s
NumberLiteral n -> T.NumberLiteral n
......
......@@ -2,7 +2,6 @@
{-# LANGUAGE FlexibleInstances #-}
module Utils where
import Prelude hiding (id)
import Control.Arrow
eqLength :: [a] -> [b] -> Bool
......
......@@ -8,7 +8,7 @@
{-# OPTIONS_GHC -Wno-partial-type-signatures -fno-warn-orphans #-}
module WildcardSemantics where
import Prelude hiding (id,concat,sequence,(.),uncurry)
import Prelude hiding ((.),uncurry)
import qualified ConcreteSemantics as C
import SharedSemantics
......
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module AbstractTypedSemanticsSpec where
......
......@@ -5,7 +5,6 @@
module ConcreteSemanticsSpec(main, spec) where
import Prelude hiding (map)
import qualified Prelude as P
import ConcreteSemantics
import Syntax hiding (Fail,TermPattern(..))
......@@ -149,9 +148,7 @@ spec = do
parseArrowCaseStudy = do
file <- TIO.readFile =<< getDataFileName "case-studies/arrows/arrows.aterm"
case parseModule =<< parseATerm file of
Left e -> P.fail (show e)
Left e -> fail (show e)
Right module_ -> return module_
tup x y = Cons "" [x,y]
......@@ -9,8 +9,6 @@ import qualified Data.Powerset as P
import qualified Data.AbstractPowerset as A
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck hiding (Result(..))
main :: IO ()
main = hspec spec
......
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module TypedSemanticsSpec where
......
......@@ -124,4 +124,4 @@ spec = do
(Build (Cons "Nil" []))))
weval :: Int -> Strat -> W.Term -> A.Pow (Result (W.Term,W.TermEnv))
weval i s t = W.eval i s M.empty (W.TermEnv M.empty) t
weval i s = W.eval i s M.empty (W.TermEnv M.empty)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment