This file contains hidden or 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 #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module ReverseVec where | |
data Nat = Z | S Nat |
This file contains hidden or 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 #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Phantom.Alternative where | |
-- | universe of validation types | |
data Validated = Validated | |
data Unvalidated = Unvalidated | |
newtype FormData a = MkFD { pfd :: (Maybe String, String) } |
This file contains hidden or 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
module Unfold where | |
newtype Fix f = InFix { outFix :: f (Fix f) } | |
unfoldFix :: Functor f => (s -> f s) -> s -> Fix f | |
unfoldFix node = go | |
where go = InFix . fmap go . node | |
data ListF a r = LNil | LCons a r | |
data TreeF a r = TNil | TLeaf a | TBranch r r |
This file contains hidden or 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
module tfix where | |
open import Data.Unit | |
open import Data.Product | |
data Desc : Set₁ where | |
arg : (A : Set) (d : A → Desc) → Desc | |
rec : (r : Desc) → Desc | |
ret : Desc |
This file contains hidden or 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
module Url where | |
-- We usually start something about TT with the definition | |
-- of ℕ. So here we go: | |
data ℕ : Set where | |
z : ℕ | |
s : ℕ → ℕ | |
-- Now we want to embed a url in the comments. Why not use a |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
><head | |
><title | |
>Url</title | |
><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" | |
/><meta http-equiv="Content-Style-Type" content="text/css" | |
/><link href="Agda.css" rel="stylesheet" type="text/css" | |
/></head | |
><body |
This file contains hidden or 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 Relation.Nullary | |
open import Relation.Binary.PropositionalEquality | |
module Data.Functor | |
(Alphabet : Set) | |
(_≤_ : (a b : Alphabet) → Set) | |
(_≟_ : (a b : Alphabet) → Dec (a ≡ b)) | |
(_≤?_ : (a b : Alphabet) → Dec (a ≤ b)) | |
where |
This file contains hidden or 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
module Data.Functor.Examples where | |
open import Data.Unit | |
open import Data.Sum | |
open import Data.Product | |
open import Data.Char as Chr | |
open import lib.Char as Char | |
open import Data.String as Str | |
open import Data.List as List | |
open import Function |
This file contains hidden or 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
-- Cf. this discussion for an explanation of what happens: | |
-- http://code.google.com/p/agda/issues/detail?id=1526 | |
module Vector where | |
open import Data.Bool | |
open import Data.Nat | |
open import Data.Fin as Fin | |
open import Data.Unit | |
open import Data.Product |
This file contains hidden or 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
module RewriteQuote where | |
open import Data.Bool | |
open import Data.Nat | |
open import Function | |
open import Relation.Nullary | |
open import Relation.Binary.PropositionalEquality | |
infixr 5 _`+_ |