This file contains hidden or 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
FROM debian:jessie | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && apt-get install -y ghc cabal-install libghc-hakyll-dev --fix-missing | |
RUN cabal update && cabal install hakyll-4.5.4.0 --reinstall | |
ENV PATH /root/.cabal/bin:$PATH |
This file contains hidden or 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
[ghc-7.0.4-plain] andres@neli:~/repos/universe (git:master) $ rm -rf dist-newstyle && ~/bin/cabal-cc2 new-configure --max-backjumps=-1 --dry-run +RTS -t | |
Resolving dependencies... | |
In order, the following would be built (use -v for more details): | |
base-orphans-0.5.4 | |
binary-0.8.2.1 | |
deepseq-1.3.0.2 | |
Cabal-1.20.0.4 | |
deepseq-1.4.2.0 | |
bytestring-builder-0.10.8.1.0 | |
stm-2.4.4.1 |
This file contains hidden or 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 #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.Either |
This file contains hidden or 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
type PermApi1 = | |
"a" :> "b" :> "c" :> Get '[JSON] () | |
:<|> "b" :> "a" :> "c" :> Get '[JSON] () | |
:<|> "a" :> "c" :> "b" :> Get '[JSON] () | |
:<|> "c" :> "a" :> "b" :> Get '[JSON] () | |
:<|> "b" :> "c" :> "a" :> Get '[JSON] () | |
:<|> "c" :> "b" :> "a" :> Get '[JSON] () | |
Output: |
This file contains hidden or 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
<root> | |
|- greet | |
| v | |
| `-* | |
| v | |
| `- <dyn> | |
| `-* | |
`- hello | |
`- <dyn> | |
`-* |
This file contains hidden or 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 TypeInType, TypeFamilies, UndecidableInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Kind | |
import GHC.TypeLits (TypeError, ErrorMessage(..)) | |
type family Resolve (t :: Type -> Type) :: Type -> Type where | |
Resolve _ = TypeError (Text "ERROR") | |
-- testOK :: Resolve [] Int |
This file contains hidden or 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 GADTs, InstanceSigs, TypeFamilies #-} | |
{-# LANGUAGE FlexibleContexts, RankNTypes, PatternSynonyms #-} | |
module Fold where | |
import Prelude hiding (foldr, take, all) | |
--------------------------------------------------------------------------- | |
-- "foldr" on lists, Maybe, Bool, and binary trees | |
--------------------------------------------------------------------------- |
This file contains hidden or 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
module FromInteger | |
import Data.Vect | |
-- This is inspired by the fromInteger definition for Fin. | |
IntegerToElem : | |
DecEq a => (i : Integer) -> (x : a) -> (xs : Vect n a) | |
-> Maybe (Elem x xs) | |
IntegerToElem i x [] = Nothing |
This file contains hidden or 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 DeriveGeneric, FlexibleInstances, ScopedTypeVariables, FlexibleContexts, DataKinds, TypeFamilies #-} | |
module SwaggerExample where | |
import Data.Proxy | |
import qualified GHC.Generics as G | |
import Generics.SOP | |
data Todo = Todo { | |
created :: Int | |
, description :: String |
This file contains hidden or 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, TypeOperators #-} | |
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-} | |
{-# LANGUAGE InstanceSigs #-} | |
module TinyServant where | |
import Control.Applicative | |
import GHC.TypeLits | |
import Text.Read | |
import Data.Time |