git.iko.soy/typeable/servant
on master help sign in
Dump current state
commit142681c9173ff72d2b1060025ceadeebba1aa8e8 authorGaël Deest <gael.deest@tweag.io> dateMon 21 Mar 2022, 16:27 (5 years ago) parent89b66a3
7 files changed+188
cabal.project+1 flat-64/LICENSE+30 flat-64/Main.hs+103 flat-64/Setup.hs+2 flat-64/flat-64.cabal+28 nix/nixpkgs2.nix+4 nix/shell2.nix+20
cabal.project+1
@@ -14,6 +14,7 @@ packages:
1414 servant-server/
1515 servant-swagger/
1616 doc/tutorial/
17+ flat-64/
1718
1819-- servant streaming
1920packages:
flat-64/LICENSEnew file+30
@@ -0,0 +1,30 @@
1+Copyright (c) 2018, Daniel Bergey
2+
3+All rights reserved.
4+
5+Redistribution and use in source and binary forms, with or without
6+modification, are permitted provided that the following conditions are met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of Daniel Bergey nor the names of other
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
flat-64/Main.hsnew file+103
@@ -0,0 +1,103 @@
1+{-# LANGUAGE TypeOperators #-}
2+{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE OverloadedStrings #-}
4+module Main where
5+
6+import Data.Semigroup
7+import Data.Text (Text)
8+import Servant hiding (NotSecure)
9+import Servant.Server
10+import Network.Wai.Handler.Warp (defaultSettings, runSettings,
11+ setLogger, setPort)
12+
13+import qualified Data.Text as T
14+
15+type MainAPI =
16+ "static" :> "1" :> Get '[JSON] Text
17+ :<|> "static" :> "2" :> Get '[JSON] Text
18+ :<|> "static" :> "3" :> Get '[JSON] Text
19+ :<|> "static" :> "4" :> Get '[JSON] Text
20+ :<|> "static" :> "5" :> Get '[JSON] Text
21+ :<|> "static" :> "6" :> Get '[JSON] Text
22+ :<|> "static" :> "7" :> Get '[JSON] Text
23+ :<|> "static" :> "8" :> Get '[JSON] Text
24+ :<|> "static" :> "9" :> Get '[JSON] Text
25+ :<|> "static" :> "10" :> Get '[JSON] Text
26+ :<|> "static" :> "11" :> Get '[JSON] Text
27+ :<|> "static" :> "12" :> Get '[JSON] Text
28+ :<|> "static" :> "13" :> Get '[JSON] Text
29+ :<|> "static" :> "14" :> Get '[JSON] Text
30+ :<|> "static" :> "15" :> Get '[JSON] Text
31+ :<|> "static" :> "16" :> Get '[JSON] Text
32+ :<|> "static" :> "17" :> Get '[JSON] Text
33+ :<|> "static" :> "18" :> Get '[JSON] Text
34+ :<|> "static" :> "19" :> Get '[JSON] Text
35+ :<|> "static" :> "20" :> Get '[JSON] Text
36+ :<|> "static" :> "21" :> Get '[JSON] Text
37+ :<|> "static" :> "22" :> Get '[JSON] Text
38+ :<|> "static" :> "23" :> Get '[JSON] Text
39+ :<|> "static" :> "24" :> Get '[JSON] Text
40+ :<|> "static" :> "25" :> Get '[JSON] Text
41+ :<|> "static" :> "26" :> Get '[JSON] Text
42+ :<|> "static" :> "27" :> Get '[JSON] Text
43+ :<|> "static" :> "28" :> Get '[JSON] Text
44+ :<|> "static" :> "29" :> Get '[JSON] Text
45+ :<|> "static" :> "30" :> Get '[JSON] Text
46+ :<|> "static" :> "31" :> Get '[JSON] Text
47+ :<|> "static" :> "32" :> Get '[JSON] Text
48+ :<|> "static" :> "33" :> Get '[JSON] Text
49+ :<|> "static" :> "34" :> Get '[JSON] Text
50+ :<|> "static" :> "35" :> Get '[JSON] Text
51+ :<|> "static" :> "36" :> Get '[JSON] Text
52+ :<|> "static" :> "37" :> Get '[JSON] Text
53+ :<|> "static" :> "38" :> Get '[JSON] Text
54+ :<|> "static" :> "39" :> Get '[JSON] Text
55+ :<|> "static" :> "40" :> Get '[JSON] Text
56+ :<|> "static" :> "41" :> Get '[JSON] Text
57+ :<|> "static" :> "42" :> Get '[JSON] Text
58+ :<|> "static" :> "43" :> Get '[JSON] Text
59+ :<|> "static" :> "44" :> Get '[JSON] Text
60+ :<|> "static" :> "45" :> Get '[JSON] Text
61+ :<|> "static" :> "46" :> Get '[JSON] Text
62+ :<|> "static" :> "47" :> Get '[JSON] Text
63+ :<|> "static" :> "48" :> Get '[JSON] Text
64+ :<|> "static" :> "49" :> Get '[JSON] Text
65+ :<|> "static" :> "50" :> Get '[JSON] Text
66+ :<|> "static" :> "51" :> Get '[JSON] Text
67+ :<|> "static" :> "52" :> Get '[JSON] Text
68+ :<|> "static" :> "53" :> Get '[JSON] Text
69+ :<|> "static" :> "54" :> Get '[JSON] Text
70+ :<|> "static" :> "55" :> Get '[JSON] Text
71+ :<|> "static" :> "56" :> Get '[JSON] Text
72+ :<|> "static" :> "57" :> Get '[JSON] Text
73+ :<|> "static" :> "58" :> Get '[JSON] Text
74+ :<|> "static" :> "59" :> Get '[JSON] Text
75+ :<|> "static" :> "60" :> Get '[JSON] Text
76+ :<|> "static" :> "61" :> Get '[JSON] Text
77+ :<|> "static" :> "62" :> Get '[JSON] Text
78+ :<|> "static" :> "63" :> Get '[JSON] Text
79+ :<|> "static" :> "64" :> Get '[JSON] Text
80+
81+mainServer :: Server MainAPI
82+mainServer = foo :<|> foo :<|> foo :<|> foo
83+ :<|> foo :<|> foo :<|> foo :<|> foo
84+ :<|> foo :<|> foo :<|> foo :<|> foo
85+ :<|> foo :<|> foo :<|> foo :<|> foo
86+ :<|> foo :<|> foo :<|> foo :<|> foo
87+ :<|> foo :<|> foo :<|> foo :<|> foo
88+ :<|> foo :<|> foo :<|> foo :<|> foo
89+ :<|> foo :<|> foo :<|> foo :<|> foo
90+ :<|> foo :<|> foo :<|> foo :<|> foo
91+ :<|> foo :<|> foo :<|> foo :<|> foo
92+ :<|> foo :<|> foo :<|> foo :<|> foo
93+ :<|> foo :<|> foo :<|> foo :<|> foo
94+ :<|> foo :<|> foo :<|> foo :<|> foo
95+ :<|> foo :<|> foo :<|> foo :<|> foo
96+ :<|> foo :<|> foo :<|> foo :<|> foo
97+ :<|> foo :<|> foo :<|> foo :<|> foo
98+
99+foo = return "foo"
100+
101+main :: IO ()
102+main = runSettings defaultSettings $
103+ serveWithContext (Proxy :: Proxy MainAPI) EmptyContext mainServer
flat-64/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
flat-64/flat-64.cabalnew file+28
@@ -0,0 +1,28 @@
1+-- Initial servant-bench.cabal generated by cabal init. For further
2+-- documentation, see http://haskell.org/cabal/users-guide/
3+
4+name: flat64
5+version: 0.1.0.0
6+synopsis: Compare build times with different API type structure
7+-- description:
8+license: BSD3
9+license-file: LICENSE
10+author: Daniel Bergey
11+maintainer: bergey@teallabs.org
12+-- copyright:
13+category: Development
14+build-type: Simple
15+cabal-version: >=1.10
16+
17+executable servant-bench
18+ main-is: Main.hs
19+ -- other-modules:
20+ -- other-extensions:
21+ build-depends: base
22+ , servant
23+ , servant-server
24+ , text
25+ , warp
26+ -- hs-source-dirs:
27+ default-language: Haskell2010
28+ ghc-options: -fforce-recomp -O2
nix/nixpkgs2.nixnew file+4
@@ -0,0 +1,4 @@
1+import (builtins.fetchTarball {
2+ url = "https://github.com/NixOS/nixpkgs/archive/2c66a7a6e036971c4847cca424125f55b9eb0b0b.tar.gz";
3+ sha256 = "sha256:00pdg5mkgqp81n4pfgigd840hvh3fwwkbipcba1p4ds3ffy3xir5";
4+}) {}
nix/shell2.nixnew file+20
@@ -0,0 +1,20 @@
1+{ compiler ? "ghc8107"
2+, tutorial ? false
3+, pkgs ? import ./nixpkgs2.nix
4+}:
5+
6+ with pkgs;
7+
8+ let
9+ ghc = haskell.packages.${compiler}.ghcWithPackages (_: []);
10+ docstuffs = python3.withPackages (ps: with ps; [ recommonmark sphinx sphinx_rtd_theme ]);
11+ in
12+ stdenv.mkDerivation {
13+ name = "servant-dev";
14+ buildInputs = [ ghc zlib python3 wget cabal-install postgresql openssl stack haskellPackages.hspec-discover bench ]
15+ ++ (if tutorial then [docstuffs postgresql] else []);
16+ shellHook = ''
17+ eval $(grep export ${ghc}/bin/ghc)
18+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"${zlib}/lib";
19+ '';
20+ }