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 NatInd | |
import Language.Reflection.Elab | |
import Language.Reflection.Utils | |
%default total | |
trivial : Elab () | |
trivial = do compute | |
g <- snd <$> getGoal |
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
18:38:27 -> ((:docs-for "Nat") | |
94) | |
18:38:27 <- (:return | |
(:ok "Data type Nat : Type\n Unary natural numbers\n \nConstructors:\n Z : Nat\n Zero\n \n S : Nat -> Nat\n Successor\n " | |
((10 3 | |
((:name "Prelude.Nat.Nat") | |
(:implicit :False) | |
(:decor :type) | |
(:doc-overview "Unary natural numbers") | |
(:type "Type") |
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
mutual | |
class Foo a where | |
foo : a -> Type | |
bar : (x : a) -> foo @{nonsense} x -> Int | |
instance Foo a where | |
foo x = Nat | |
bar x n = 354 | |
instance [nonsense] Foo a 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 Main | |
import Data.So | |
import Debug.Trace | |
%include C "bytes.h" | |
%link C "bytes.o" | |
%access public |
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 ClassNonsense | |
import Language.Reflection.Elab | |
class Foo a where | |
foo : a -> () -> a | |
class Foo a => Bar a where | |
constructor MkFoo | |
bar : a -> Int |
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 ClassNonsense | |
import Language.Reflection.Elab | |
class Foo t where | |
constructor MkFoo | |
foo : t | |
myFoo : Foo Nat | |
myFoo = MkFoo 1 |
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
||| Binary parsing, based on the stuff in Power of Pi | |
module Bin | |
import System | |
import Data.So | |
import Data.Vect | |
import Bytes |
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
data HList : List Type -> Type where | |
Nil : HList [] | |
(::) : t -> HList ts -> HList (t :: ts) | |
%name HList xs,ys | |
append : HList ts -> HList ts' -> HList (ts ++ ts') | |
append [] ys = ys | |
append (x :: xs) ys = x :: append xs ys |
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 NotElem | |
import Language.Reflection.Elab | |
import Language.Reflection.Utils | |
import Data.List | |
emptyNotElem : {a : Type} -> {x : a} -> Elem x [] -> Void | |
emptyNotElem Here impossible |
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
data Typ = | |
IntTyp | |
| BolTyp | |
| FunTyp Typ Typ | |
toType : Typ -> Type | |
toType IntTyp = Integer | |
toType BolTyp = Bool | |
toType (FunTyp x y) = toType x -> toType y |