← Back

Modules

Leios

  • Abstract
  • Base
  • Blocks
  • Config
  • Defaults
  • FFD
  • Foreign.BaseTypes
  • Foreign.HsTypes
  • Foreign.Types
  • Foreign.Util
  • KeyRegistration
  • Network
  • Prelude
  • Protocol
  • Short
  • Short.Decidable
  • Short.Trace.Verifier
  • Short.Trace.Verifier.Test
  • Simplified
  • Simplified.Deterministic
  • SpecStructure
  • Traces
  • Voting
  • VRF
12345678910111213141516171819202122232425262728293031
------------------------------------------------------------------------
-- The Agda standard library
--
-- The NonEmpty type which calls out to Haskell via the FFI
------------------------------------------------------------------------
 
{-# OPTIONS --cubical-compatible #-}
 
module Foreign.Haskell.List.NonEmpty where
 
open import Level
open import Data.List.NonEmpty.Base as Data using (_∷_)
open import Data.List using (List)
 
{-# FOREIGN GHC import qualified Data.List.NonEmpty as NE #-}
 
private
variable
a : Level
A : Set a
 
------------------------------------------------------------------------
-- Definition
 
data NonEmpty (A : Set a) : Set a where
_∷_ : A → List A → NonEmpty A
 
infixr 5 _∷_
 
{-# FOREIGN GHC type AgdaNonEmpty l a = NE.NonEmpty a #-}
{-# COMPILE GHC NonEmpty = data AgdaNonEmpty ((NE.:|)) #-}