Skip to content

Instantly share code, notes, and snippets.

@int-index
int-index / implicit-quantification-order
Created March 5, 2024 18:26
Packages compiled to estimate the impact of new implicit quantification order
AC-Angle-1.0
ALUT-2.4.0.3
ANum-0.2.0.2
Agda-2.6.4.2
Allure-0.11.0.0
BNFC-2.9.5
BNFC-2.9.5-e-bnfc
BNFC-meta-0.6.1
BiobaseEnsembl-0.2.0.1
BiobaseNewick-0.0.0.2
@int-index
int-index / view-pattern-signatures
Created December 10, 2023 14:56
Packages compiled to estimate the impact of new precedence for view patterns and pattern signatures
abstract-deque-0.3
abstract-deque-tests-0.3
abstract-par-0.3.3
AC-Angle-1.0
acc-0.2.0.3
ace-0.6
acid-state-0.16.1.3
action-permutations-0.0.0.1
active-0.2.0.18
ad-4.5.4
@int-index
int-index / annotated-exceptions.rst
Last active November 29, 2022 10:35
Annotated exceptions

Proposed Change Specification

Annotations

Export the following new definitions from Control.Exception.Annotation:

  • The class of exception annotations: :
{-# LANGUAGE TemplateHaskell, GADTs, ScopedTypeVariables, PolyKinds, DataKinds,
TypeFamilies, TypeOperators, UndecidableInstances, InstanceSigs,
TypeApplications, FlexibleInstances, StandaloneDeriving #-}
module AddrSing where
import GHC.TypeLits
import Data.Kind
import Data.Singletons.TH
import Data.Singletons.Sigma
@int-index
int-index / Implicit.hs
Last active April 10, 2019 04:59 — forked from greatBigDot/Implicit.hs
A fixed attempt to represent implicit proof terms in quasi-dependent Haskell.
{-# LANGUAGE LambdaCase, EmptyCase
, EmptyDataDecls, TypeOperators, LiberalTypeSynonyms,
ExistentialQuantification, GADTSyntax, GADTs
, StandaloneDeriving
, InstanceSigs, FlexibleContexts, MultiParamTypeClasses,
FlexibleInstances , TypeSynonymInstances , FunctionalDependencies
, TypeFamilies, TypeFamilyDependencies, DataKinds, PolyKinds,
Prelude Language.Haskell.TH GHC.TypeLits> a <- runQ [t| 1 + 2 |]
Prelude Language.Haskell.TH GHC.TypeLits> a
AppT (AppT (ConT GHC.TypeNats.+) (LitT (NumTyLit 1))) (LitT (NumTyLit 2))
Prelude Language.Haskell.TH GHC.TypeLits> b <- runQ [e| 1 + 2 |]
Prelude Language.Haskell.TH GHC.TypeLits> b
InfixE (Just (LitE (IntegerL 1))) (VarE GHC.Num.+) (Just (LitE (IntegerL 2)))
@int-index
int-index / NamedDefaults.hs
Created April 23, 2018 12:38
named-defaults
{-# LANGUAGE KindSignatures, DataKinds, FlexibleInstances, FlexibleContexts,
FunctionalDependencies, TypeFamilies, TypeOperators,
PatternSynonyms, UndecidableInstances, ConstraintKinds,
TypeApplications, ScopedTypeVariables, CPP #-}
module NamedDefaults (FillDefaults, fillDefaults, (!.)) where
import Prelude (Maybe(..), id)
import Data.Kind (Type)
@int-index
int-index / Elem.hs
Created February 12, 2018 14:11
Type families case split, confluent
{-# LANGUAGE RankNTypes, TypeApplications, TypeInType, TypeOperators,
ScopedTypeVariables, TypeFamilies, UndecidableInstances,
GADTs, ConstraintKinds, AllowAmbiguousTypes #-}
module Elem where
import Data.Type.Equality
import Data.Kind
import Unsafe.Coerce
@int-index
int-index / nolog.hs
Last active December 14, 2017 12:41
Logging not disabled
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, OverloadedStrings, UndecidableInstances #-}
import Control.Monad.Logger
import Control.Monad.Trans
import Control.Monad.Trans.Identity
import Data.Coerce
class Monad m => MonadFoo m where
foo :: m ()
@int-index
int-index / bistrength.hs
Created December 2, 2017 21:37
Bistrength
class Bistrength g where
bistrength :: Bifunctor f => g (f a b) -> f (g a) (g b)
instance Bistrength ((,) x) where
bistrength (x, f) = bimap (x,) (x,) f
instance Bistrength ((,,) x y) where
bistrength (x, y, f) = bimap (x,y,) (x,y,) f