Skip to content

Instantly share code, notes, and snippets.

View rybla's full-sized avatar

Henry Blanchette rybla

View GitHub Profile

Keybase proof

I hereby claim:

  • I am riib11 on github.
  • I am riib11 (https://keybase.io/riib11) on keybase.
  • I have a public key ASBdNRCAVuixD-Vp9Y0D3GqiVHQtw44UV-t2tMRAu1BHtwo

To claim this, I am signing this object:

@rybla
rybla / AlgebraicFieldExtension.agda
Last active November 18, 2020 02:08
Implementation of fibonacci using the closed formula over Q[sqrt[5]]. Updated repo: https://github.com/Riib11/AlgebraExperiments
open import Level
open import Relation.Binary
module AlgebraicFieldExtension {a ℓ} {A : Set a} (_≈_ : Rel A ℓ) (α : A) where
open import Function
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
module StructureField where
open import Level using (_⊔_; suc)
open import Relation.Binary using (Rel)
open import Relation.Nullary using (¬_)
open import Algebra.Core
open import Algebra.Structures as Structures
open import Function
open import Level
open import Relation.Binary
open import Relation.Binary.PropositionalEquality as PropositionalEquality
open import Relation.Nullary
open import Algebra
-- based on Zalakain's "Evidence-Providing Problem Solvers in Agda"
-- href: https://umazalakain.info/static/report.pdf
@rybla
rybla / ListFailure.hs
Created January 7, 2021 03:20
[Liquid Haskell] Problem with naming record fields for List data type.
module ListFailure where
import Prelude hiding ( head
, tail
)
{-@
data List a = Nil | Cons { head :: a , tail :: List a }
module LMonadEquality where
import LFunctor -- Liquid Haskell Functor data class
--------------------------------------------------------------------------------
-- Monad
--------------------------------------------------------------------------------
-- Data Class.
{-@
{-
# Relation
-}
{-@
type Re r a RE X Y = {_:r a | RE X Y}
@-}
{-@
newtype IsReflexive r a <re :: a -> a -> Bool> = IsReflexive
@rybla
rybla / InaccessiblePattern.hs
Last active February 9, 2021 19:16
Liquid Haskell can't recognize the inaccessible pattern, where bound names are forced to be equal via types.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module InaccessiblePattern where
@rybla
rybla / Inductive.agda
Last active September 18, 2021 02:17
module Inductive where
open import Data.Empty
open import Data.Unit
open import Data.Nat
open import Data.Fin using (Fin; zero; suc)
open import Data.Product
open import Data.Sum
module Inductive
{-# LANGUAGE GADTs, KindSignatures, DataKinds, RankNTypes, TypeFamilies, TypeFamilyDependencies, AllowAmbiguousTypes, ScopedTypeVariables #-}
module OverloadSingletonI where
import Prelude hiding (negate)
data OverloadMode = NegateInt | NegateBool
data SOverloadMode :: OverloadMode -> * -> * where
SNegateInt :: SOverloadMode NegateInt (Int -> Int)