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 | |
| symbols : Stream Char | |
| symbols = cycle (unpack "abc") | |
| main : IO () | |
| main = do | |
| print $ take 10 symbols |
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
| record OnsenM a where | |
| constructor MkOnsen | |
| runOnsen : (List String -> String, a) | |
| emptyOnsenM : OnsenM () | |
| namespace AttribElem { | |
| elem : String -> List Char -> OnsenM a -> OnsenM a | |
| } | |
| namespace Elem { |
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 Tree : Type -> Type where | |
| Empty : Tree a | |
| MkTree : a -> List (Tree a) -> Tree a | |
| total | |
| map1 : (a -> b) -> Tree a -> Tree b | |
| map1 f Empty = Empty | |
| map1 f (MkTree x xs) = MkTree (f x) (map (map1 f) xs) |
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 OpenSum (f :: k -> Type) (ts :: [k]) where | |
| UnsafeOpenSum :: Int -> f t -> OpenSum f ts | |
| type FindElem (key :: k) (ts :: [k]) = | |
| FromMaybe Stuck =<< FindIndex (TyEq key) ts | |
| type Member t ts = KnownNat (Eval (FindElem t ts)) | |
| findElem :: forall t ts. Member t ts => 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 Foo | |
| data Singleton : (x : k) -> Type where | |
| With : (y : a) -> x = y -> Singleton x | |
| inspect : (x : a) -> Singleton x | |
| inspect x = With x Refl | |
| all_values_filtered : (xs:List a) -> (f:a -> Bool) -> (all f (filter f xs) = True) | |
| all_values_filtered [] f = Refl |
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
| bool' : Bool -> a -> a -> a | |
| bool' True x _ = x | |
| bool' False _ y = y | |
| filter' : (a -> Bool) -> List a -> List a | |
| filter' f [] = [] | |
| filter' f (x :: xs) = bool' (f x) (x :: filter' f xs) (filter' f xs) | |
| an : Bool -> Bool -> Bool | |
| an True True = True |
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 Foo : Nat -> Nat -> Type where | |
| Uuuh : Foo Z 0 | |
| Aaah : Foo x y -> Foo x w -> Foo (S x) (y+w) | |
| try_contradict : Foo n 0 -> (n = S Z) -> Void | |
| try_contradict Uuuh Refl impossible | |
| try_contradict (Aaah f g {y=Z} {w=Z} {x = Z}) prf = ?valid1 | |
| try_contradict (Aaah f g {y=Z} {w=Z} {x = (S k)}) prf = (\Refl impossible) prf | |
| try_contradict (Aaah f g {y=Z} {w=S k}) prf impossible | |
| try_contradict (Aaah f g {y=S j} {w=Z}) prf 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 Foo : Nat -> Nat -> Type where | |
| Uuuh : Foo Z 0 | |
| Aaah : Foo x y -> Foo x w -> Foo (S x) (y+w) | |
| try_contradict : Foo n 0 -> IsSucc n -> Void | |
| try_contradict Uuuh ItIsSucc impossible | |
| try_contradict (Aaah f g {y=Z} {w=Z} {x = Z}) ItIsSucc = ?valid1 | |
| try_contradict (Aaah f g {y=Z} {w=Z} {x = (S k)}) ItIsSucc = ?valid2 | |
| try_contradict (Aaah f g {y=Z} {w=S k}) ItIsSucc impossible | |
| try_contradict (Aaah f g {y=S j} {w=Z}) ItIsSucc 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
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| module Lib where | |
| import Data.Char |
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
| ___ | |
| ___ ___ |