123456789101112131415161718192021222324252627282930313233343536373839404142434445464748-------------------------------------------------------------------------- The Agda standard library---- The Pair type which calls out to Haskell via the FFI------------------------------------------------------------------------ {-# OPTIONS --cubical-compatible #-} module Foreign.Haskell.Pair where open import Levelopen import Data.Product.Base using (_×_; _,_) private variable a b : Level A : Set a B : Set b -------------------------------------------------------------------------- Definition record Pair (A : Set a) (B : Set b) : Set (a ⊔ b) where constructor _,_ field fst : A snd : Binfixr 4 _,_open Pair public {-# FOREIGN GHC type AgdaPair l1 l2 a b = (a , b) #-}{-# COMPILE GHC Pair = data MAlonzo.Code.Foreign.Haskell.Pair.AgdaPair ((,)) #-} -------------------------------------------------------------------------- Conversion toForeign : A × B → Pair A BtoForeign (a , b) = (a , b){-# WARNING_ON_USAGE toForeign"Warning: toForeign was deprecated in 2.0.Please use Foreign.Haskell.Coerce.coerce instead."#-} fromForeign : Pair A B → A × BfromForeign (a , b) = (a , b){-# WARNING_ON_USAGE fromForeign"Warning: fromForeign was deprecated in 2.0.Please use Foreign.Haskell.Coerce.coerce instead."#-}