Skip to content

Instantly share code, notes, and snippets.

View schell's full-sized avatar
🥑
mmm

Schell Carl Scivally schell

🥑
mmm
View GitHub Profile
@schell
schell / myeff.hs
Last active December 6, 2016 04:55
my ex eff
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
module Main where
import Control.Monad.Freer
#extension GL_OES_standard_derivatives : enable
precision highp float;
precision highp int;
varying vec4 fcolor;
varying vec2 fuv;
varying vec3 fbez;
varying vec2 fbezuv;
precision highp float;
precision highp int;
attribute vec2 position;
attribute vec4 color;
attribute vec2 uv;
attribute vec3 bez;
attribute vec2 bezuv;
attribute vec2 next;
attribute vec2 previous;
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Servant.Upload where
@schell
schell / bettercoroutine.hs
Last active February 21, 2017 16:54
better freer coroutiner
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
@schell
schell / unicodeshenanigans.hs
Last active February 28, 2017 17:19
Unicode Shenanigans
{-# LANGUAGE OverloadedStrings #-}
module Lib
( someFunc
) where
import Data.Aeson
import Data.Aeson.Parser (value)
import Data.Aeson.Text
import Data.Aeson.Types
import qualified Data.ByteString.Lazy as BL
@schell
schell / NEVect.idr
Created May 17, 2017 18:40
non-empty vectors
module Data.NEVect
import public Data.Fin
%access public export
%default total
||| Non-zero natural numbers: upper unbounded, unsigned integers that are
||| greater than one.
data NZNat : Type where
@schell
schell / varying.idr
Last active May 18, 2017 16:45
varying in idris
record VaryingT (input : Type) (m : Type -> Type) (output : Type) where
constructor VT
runVarT : input -> m (output, Inf $ VaryingT input m output)
Monad m => Functor (VaryingT a m) where
map f v = assert_total $ VT $ \ x => do
(b, v2) <- runVarT v x
pure (f b, map f v2)
@schell
schell / opengl crash
Created July 1, 2017 21:24
opengl crash
λupdate
λ2017-07-01 14:24:07.809 ghc[72296:17632659] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00007fffa3ae12cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffb88ec48d objc_exception_throw + 48
2 AppKit 0x00007fffa1ccde82 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4480
3 libSDL2-2.0.0.dylib 0x0000000114df652c Cocoa_PumpEvents + 247
4 libSDL2-2.0.0.dylib 0x0000000114d942b8 SDL_PumpEvents_REAL + 23
5 libSDL2-2.0.0.dylib 0x0000000114d94320 SDL_WaitEventTimeout_REAL + 57
@schell
schell / Metrics.hs
Created May 19, 2018 03:17
Proto.Proto.Metrics
{- This file was auto-generated from proto/metrics.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies,
UndecidableInstances, GeneralizedNewtypeDeriving,
MultiParamTypeClasses, FlexibleContexts, FlexibleInstances,
PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports#-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports#-}
module Proto.Proto.Metrics
(Bucket(..), Counter(..), Gauge(..), Histogram(..), LabelPair(..),
Metric(..), MetricFamily(..), MetricType(..), MetricType(),