I hereby claim:
- I am alpmestan on github.
- I am alpmestan (https://keybase.io/alpmestan) on keybase.
- I have a public key ASD90e7ZU64oz5bgOCJwgXqRtDML5sYiQk_FY0bxl3IyMwo
To claim this, I am signing this object:
{-# LANGUAGE GADTs #-} | |
import Data.Monoid | |
import System.Environment | |
data Coyoneda f a where | |
Coyoneda :: (b -> a) -> f b -> Coyoneda f a | |
instance Functor (Coyoneda f) where | |
fmap f (Coyoneda b2a fb) = Coyoneda (f . b2a) fb |
cabal install styx | |
Warning: The package list for 'hackage.haskell.org' is 26 days old. | |
Run 'cabal update' to get the latest list of available packages. | |
Resolving dependencies... | |
Configuring conduit-1.2.11... | |
Building conduit-1.2.11... | |
Installed conduit-1.2.11 | |
Configuring yaml-0.8.23.3... | |
Building yaml-0.8.23.3... | |
Installed yaml-0.8.23.3 |
I hereby claim:
To claim this, I am signing this object:
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs | |
index 32e581a10d..b320ef42ce 100644 | |
--- a/ghc/GHCi/UI.hs | |
+++ b/ghc/GHCi/UI.hs | |
@@ -76,6 +76,7 @@ import Linker | |
import Maybes ( orElse, expectJust ) | |
import NameSet | |
import Panic hiding ( showException ) | |
+import Type ( expandTypeSynonyms ) | |
import Util |
{- | |
$ 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 |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Data.Proxy | |
import GHC.TypeLits | |
import Servant.API | |
infixr 9 >:> | |
infixr 8 <||> |
{ | |
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"; | |
}; | |
}); |
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 |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Proxy | |
import GHC.TypeLits | |
import Servant.API |
--- | |
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 |