Denotational Semantics in Agda
Agda.Builtin.List
Initializing search
    pdmosses/xds-agda
    • About
    • Meta-notation
    • ULC
    • PCF
    • Scheme
    pdmosses/xds-agda
    • About
    • Meta-notation
      • Untyped λ-calculus
      • ULC.All
      • ULC.Variables
      • ULC.Terms
      • ULC.Domains
      • ULC.Environments
      • ULC.Semantics
      • ULC.Checks
      • PCF (Plotkin 1977)
      • PCF.All
      • PCF.Domain Notation
      • PCF.Types
      • PCF.Constants
      • PCF.Variables
      • PCF.Terms
      • PCF.Environments
      • PCF.Checks
      • Core Scheme (R5RS)
      • Scheme.All
      • Scheme.Domain Notation
      • Scheme.Abstract Syntax
      • Scheme.Domain Equations
      • Scheme.Auxiliary Functions
      • Scheme.Semantic Functions

    Agda.Builtin.List

    {-# OPTIONS --cubical-compatible --safe --no-sized-types --no-guardedness --level-universe #-}
    
    module Agda.Builtin.List where
    
    infixr 5 _∷_
    data List {a} (A : Set a) : Set a where
      []  : List A
      _∷_ : (x : A) (xs : List A) → List A
    
    {-# BUILTIN LIST List #-}
    
    {-# COMPILE JS  List = function(x,v) {
      if (x.length < 1) { return v["[]"](); } else { return v["_∷_"](x[0], x.slice(1)); }
    } #-}
    {-# COMPILE JS [] = Array() #-}
    {-# COMPILE JS _∷_ = function (x) { return function(y) { return Array(x).concat(y); }; } #-}
    
    Made with Material for MkDocs