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

« back to all changes in this revision

Viewing changes to src/full/Agda/Utils/BiMap.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 DeriveDataTypeable         #-}
 
2
{-# LANGUAGE FlexibleInstances          #-}
 
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
 
4
{-# LANGUAGE PatternGuards              #-}
 
5
{-# LANGUAGE TemplateHaskell            #-}
 
6
{-# LANGUAGE TupleSections              #-}
 
7
 
1
8
-- | Finite bijections (implemented as a pair of maps).
2
9
 
3
 
{-# LANGUAGE DeriveDataTypeable #-}
4
 
{-# LANGUAGE FlexibleInstances #-}
5
 
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
6
 
{-# LANGUAGE PatternGuards #-}
7
 
{-# LANGUAGE TemplateHaskell #-}
8
 
{-# LANGUAGE TupleSections #-}
9
 
 
10
10
module Agda.Utils.BiMap where
11
11
 
12
12
import Prelude hiding (lookup, unzip)
89
89
-- * Properties
90
90
------------------------------------------------------------------------
91
91
 
 
92
prop_BiMap_invariant :: (Ord a, Ord b) => BiMap a b -> Bool
92
93
prop_BiMap_invariant (BiMap t u) =
93
94
  Map.toAscList t == List.sort (List.map swap (Map.toList u))
94
95