Skip to content

Instantly share code, notes, and snippets.

View kritzcreek's full-sized avatar

Christoph Hegemann kritzcreek

View GitHub Profile
@Dierk
Dierk / Balanced.purs
Created September 14, 2017 11:30
The balanced parentheses kata with two solutions in purescript
module Balanced where
import Prelude (Unit, discard, ($), (+), (-), (>=), (<=), (&&), (==), negate)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Data.Foldable (traverse_, foldMap)
import Control.Monad.State (State, execState)
import Control.Monad.State.Class (modify)
import Data.String (toCharArray)
@i-am-tom
i-am-tom / fanfic.md
Last active April 14, 2018 22:13
The morning of Gary Burgess, 01/09/17

"For services to the PureScript Community, Gary Burgess!"

You've done it, Gary. Moore, Lineker, Coleman, and now Burgess. All the work was worth it. The halls erupted with praise. Children dressed as Space Ghost, teens with "I only get high on Halogen" t-shirts, a giant banner held aloft with the message, "Tuple @garyb me". Through the noise of the crowds and Phil's uninterpretable Northern accent, he barely managed to hear his theme tu-

BZZP. BZZP.

@dysinger
dysinger / packages.el
Last active January 16, 2021 19:30
Private spacemacs layer to try out Chris Done's Intero mode for haskell
;; 1. place this in ~/.emacs.d/private/intero/packages.el
;; 2. add intero, syntax-checking and auto-completion to your
;; ~/.spacemacs layer configuration & remove the haskell layer
;; if you were using that before
;; 3. make sure you have stack installed http://haskellstack.org
;; 4. fire up emacs & open up a stack project's source files
@kosmikus
kosmikus / TinyServant.hs
Created November 1, 2015 20:30
Implementation of a small Servant-like DSL
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
module TinyServant where
import Control.Applicative
import GHC.TypeLits
import Text.Read
import Data.Time
@paf31
paf31 / Main.hs
Last active September 5, 2018 03:54
A simple type checker with Rank N types
module Main where
import Data.Maybe (fromMaybe)
import Control.Applicative
import Control.Arrow (first)
import Control.Monad (ap)
import Debug.Trace
@chrisdone
chrisdone / typing.md
Last active May 9, 2024 15:27
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

@paf31
paf31 / node-haskell.md
Last active May 14, 2024 03:51
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces