This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this gist we will first show that we can beat the arc challenge | |
(http://www.paulgraham.com/arcchallenge.html), and then build the library that | |
shows how we did it. This gist is Literate Haskell and is of course executable. The packages needed are happstack-server and applicative-extras, installable using cabal. | |
Let's start with some imports (for now, you can ignore these) | |
> {-# LANGUAGE GADTs, TypeSynonymInstances #-} | |
> module ArcChallenge where | |
> | |
> import Control.Applicative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language DataKinds, PolyKinds, ScopedTypeVariables, UndecidableInstances, | |
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies, RankNTypes, | |
LambdaCase, TypeOperators, ConstraintKinds #-} | |
import GHC.TypeLits | |
import Data.Proxy | |
import Data.Singletons.Prelude | |
import Data.Singletons.Decide | |
import Data.Constraint |