The JSON data is in the following format
{
"Genesis": {
"1": {
"1": "In the beginning..." ,
"2": "..."
{-# language DeriveGeneric #-} | |
{-# language FlexibleContexts #-} | |
{-# language TypeFamilies #-} | |
{-# language DataKinds #-} | |
{-# language ScopedTypeVariables #-} | |
{-# language TypeOperators #-} | |
{-# language TypeApplications #-} | |
import Data.List | |
import qualified GHC.Generics as GHC |
// Faster solution for: | |
// http://www.boyter.org/2017/03/golang-solution-faster-equivalent-java-solution/ | |
// With threading. | |
// g++ -std=c++11 -Wall -Wextra -O3 -pthread | |
// On my computer (i5-6600K 3.50 GHz 4 cores), takes about ~160 ms after the CPU | |
// has warmed up, or ~80 ms if the CPU is cold (due to Turbo Boost). | |
// How it works: Start by generating a list of losing states -- states where the | |
// game can end in one turn. Generate a new list of states by running the game |
{-# LANGUAGE ExistentialQuantification, RankNTypes #-} | |
{-# LANGUAGE InstanceSigs #-} | |
module CoYoneda where | |
import Data.IORef | |
import Data.Set (Set, map) | |
import Control.Monad (liftM) | |
-------------------------------------------------------------------------------- | |
-- Yoneda |
{-# LANGUAGE GADTs, TypeInType, DataKinds, TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeApplications #-} | |
import GHC.TypeLits | |
import GHC.Types | |
import Data.Singletons | |
import Data.Singletons.Prelude | |
data Format = Lit Symbol | Str | Shown Type |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Class | |
import Prelude hiding (log) | |
-------------------------------------------------------------------------------- | |
-- The API for cloud files. | |
class Monad m => MonadCloud m where | |
saveFile :: Path -> Bytes -> m () |
{-#LANGUAGE NoMonomorphismRestriction #-} | |
module Main (main) where | |
import Control.Monad (void) | |
import Control.Monad.Identity | |
import Criterion.Main | |
import qualified Data.Conduit as C | |
import qualified Data.Conduit.Combinators as CC | |
import qualified Data.Conduit.List as C | |
import qualified Data.Machine as M |
{-#LANGUAGE BangPatterns #-} | |
module Main (main) where | |
import Data.Conduit as C | |
import qualified Data.Conduit.Combinators as C | |
import Pipes as P | |
import qualified Pipes.Prelude as P | |
import qualified Streaming.Prelude as Str |
;; 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 |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE PolyKinds #-} |