Skip to content

Commit b3726ca

Browse files
committed
hlint and formatting
1 parent 49be86a commit b3726ca

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/Telomare/Eval.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ import Telomare (AbstractRunTime, BreakState, BreakState', ExprA (..),
3333
RunTimeError (..), TelomareLike (..), Term3 (Term3),
3434
Term4 (Term4), UnprocessedParsedTerm (..),
3535
UnprocessedParsedTermF (..), UnsizedRecursionToken (..), app,
36-
appF, convertAbortMessage, deferF, eval,
37-
forget, g2s, innerChurchF, insertAndGetKey, pairF, rootFrag,
38-
s2g, setEnvF, tag, unFragExprUR)
36+
appF, convertAbortMessage, deferF, eval, forget, g2s,
37+
innerChurchF, insertAndGetKey, pairF, rootFrag, s2g, setEnvF,
38+
tag, unFragExprUR)
3939
import Telomare.Parser (AnnotatedUPT, parseModule, parseOneExprOrTopLevelDefs,
4040
parsePrelude)
41-
import Telomare.Possible (abortExprToTerm4, abortPossibilities, appB,
42-
deferB, evalStaticCheck, getSizesM,
43-
sizeTermM, term3ToUnsizedExpr, term4toAbortExpr, evalStaticCheck)
41+
import Telomare.Possible (abortExprToTerm4, abortPossibilities, appB, deferB,
42+
evalStaticCheck, getSizesM, sizeTermM,
43+
term3ToUnsizedExpr, term4toAbortExpr)
4444
import Telomare.PossibleData (AbortExpr, CompiledExpr (..), SizedRecursion (..),
4545
VoidF, envB, leftB, pairB, pattern AbortFW,
4646
rightB, setEnvB)
@@ -110,9 +110,9 @@ data SizingOption
110110
findChurchSizeD :: SizingOption -> Term3 -> Either EvalError Term4
111111
findChurchSizeD so t3 = case so of
112112
-- _ -> pure (convertPT (const 255) t3)
113-
NoSizing -> pure (convertPT (const 255) t3)
113+
NoSizing -> pure (convertPT (const 255) t3)
114114
UnitTestSizing -> calculateRecursionLimits False t3
115-
MainSizing -> calculateRecursionLimits True t3
115+
MainSizing -> calculateRecursionLimits True t3
116116

117117
-- rather than remove checks, we should extract them so that they can be run separately, if that gives a performance benefit
118118
{-

src/Telomare/Possible.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import Control.Monad
1717
import Control.Monad.Except
1818
import Control.Monad.Reader (Reader, ReaderT, ask, local, runReaderT)
1919
import qualified Control.Monad.Reader as Reader
20+
import qualified Control.Monad.State.Lazy as StateL
2021
import Control.Monad.State.Strict (State, StateT)
2122
import qualified Control.Monad.State.Strict as State
22-
import qualified Control.Monad.State.Lazy as StateL
2323
import Control.Monad.Trans.Class
2424
import Data.Bifunctor
2525
import Data.Char (chr)
@@ -661,7 +661,7 @@ unsizedStepM''' maxSize zeros recursionTest handleOther x = f x where
661661
(appB (appB argThree (unsizedEE $ SizeStepStubF tok 1 envB)) argOne)
662662
(dbt tok . unsizedEE . SizeStageF (SizedRecursion . Map.singleton tok $ pure 1) $ appB argTwo argOne))
663663
result = pairB zeroB (pairB zeroB (pairB zeroB (pairB (pairB rf trb) zeroB)))
664-
in pure $ result
664+
in pure result
665665
UnsizedFW (SizeStepStubF tok n e@(BasicEE (PairSF _ es))) ->
666666
let dbti = id
667667
in pure $ pairB (deferB unsizedStepMrfa $ dbtisss (iteB (dbti $ appB argFour argTOne)
@@ -1321,8 +1321,8 @@ instance {-# OVERLAPPING #-} PrettyPrintable (PPOut CompiledExpr) where
13211321
BasicEE (PairSF a b) -> liftA2 (<>) (doLet a) (f b)
13221322
z -> indentWithTwoChildren' "#!#" (pure "") (showP z)
13231323
doLet x = case cata lf x of
1324-
Just n -> pure $ chr n : []
1325-
_ -> indentWithTwoChildren' "#/#" (pure "") (showP x)
1324+
Just n -> pure [chr n]
1325+
_ -> indentWithTwoChildren' "#/#" (pure "") (showP x)
13261326
lf = \case
13271327
BasicFW ZeroSF -> Just 0
13281328
BasicFW (PairSF n (Just 0)) -> succ <$> n

src/Telomare/Resolver.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import qualified Data.ByteArray as BA
2020
import Data.ByteString (ByteString)
2121
import qualified Data.ByteString as BS
2222
import Data.Char (ord)
23+
import Data.Fix (Fix)
2324
import qualified Data.Foldable as F
2425
import Data.Functor.Foldable (Base, Corecursive (ana, apo), Recursive (cata))
2526
import Data.List (delete, elem, elemIndex, find, foldl', intercalate, nubBy,
@@ -33,7 +34,6 @@ import PrettyPrint (TypeDebugInfo (..), prettyPrint, showTypeDebugInfo)
3334
import Telomare
3435
import Telomare.Parser (AnnotatedUPT, TelomareParser)
3536
import Text.Megaparsec (errorBundlePretty, runParser)
36-
import Data.Fix (Fix)
3737

3838
debug :: Bool
3939
debug = False
@@ -503,8 +503,8 @@ letsToApps term =
503503
(name', (def, _)) <- nBindings, name == name']
504504
makeBinding (n,d) inner = anno :< TAppF (makeLambda n inner) d
505505
sortedBindings >>= \sb -> let trans = getTransitive' dependencies refs
506-
sb' = [x | x <- sb, elem (fst x) trans]
507-
in pure (foldr makeBinding nInner sb', Set.difference trans (Set.fromList $ map fst sb'))
506+
sb' = [x | x <- sb, fst x `elem` trans]
507+
in pure (foldr makeBinding nInner sb', Set.difference trans (Set.fromList $ fmap fst sb'))
508508
x -> WriterT . fmap (first ((anno :<) . brt)) . runWriterT $ sequence x where
509509
brt = \case
510510
ITEUPF i t e -> TITEF i t e

0 commit comments

Comments
 (0)