Debian Codegraph @

src/Foreign/Haskell/List/NonEmpty.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- The NonEmpty type which calls out to Haskell via the FFI
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible #-}
8
9 module Foreign.Haskell.List.NonEmpty where
10
11 open import Level using (Level; _⊔_)
12 open import Data.List.NonEmpty.Base as Data using (_∷_)
13 open import Data.List using (List)
14
15 {-# FOREIGN GHC import qualified Data.List.NonEmpty as NE #-}
16
17 private
18 variable
19 a : Level
20 A : Set a
21
22 ------------------------------------------------------------------------
23 -- Definition
24
25 data NonEmpty (A : Set a) : Set a where
26 _∷_ : A → List A → NonEmpty A
27
28 infixr 5 _∷_
29
30 {-# FOREIGN GHC type AgdaNonEmpty l a = NE.NonEmpty a #-}
31 {-# COMPILE GHC NonEmpty = data AgdaNonEmpty ((NE.:|)) #-}