From 09304a5df2c8b0f677605f13d194d99d4bc3d525 Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 12 Oct 2016 16:34:12 -0400 Subject: [PATCH] Add strictness annotations to a few types --- src/Arguments.hs | 1 + src/Category.hs | 1 + src/Data/Functor/Both.hs | 1 + src/DiffSummary.hs | 2 +- src/Language.hs | 2 +- src/Patch.hs | 1 + src/Range.hs | 1 + src/Renderer.hs | 1 + src/SES.hs | 1 + src/Source.hs | 2 +- src/SourceSpan.hs | 10 +++++----- 11 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Arguments.hs b/src/Arguments.hs index 9ebe977d6..707d8235f 100644 --- a/src/Arguments.hs +++ b/src/Arguments.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} module Arguments (Arguments(..), CmdLineOptions(..), DiffMode(..), ExtraArg(..), programArguments, args) where import Data.Functor.Both diff --git a/src/Category.hs b/src/Category.hs index 57ddf4a21..537c1e45d 100644 --- a/src/Category.hs +++ b/src/Category.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} module Category where import Prologue diff --git a/src/Data/Functor/Both.hs b/src/Data/Functor/Both.hs index f5da6e1b3..336a2a522 100644 --- a/src/Data/Functor/Both.hs +++ b/src/Data/Functor/Both.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Data.Functor.Both (Both,both, runBothWith, fst, snd, module X) where diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 9d76c0e89..ed5e31697 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds, TypeFamilies, ScopedTypeVariables, DeriveAnyClass #-} +{-# LANGUAGE DataKinds, TypeFamilies, ScopedTypeVariables, DeriveAnyClass, StrictData #-} module DiffSummary (diffSummaries, DiffSummary(..), DiffInfo(..), diffToDiffSummaries, isBranchInfo, isErrorSummary, JSONSummary(..)) where diff --git a/src/Language.hs b/src/Language.hs index 1a7246c5a..b5126bfce 100644 --- a/src/Language.hs +++ b/src/Language.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DataKinds, StrictData #-} module Language where import Data.Record diff --git a/src/Patch.hs b/src/Patch.hs index 65a163838..da6e3e5ac 100644 --- a/src/Patch.hs +++ b/src/Patch.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} module Patch ( Patch(..) , replacing diff --git a/src/Range.hs b/src/Range.hs index f8ad25ae3..4f93d860a 100644 --- a/src/Range.hs +++ b/src/Range.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} module Range where import qualified Data.Char as Char diff --git a/src/Renderer.hs b/src/Renderer.hs index abe2abe2d..ac6201d6f 100644 --- a/src/Renderer.hs +++ b/src/Renderer.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE StrictData #-} module Renderer (Renderer, DiffArguments(..), Output(..), concatOutputs, toSummaryKey, Format(..)) where import Data.Aeson (Value, toEncoding) diff --git a/src/SES.hs b/src/SES.hs index cb6ae2349..642860686 100644 --- a/src/SES.hs +++ b/src/SES.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Strict #-} module SES where import qualified Data.Map as Map diff --git a/src/Source.hs b/src/Source.hs index a66d6c8fe..6a5f1c56a 100644 --- a/src/Source.hs +++ b/src/Source.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE GeneralizedNewtypeDeriving, StrictData #-} module Source where import Prologue hiding (uncons) diff --git a/src/SourceSpan.hs b/src/SourceSpan.hs index e043d0a19..7b76880f1 100644 --- a/src/SourceSpan.hs +++ b/src/SourceSpan.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveAnyClass, StrictData #-} -- | -- Source position and span information -- Mostly taken from purescript's SourcePos definition. @@ -19,11 +19,11 @@ data SourcePos = SourcePos { -- | -- Line number -- - line :: !Int + line :: Int -- | -- Column number -- - , column :: !Int + , column :: Int } deriving (Show, Read, Eq, Ord, Generic, Hashable) displaySourcePos :: SourcePos -> Text @@ -43,10 +43,10 @@ data SourceSpan = SourceSpan { -- | -- Start of the span -- - spanStart :: !SourcePos + spanStart :: SourcePos -- End of the span -- - , spanEnd :: !SourcePos + , spanEnd :: SourcePos } deriving (Show, Read, Eq, Ord, Generic, Hashable) displayStartEndPos :: SourceSpan -> Text