Skip to content

Instantly share code, notes, and snippets.

View jonschoning's full-sized avatar

Jon Schoning jonschoning

View GitHub Profile
A# .NET
A# (Axiom)
A-0 System
A+
A++
ABAP
ABC
ABC ALGOL
ABSET
ABSYS
@jonschoning
jonschoning / bounded.hs
Created July 27, 2018 21:22 — forked from borkdude/bounded.hs
Concurrent IO actions in Haskell with bounded parallelism
-- based on https://stackoverflow.com/a/29155440/6264
import Data.Traversable
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception
import Control.Monad
import System.Random
import Data.IORef
@jonschoning
jonschoning / ParentView.purs
Created July 17, 2018 00:56 — forked from prathje/ParentView.purs
Raw Halogen HTML Component
module ParentView where
import Prelude
import Halogen as H
import Halogen.HTML as HH
import Halogen.HTML.Events as HE
import Halogen.HTML.Properties as HP
import Data.Maybe (Maybe(..))
import Control.Monad.Aff (Aff)
@jonschoning
jonschoning / web-servers.md
Created July 16, 2018 00:46 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jonschoning
jonschoning / Matrix.md
Created May 27, 2018 19:58 — forked from nadavrot/Matrix.md
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@jonschoning
jonschoning / recursion_schemes.hs
Created May 18, 2018 20:17 — forked from jtobin/recursion_schemes.hs
An illustration of the recursion-schemes library.
{-# LANGUAGE DeriveFunctor #-}
import Data.List.Ordered (merge)
import Data.Functor.Foldable
import Prelude hiding (Foldable, succ)
data NatF r =
ZeroF
| SuccF r
deriving (Show, Functor)
@jonschoning
jonschoning / .block
Created April 11, 2018 04:21 — forked from emeeks/.block
Every ColorBrewer Scale
license: gpl-3.0
{-# LANGUAGE UndecidableInstances #-}
instance {-# OVERLAPPABLE #-} (ToJSON a) => ToContent a where
toContent = toContent . toJSON
instance {-# OVERLAPPABLE #-} (ToJSON a) => ToTypedContent a where
toTypedContent = TypedContent typeJson . toContent
getUsersR :: Handler [User]
getUsersR =
return
@jonschoning
jonschoning / lib.hsfiles
Created January 9, 2018 21:14 — forked from roman/lib.hsfiles
Snapshot of library skeleton for Haskell Projects
{-# START_FILE README.md #-}
# {{name}}
> Description of what this library does
## Table Of Contents
* [Raison d'etre](#raison-detre)
* [Library Usage](#library-usage)
* [Installation](#installation)
* [Development Notes](#development)
@jonschoning
jonschoning / StateComonad.hs
Created January 6, 2018 18:03 — forked from ekmett/StateComonad.hs
The State Comonad
-- http://comonad.com/reader/2018/the-state-comonad/
-- https://www.reddit.com/r/haskell/comments/7oav51/i_made_a_monad_that_i_havent_seen_before_and_i/
{-# language DeriveFunctor #-}
import Control.Comonad
import Data.Semigroup
data Store s a = Store { peek :: s -> a, pos :: s } deriving Functor