This file contains 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
{-# OPTIONS --safe --without-K #-} | |
module Categories.Comonad.Distributive where | |
open import Categories.Category | |
open import Categories.Category.Construction.F-Algebras | |
open import Categories.Comonad | |
open import Categories.Functor | |
open import Categories.Functor.Algebra | |
open import Categories.Functor.DistributiveLaw |
This file contains 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
{-# OPTIONS --safe --without-K #-} | |
module Categories.Functor.Example.Vec where | |
open import Categories.Category.Core using (Category) | |
open import Categories.Category.Cartesian.Bundle using (CartesianCategory) | |
open import Categories.Category.Cartesian.Monoidal using (module CartesianMonoidal) | |
open import Categories.Category.Instance.Nat | |
open import Categories.Category.Instance.Sets | |
open import Categories.Category.Monoidal.Construction.Product using (Product-Monoidal) |
This file contains 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
// the golden ratio | |
phi = (sqrt(5) + 1) / 2; | |
// the points of a regular dodecahedron, oriented "somehow" | |
dodecahedron_points = | |
[ [ 1 , 1 , 1 ] // 0 | |
, [ 1 , 1 , -1 ] | |
, [ 1 , -1 , 1 ] | |
, [ 1 , -1 , -1 ] | |
, [ -1 , 1 , 1 ] // 4 |
This file contains 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 DerivingVia #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE QuantifiedConstraints #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module LogicT where | |
import Control.Applicative | |
import Control.Monad | |
import Data.Monoid |
This file contains 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
class ReadOnly api where | |
readOnly :: Proxy api -> ServerT api Handler -> ServerT api Handler | |
instance (ReadOnly a, ReadOnly b) => ReadOnly (a :<|> b) where | |
readOnly (Proxy :: Proxy (a :<|> b)) (a :<|> b) = (readOnly (Proxy :: Proxy a) a :<|> readOnly (Proxy :: Proxy b) b) | |
instance (ReadOnly api) => ReadOnly (Description desc :> api) where | |
readOnly (Proxy :: Proxy (Description desc :> api)) api = readOnly (Proxy :: Proxy api) api | |
instance (ReadOnly api) => ReadOnly ((path :: Symbol) :> api) where |
This file contains 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 Regex where | |
import Control.Applicative | |
import Data.Profunctor | |
data Regex c a = Regex (Maybe a) (c -> Regex c a) | |
instance Functor (Regex c) where | |
fmap f (Regex xm xr) = Regex (fmap f xm) (fmap f . xr) |
This file contains 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 Yes where | |
open import Codata.Musical.Notation | |
open import Data.List using (List; []; _∷_) | |
open import Data.String using (String; unwords; _++_) | |
open import Data.Unit using (⊤) | |
open import Function using (case_of_) |
This file contains 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 #-} | |
module GenerateStatus where | |
import qualified Network.HTTP.Types.Status as Status | |
import GHC.TypeNats | |
class KnownNat n => KnownStatus n where | |
statusVal :: proxy n -> Status.Status | |
instance KnownStatus 100 where |
This file contains 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
pkgself: pkgsuper: | |
{ | |
haskell = pkgsuper.haskell // { | |
packageOverrides = self: super: { | |
Agda = pkgself.haskell.lib.doJailbreak super.Agda; | |
time-compat = pkgself.haskell.lib.doJailbreak super.time-compat; | |
}; | |
}; | |
} |
This file contains 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 Level | |
module Categories.Category.Closed.Instance.Sets (o : Level) where | |
open import Categories.Category | |
open import Categories.Category.Instance.Sets | |
open import Categories.Category.Closed (Sets o) | |
open import Axiom.Extensionality.Propositional | |
open import Data.Product |
NewerOlder