Skip to content

Instantly share code, notes, and snippets.

View Heimdell's full-sized avatar
🔨
Right tool for the right job

Андреев Кирилл Heimdell

🔨
Right tool for the right job
  • Ульяновск
View GitHub Profile
use std::sync::Arc;
enum Octree<B, A>
{ Branch
{ preview : B
, subtrees : [Arc<Octree<B, A>>; 8]
}
, Atom
{ leaf : A
{- | A chunk of 16x16x16 atoms.
-}
module Chunk where
import Prelude hiding (read)
import Control.Monad
import Control.Monad.Primitive
module Union where
import Control.Monad
import qualified Control.Monad.Reader as MTL
data Union fs (m :: * -> *) x where
Here :: f m x -> Union (f : fs) m x
There :: Union fs m x -> Union (f : fs) m x
module AST where
import Data.Constraint
import Data.Functor.Compose
import Data.Fix
import Data.Text (Text)
import qualified Data.Text as Text
import GHC.TypeLits
{-# language DataKinds #-}
{-# language DerivingStrategies #-}
{-# language DeriveFunctor #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language FunctionalDependencies #-}
{-# language GADTs #-}
{-# language KindSignatures #-}
{-# language MultiParamTypeClasses #-}
{-# language ScopedTypeVariables #-}
module Weld where
import Control.Arrow
import Data.Bifunctor as B
import Text.PrettyPrint as PP hiding ((<>))
infix 1 \/
module Optics.Core exposing
( Optic
, id
, o
, lens
, prism
, traversal
, view
@Heimdell
Heimdell / Main.hs
Last active September 14, 2020 06:49
CSK machine for lazy language with let-rec and Shift/Reset
{-# language LambdaCase #-}
{-# language BlockArguments #-}
{-# language GADTs #-}
{-# language DataKinds #-}
{-# language TypeApplications #-}
{-# language DuplicateRecordFields #-}
{-|
module type FUNCTOR = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
module type APPLY = sig
include FUNCTOR
val ap : ('a -> 'b) t -> 'a t -> 'b t
end
{- | The union of functors and utilities.
-}
module Union
( -- * Union type
Union(..)
, eliminate