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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by The Glorious Glasgow Haskell Compilation System configure 8.7, which was | |
generated by GNU Autoconf 2.69. Invocation command line was | |
$ ./configure --target=aarch64-unknown-linux-gnu | |
## --------- ## | |
## Platform. ## |
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
Up to date | |
]0;Starting...| Run Cc FindCDependencies Stage1: rts/Linker.c => _build/stage1/rts/build/c/Linker.debug_dyn_o.d | |
| Run Cc FindCDependencies Stage1: rts/RaiseAsync.c => _build/stage1/rts/build/c/RaiseAsync.thr_o.d | |
| Run Cc FindCDependencies Stage1: rts/WSDeque.c => _build/stage1/rts/build/c/WSDeque.dyn_o.d | |
| Run Cc FindCDependencies Stage1: rts/sm/Scav_thr.c => _build/stage1/rts/build/c/sm/Scav_thr.thr_debug_o.d | |
| Run Cc FindCDependencies Stage1: rts/linker/elf_plt_aarch64.c => _build/stage1/rts/build/c/linker/elf_plt_aarch64.thr_dyn_o.d | |
| Run Cc FindCDependencies Stage1: rts/sm/Storage.c => _build/stage1/rts/build/c/sm/Storage.l_dyn_o.d | |
| Run Cc FindCDependencies Stage1: rts/Timer.c => _build/stage1/rts/build/c/Timer.thr_dyn_o.d | |
| Run Cc FindCDependencies Stage1: rts/Hash.c => _build/stage1/rts/build/c/Hash.thr_o.d | |
| Run Cc FindCDependencies Stage1: rts/RtsFlags.c => _build/stage1/rts/build/c/RtsFlags.o.d |
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 RankNTypes #-} | |
{-# LANGUAGE RecursiveDo #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
-- | A simple graph library | |
module Graph | |
( -- * Creating graphs | |
runGraph | |
, newGraph | |
, node |
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
{ pkgs ? import <nixpkgs> {} | |
, compiler ? "ghc822" | |
}: | |
with pkgs; | |
let | |
ghc = haskell.packages.${compiler}.ghcWithPackages (ps: with ps; [ cabal-install ]); | |
in |
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
--- | |
title: Why is servant a type-level DSL? | |
author: Alp Mestanogullari | |
date: 2018-07-43 20:00 | |
toc: true | |
--- | |
--- | |
This post is an attempt at explaining servant's design as an embedded domain |
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 #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Proxy | |
import GHC.TypeLits | |
import Servant.API |
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
type Flat api = Reassoc (Flatten api) | |
-- | Completely flattens an API type by applying a few simple transformations. | |
-- The goal is to end up with an aPI type where things like @a :> (b :<|> c)@ | |
-- are rewritten to @a :> b :<|> a :> c@, so as to have client with very simple | |
-- types, instead of "nested clients". | |
type family Flatten (api :: k) :: k where | |
Flatten ((a :: k) :> (b :<|> c)) = a :> Flatten b :<|> Flatten (a :> c) | |
Flatten ((a :<|> b) :> c) = a :> Flatten c :<|> (Flatten (b :> c)) | |
Flatten ((a :: k) :> b) = Redex b (Flatten b) a |
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
{ | |
packageOverrides = ps: rec { | |
haskell.compiler = ps.haskell.compiler // { | |
myghc = ps.haskell.compiler.ghcHEAD.overrideDerivation (p: { | |
src = fetchgit { | |
url = "git://git.haskell.org/ghc.git"; | |
rev = "commit hash here"; | |
sha256 = "sha that nix computes for this"; | |
}; | |
}); |
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 #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Data.Proxy | |
import GHC.TypeLits | |
import Servant.API | |
infixr 9 >:> | |
infixr 8 <||> |
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
{- | |
$ curl -X POST localhost:9876/dog -v | |
* Connected to localhost (127.0.0.1) port 9876 (#0) | |
> POST /dog HTTP/1.1 | |
> Host: localhost:9876 | |
> User-Agent: curl/7.55.1 | |
> Accept: */* | |
> | |
< HTTP/1.1 301 Moved Permanently | |
< Transfer-Encoding: chunked |
NewerOlder