Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Constrained/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ instance Typeable c => Show (Evidence c) where
-- | Take the union of two `Maybe` values with a given union operator
unionWithMaybe :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
unionWithMaybe f ma ma' = (f <$> ma <*> ma') <|> ma <|> ma'

14 changes: 2 additions & 12 deletions src/Constrained/NumOrd.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@
import Constrained.PrettyUtils
import Control.Applicative ((<|>))
import Control.Arrow (first)
import Data.Containers.ListUtils
import Data.Foldable
import Data.Kind
import Data.List (nub)
import Data.List.NonEmpty (NonEmpty ((:|)))
import qualified Data.List.NonEmpty as NE
import Data.Maybe
import qualified Data.Set as Set

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Stack

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - latest

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - latest

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - latest

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.12

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.12

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.12

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.8

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.8

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.8

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.10

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.10

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.10

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.6

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.6

The qualified import of ‘Data.Set’ is redundant

Check warning on line 74 in src/Constrained/NumOrd.hs

View workflow job for this annotation

GitHub Actions / Haskell-CI - Linux - 9.6

The qualified import of ‘Data.Set’ is redundant
import Data.Typeable (typeOf)
import Data.Word
import GHC.Int
Expand Down Expand Up @@ -362,17 +363,6 @@
-- implementations are found here
-- =====================================================================

-- | Strip out duplicates (in n-log(n) time, by building an intermediate Set)
nubOrd :: Ord a => [a] -> [a]
nubOrd =
loop mempty
where
loop _ [] = []
loop s (a : as)
| a `Set.member` s = loop s as
| otherwise =
let s' = Set.insert a s in s' `seq` a : loop s' as

-- | Builds a MemberSpec, but returns an Error spec if the list is empty
nubOrdMemberSpec :: Ord a => String -> [a] -> Specification a
nubOrdMemberSpec message xs =
Expand Down Expand Up @@ -936,7 +926,7 @@

propagateMemberSpec AddW (HOLE :<: i) es =
memberSpec
(nub $ mapMaybe (safeSubtract i) (NE.toList es))
(nubOrd $ mapMaybe (safeSubtract i) (NE.toList es))
( NE.fromList
[ "propagateSpecFn on (" ++ show i ++ " +. HOLE)"
, "The Spec is a MemberSpec = " ++ show es -- show (MemberSpec @HasSpec @TS es)
Expand Down