This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language LambdaCase #-} | |
import Data.String | |
import Data.HashMap.Lazy (HashMap, (!)) | |
import qualified Data.HashMap.Lazy as M | |
data Term = Var !String | !Term :$ !Term | Lam !String !Term deriving (Show) | |
instance IsString Term where | |
fromString = Var . fromString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language DataKinds, PolyKinds, ScopedTypeVariables, UndecidableInstances, | |
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies, RankNTypes, | |
LambdaCase, TypeOperators, ConstraintKinds #-} | |
import GHC.TypeLits | |
import Data.Proxy | |
import Data.Singletons.Prelude | |
import Data.Singletons.Decide | |
import Data.Constraint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language | |
FlexibleInstances, UndecidableInstances, MagicHash, | |
PatternSynonyms, GADTs, TypeFamilies, ScopedTypeVariables, TypeOperators, | |
DataKinds, ViewPatterns, RoleAnnotations, RankNTypes, ConstraintKinds #-} | |
import GHC.Prim | |
import Data.Vector (Vector) | |
import qualified Data.Vector as V | |
import Data.Proxy | |
import Text.Show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --without-K #-} | |
-- the easy way is effectfully's brilliant heterogeneous equality solution: | |
-- https://github.com/effectfully/random-stuff/blob/master/Fin-injective.agda | |
open import Data.Fin hiding (_+_) | |
open import Data.Nat | |
open import Data.Nat.Properties.Simple | |
open import Relation.Binary.PropositionalEquality | |
open import Relation.Nullary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE | |
TypeInType, UndecidableInstances, TypeOperators, GADTs, TypeFamilies #-} | |
import Data.Kind | |
import GHC.Prim | |
import Data.Proxy | |
data Fun a b | |
type a ~> b = Fun a b -> Type | |
infixr 0 ~> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs, RankNTypes, TypeFamilies, ScopedTypeVariables #-} | |
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, PartialTypeSignatures #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Singletons.Prelude | |
import GHC.Exts | |
import Data.List | |
data NotInScopeError sym |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open import Data.Nat | |
open import Data.List | |
open import Data.Unit | |
open import Function | |
open import Data.Maybe | |
open import Data.Product | |
open import Data.Bool | |
H : Set → Set → ℕ → Set | |
H A B zero = ⊤ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE | |
UndecidableInstances, RankNTypes, TypeOperators, TypeFamilies, | |
StandaloneDeriving, DataKinds, PolyKinds, DeriveFunctor, DeriveFoldable, | |
DeriveTraversable, LambdaCase, PatternSynonyms, TemplateHaskell #-} | |
import Control.Monad | |
import Control.Applicative | |
import Data.Singletons.TH | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open import Data.List renaming (map to lmap) hiding ([_]) | |
open import Relation.Binary.PropositionalEquality hiding ([_]) | |
open import Relation.Nullary | |
open import Data.Empty | |
open import Data.Product renaming (map to pmap) | |
open import Data.Unit hiding (_≤_) | |
open import Function | |
open import Level renaming (suc to lsuc; zero to lzero) | |
open import Data.Sum renaming (map to smap) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open import Data.Fin hiding (_<_; _≤_) | |
open import Data.Nat | |
open import Function | |
open import Data.Product renaming (map to pmap) | |
open import Data.List renaming (map to lmap) | |
open import Relation.Binary.PropositionalEquality | |
open import Data.Empty | |
open import Relation.Nullary | |
open import Relation.Binary | |
open import Data.Sum renaming (map to smap) |