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 DerivingStrategies, DerivingVia, TypeOperators, DataKinds, | |
DeriveGeneric #-} | |
module Rec where | |
import SameRepAs | |
import GHC.Generics ( Generic ) | |
import qualified Data.Monoid as M |
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 StandaloneKindSignatures, DataKinds, DerivingStrategies, | |
TypeFamilies, GeneralizedNewtypeDeriving, DeriveGeneric, | |
TypeOperators, UndecidableInstances, | |
TypeApplications, ScopedTypeVariables, | |
FlexibleContexts, ConstraintKinds #-} | |
module HRecord where | |
import Data.Kind ( Type ) | |
import GHC.Generics |
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 DerivingStrategies, DerivingVia, TypeOperators, DataKinds, | |
DeriveGeneric #-} | |
module Rec where | |
import SameRepAs | |
import GHC.Generics ( Generic ) | |
import qualified Data.Monoid as M |
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 LinearTypes #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE QualifiedDo #-} | |
import Prelude.Linear hiding (partition) | |
import qualified Control.Functor.Linear as Linear | |
import Control.Functor.Linear (State, state, execState, pure) | |
import qualified Data.Array.Mutable.Linear as Array |
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 FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
import Data.Coerce (coerce) | |
import Data.Functor.Compose (Compose (..)) | |
data Vector |
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
// term variables | |
let z : int = 123 | |
let y : int = z | |
// anonymous products & inline types | |
let k : [ int, int, int ] = [ 1, 2, 3 ] | |
// sum types and type variables | |
type Q = A(int) | B(bool) | |
let qA : Q = A(123) |
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 RankNTypes, TypeOperators, PolyKinds, FunctionalDependencies, FlexibleInstances, StandaloneKindSignatures, DataKinds #-} | |
import Prelude hiding (id, (.)) | |
import Control.Category | |
import Control.Arrow ((+++)) | |
import Data.Kind (Constraint, Type) | |
type Cat ob = ob -> ob -> Type | |
type F ob = ob -> Type | |
-- a presheaf is a functor from C^op to Hask |
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
This is an extension of "A Very General Method of Computing Shortest Paths" to use "open matrices". | |
This is from a paper "The Open Algebraic Path Problem" by Jade Master https://arxiv.org/abs/2005.06682 | |
> {-# LANGUAGE TypeFamilies #-} | |
> {-# LANGUAGE TypeApplications #-} | |
> {-# LANGUAGE FlexibleContexts #-} | |
> {-# LANGUAGE StandaloneDeriving #-} | |
> {-# LANGUAGE AllowAmbiguousTypes #-} | |
> {-# LANGUAGE ScopedTypeVariables #-} | |
> module OpenStarSemiring 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
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE DeriveTraversable #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Control.Monad.Trans.DistT where | |
import Data.List.NonEmpty (NonEmpty(..)) | |
import Control.Monad.Trans.Class | |
import Control.Monad.Trans.Free | |
import Control.Arrow (Arrow(first)) | |
import Control.Applicative (liftA2, Alternative(..)) |
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 | |
PolyKinds | |
, RankNTypes | |
, TypeFamilies | |
, TypeOperators | |
, TypeApplications | |
, FlexibleInstances | |
, ScopedTypeVariables | |
, AllowAmbiguousTypes | |
, MultiParamTypeClasses |