~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to src/full/Agda/Utils/Favorites.hs

  • Committer: Package Import Robot
  • Author(s): Iain Lane, d5cf60f
  • Date: 2015-05-20 13:08:33 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150520130833-cdcmhagwsouna237
Tags: 2.4.2.2-2
[d5cf60f] Depend on ${shlibs:Depends}, to get libc (& maybe other) deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{-# LANGUAGE CPP #-}
2
 
{-# LANGUAGE DeriveFoldable #-}
 
1
{-# LANGUAGE CPP                        #-}
 
2
{-# LANGUAGE DeriveFoldable             #-}
3
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4
 
{-# LANGUAGE NoImplicitPrelude #-}
5
 
{-# LANGUAGE TemplateHaskell #-}
 
4
{-# LANGUAGE NoImplicitPrelude          #-}
 
5
{-# LANGUAGE TemplateHaskell            #-}
6
6
 
7
7
-- | Maintaining a list of favorites of some partially ordered type.
8
8
--   Only the best elements are kept.
39
39
import Agda.Utils.TestHelpers
40
40
import Agda.Utils.Tuple
41
41
 
42
 
#include "../undefined.h"
 
42
#include "undefined.h"
43
43
import Agda.Utils.Impossible
44
44
 
45
45
-- | A list of incomparable favorites.
151
151
instance (PartialOrd a, Arbitrary a) => Arbitrary (Favorites a) where
152
152
  arbitrary = fromList <$> arbitrary
153
153
 
 
154
property_null_empty :: Bool
154
155
property_null_empty = null empty
155
156
 
 
157
property_not_null_singleton :: a -> Bool
156
158
property_not_null_singleton = not . null . singleton
157
159
 
158
160
-- Remember: less is better!
159
161
 
 
162
prop_compareWithFavorites :: ISet -> Favorites ISet -> Bool
160
163
prop_compareWithFavorites a@ISet{} as =
161
164
  case compareWithFavorites a as of
162
165
    Dominates dominated notDominated ->