Skip to content

Instantly share code, notes, and snippets.

View kvanbere's full-sized avatar
:octocat:
We write and test real time control software. @cuedo

Kyle Van Berendonck kvanbere

:octocat:
We write and test real time control software. @cuedo
View GitHub Profile
@PkmX
PkmX / Main.hs
Last active March 6, 2017 08:33
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Data.Reflection
newtype QDouble = QDouble Double
newtype Step = Step Double
@mr-pinzhang
mr-pinzhang / angular2-example@dynamically-insert-template-into-component.ts
Last active November 1, 2017 20:42
An example to show the way of injecting template into Angular2 component dynamically
import { NgFor } from '@angular/common'
import { Component, QueryList, TemplateRef, ViewChild, ViewChildren, ViewContainerRef } from '@angular/core'
@Component({
directives: [
NgFor
],
selector: 'component',
template: `
<ul><li #item *ngFor="let number of list">{{number}}</li></ul>
@chrisdone
chrisdone / typing.md
Last active July 4, 2024 16:47
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

// / /
// /' .,,,, ./
// /';' ,/
// / / ,,//,`'`
// ( ,, '_, ,,,' ``
// | /@ ,,, ;" `
// / . ,''/' `,``
// / . ./, `,, ` ;
// ,./ . ,-,',` ,,/''\,'
// | /; ./,,'`,,'' | |
@nkpart
nkpart / Yolo.hs
Last active September 5, 2018 13:50
{-# LANGUAGE GADTs #-}
module Yolo where
import System.IO.Unsafe
class Yolo f where
yolo :: f a -> a
instance Yolo Maybe where
yolo (Just x) = x
@CasperPas
CasperPas / Material-Design-Spinner.markdown
Created September 12, 2014 17:11
Polymer element of "Material Design Spinner"
@joehillen
joehillen / server.hs
Last active June 1, 2022 17:56
A re-implementation of Simon Marlow's Async Haskell Chat Server using Conduits
{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase #-}
import Conduit
import Data.Conduit
import Data.Conduit.Network
import qualified Data.ByteString.Char8 as BS
import Data.Conduit.TMChan
import Text.Printf (printf)
import Control.Concurrent.STM
import qualified Data.Map as Map
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes #-}
import Data.Aeson
import Data.Monoid
import Data.Text (Text, unpack)
import Control.Monad.Writer
import qualified Data.Map as M
import qualified Data.Vector as V
import qualified Data.HashMap.Strict as H
import Language.Haskell.TH
@kvanbere
kvanbere / Main.hs
Created March 30, 2014 02:24 — forked from gelisam/Main.hs
-- in reply to http://www.reddit.com/r/haskell/comments/21mja6/make_lllegal_state_transitions_unrepresentable/
--
-- We implement a tiny language with three commands: Open, Close, and Get.
-- The first Get after an Open returns 1, the second Get returns 2, and so on.
--
-- Get is only valid while the state is open, and
-- Open must always be matched by a Close.
-- We enforce both restrictions via the type system.
--
-- There are two valid states: Opened and Closed.
@gelisam
gelisam / Main.hs
Last active August 22, 2022 18:18
IndexedMonad example
-- in reply to http://www.reddit.com/r/haskell/comments/21mja6/make_lllegal_state_transitions_unrepresentable/
--
-- We implement a tiny language with three commands: Open, Close, and Get.
-- The first Get after an Open returns 1, the second Get returns 2, and so on.
--
-- Get is only valid while the state is open, and
-- Open must always be matched by a Close.
-- We enforce both restrictions via the type system.
--
-- There are two valid states: Opened and Closed.