Skip to content

Instantly share code, notes, and snippets.

View righ1113's full-sized avatar
๐Ÿ 
Working from home

righ1113

๐Ÿ 
Working from home
View GitHub Profile
@righ1113
righ1113 / rev_rev_id.lean
Last active July 5, 2023 19:58
ใƒชใ‚นใƒˆใ‚’2ๅ›ž้€†้ †ใซใ™ใ‚‹ใจๅ…ƒใซๆˆปใ‚‹ in Lean
open list (hiding reverse)
#check 1
#reduce head [0, 1, 2, 3]
variable {T : Type}
def snoc : list T โ†’ T โ†’ list T
@righ1113
righ1113 / judgeFiniteUnfoldr.md
Last active April 16, 2019 00:29
unfoldrใŒๆœ‰้™้ …ใ‹ๅˆคๅฎšใ—ใŸใ„

judge finite unfoldr by Idris

unfoldrใŒๆœ‰้™้ …ใ‹ๅˆคๅฎšใ—ใŸใ„

ๅŽŸ็†็š„ใซ็„ก็†ใชใฎใ‹

/libs/contrib/Data/CoList.idr
ใงCoListใจunfoldrใฏไปฅไธ‹ใฎใ‚ˆใ†ใซๅฎŸ่ฃ…ใ•ใ‚Œใฆใ„ใ‚‹ใ€‚

@righ1113
righ1113 / CoInductive.idr
Created February 3, 2019 04:30
ไฝ™ๅธฐ็ด๏ผŸ
module CoInductive
%default total
-- ๆ€ง่ณชQ
codata Q : Stream Nat -> Type where
Qcons : (x:Nat) -> Q xs -> Q (x::xs)
isQ : (xs:Stream Nat) -> Q xs
@righ1113
righ1113 / Isort.idr
Created January 26, 2019 12:40
ๆŒฟๅ…ฅใ‚ฝใƒผใƒˆใฎ่จผๆ˜Ž
module Isort
-- > idris -p base
import Syntax.PreorderReasoning
%default total
%hide sorted
sorted : List Nat -> Bool