From fa2036ab1af31391c46109206e01dad3fbc8210b Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Wed, 8 Apr 2020 21:41:11 +0100 Subject: [PATCH 1/6] Add ghc-8.10.1 --- 8.10/Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 8.10/Dockerfile diff --git a/8.10/Dockerfile b/8.10/Dockerfile new file mode 100644 index 0000000..7508ccb --- /dev/null +++ b/8.10/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:buster + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr && \ + rm -rf /var/lib/apt/lists/* + +ARG GHC=8.10.1 +ARG STACK=2.1.3 +ARG CABAL_INSTALL=3.0 + +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574 && \ + echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + cabal-install-${CABAL_INSTALL} \ + curl \ + g++ \ + ghc-${GHC} \ + git \ + libsqlite3-dev \ + libtinfo-dev \ + make \ + netbase \ + openssh-client \ + xz-utils \ + zlib1g-dev && \ + rm -rf /var/lib/apt/lists/* + +RUN export GNUPGHOME="$(mktemp -d)" && \ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 2C6A674E85EE3FB896AFC9B965101FF31C5C154D && \ + curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \ + curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \ + gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \ + tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \ + /usr/local/bin/stack config set system-ghc --global true && \ + /usr/local/bin/stack config set install-ghc --global false && \ + rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz + +ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH + +CMD ["ghci"] From 07635e83b0e7d284ef086c04dfeb5eb42e8114be Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Wed, 8 Apr 2020 22:51:56 +0100 Subject: [PATCH 2/6] Use cabal-install 3.2 with ghc 8.10.1 --- 8.10/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.10/Dockerfile b/8.10/Dockerfile index 7508ccb..e252ae2 100644 --- a/8.10/Dockerfile +++ b/8.10/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update && \ ARG GHC=8.10.1 ARG STACK=2.1.3 -ARG CABAL_INSTALL=3.0 +ARG CABAL_INSTALL=3.2 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574 && \ echo 'deb http://downloads.haskell.org/debian buster main' > /etc/apt/sources.list.d/ghc.list && \ From 9bae1a854181cd74fb9ed4ca37cac9e7c6ad06f8 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Wed, 8 Apr 2020 22:52:10 +0100 Subject: [PATCH 3/6] Add example for ghc-8.10.1 --- examples/8.0/servant-api/Dockerfile | 2 +- examples/8.10/servant-api/Dockerfile | 9 +++ examples/8.10/servant-api/LICENSE | 30 ++++++++ examples/8.10/servant-api/Setup.hs | 2 + examples/8.10/servant-api/app/Main.hs | 6 ++ examples/8.10/servant-api/cabal.project.local | 6 ++ .../servant-api/dist-newstyle/cache/compiler | Bin 0 -> 12503 bytes .../servant-api/dist-newstyle/cache/config | Bin 0 -> 4937 bytes examples/8.10/servant-api/servant-api.cabal | 45 ++++++++++++ examples/8.10/servant-api/src/Lib.hs | 39 ++++++++++ examples/8.10/servant-api/stack.yaml | 69 ++++++++++++++++++ examples/8.10/servant-api/test/Spec.hs | 2 + 12 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 examples/8.10/servant-api/Dockerfile create mode 100644 examples/8.10/servant-api/LICENSE create mode 100644 examples/8.10/servant-api/Setup.hs create mode 100644 examples/8.10/servant-api/app/Main.hs create mode 100644 examples/8.10/servant-api/cabal.project.local create mode 100644 examples/8.10/servant-api/dist-newstyle/cache/compiler create mode 100644 examples/8.10/servant-api/dist-newstyle/cache/config create mode 100644 examples/8.10/servant-api/servant-api.cabal create mode 100644 examples/8.10/servant-api/src/Lib.hs create mode 100644 examples/8.10/servant-api/stack.yaml create mode 100644 examples/8.10/servant-api/test/Spec.hs diff --git a/examples/8.0/servant-api/Dockerfile b/examples/8.0/servant-api/Dockerfile index 26715b2..69e732f 100644 --- a/examples/8.0/servant-api/Dockerfile +++ b/examples/8.0/servant-api/Dockerfile @@ -1,4 +1,4 @@ -FROM haskell:8 +FROM haskell:8.10 COPY . /opt/servant-api diff --git a/examples/8.10/servant-api/Dockerfile b/examples/8.10/servant-api/Dockerfile new file mode 100644 index 0000000..69e732f --- /dev/null +++ b/examples/8.10/servant-api/Dockerfile @@ -0,0 +1,9 @@ +FROM haskell:8.10 + +COPY . /opt/servant-api + +WORKDIR /opt/servant-api + +RUN stack build + +CMD ["stack","exec","servant-api-exe"] diff --git a/examples/8.10/servant-api/LICENSE b/examples/8.10/servant-api/LICENSE new file mode 100644 index 0000000..fc03544 --- /dev/null +++ b/examples/8.10/servant-api/LICENSE @@ -0,0 +1,30 @@ +Copyright Author name here (c) 2016 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Author name here nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/examples/8.10/servant-api/Setup.hs b/examples/8.10/servant-api/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/examples/8.10/servant-api/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/examples/8.10/servant-api/app/Main.hs b/examples/8.10/servant-api/app/Main.hs new file mode 100644 index 0000000..f66a415 --- /dev/null +++ b/examples/8.10/servant-api/app/Main.hs @@ -0,0 +1,6 @@ +module Main where + +import Lib + +main :: IO () +main = startApp diff --git a/examples/8.10/servant-api/cabal.project.local b/examples/8.10/servant-api/cabal.project.local new file mode 100644 index 0000000..55d7e95 --- /dev/null +++ b/examples/8.10/servant-api/cabal.project.local @@ -0,0 +1,6 @@ + +package * + ghc-location: ghc + +program-locations + ghc-location: ghc diff --git a/examples/8.10/servant-api/dist-newstyle/cache/compiler b/examples/8.10/servant-api/dist-newstyle/cache/compiler new file mode 100644 index 0000000000000000000000000000000000000000..066038d50aa664fbe8edf400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nRx&J>ylg|fE_@4(Hp8p4WQd^t= literal 0 HcmV?d00001 diff --git a/examples/8.10/servant-api/dist-newstyle/cache/config b/examples/8.10/servant-api/dist-newstyle/cache/config new file mode 100644 index 0000000000000000000000000000000000000000..cf899721894a0ab177f1b669e2050a161222e2c4 GIT binary patch literal 4937 zcmeHLO=u)V6z-m%O+v_KCH_RbjI4qR(_Pg){TC3kt`P#s`m-#82cf$9^-P=jqq}3W z9t1CfH$g!~1TWsadDENT6%pdelk7#jd$oF|UUie58H@~M4|X8$)%*GCy{cEQt4Gr& zk3J<@vsRPbmSJX)zQcxjn~f8Lvyk;``q{>x+h^Z?_SC0uee&_sf4!!x56nBlIx|m_ ze&5VeZbl=11Zlg+vLg^8IAw!zA2QQ7D5(OQ6JTSUj@|~I8~qWN(|q_!?SqeAxckG; zH^2X}jzJwRX_`0%co&)q_vPi_maF%86>z$ECLaysq+8Q}Nq_(QyKl5VUTnPi%)MVf zm+Orw7DFAkLpP*W)5YKPsVVNt6u8)wFTN&Mq#o`5i*G|>)Y*89I5X$lK06&tTO=D% zlI86ooMidkJ}mV9@~7_m=!P?jqFLy(eRj`3=hMg`%NINSw*THar(#%H--YfoSM{PE z58Zc+FrxWIA}y9wmJ$sEUo*_-rj>I}u`U$nR2ZsQvyv@26e880oKg4vQ8zQg8kSJXOF|y@`I!q9K|3CXV&Cezn4HAir)V z!w61|UOwnc8OFNRo5o_uo@R{Ft~6=(@_f95hKRMm0ZnuhIi#vIG4$OSY@0g7a*68` zD+b1?0}ky(K^Oq@?HIrh-8hEWqqgmIyntEY`jOvZ5qCo(k#{MuAY``19m|a<=K*D* z016}9?ErTm0H24hM}>dKqrPXwE?90%7OvG!;xM03E9!JQk?#?1BMxB>_dv|WBN|dCCNy?phceq{QN%oO9Vg@@ zCLwXD6Efz5<CJ8%2A-L9Miz$^~8pQktQp zl4ONNEJe#8QB;WvMMz8I*&N!PqnN+8Ug`Tq?8VOOdR-HYN?-WSHp3S&Cb)92e{=8F z?L9f!BbF%n){W!5H%ePWHh@+SQjp3mdD+^P)Zn9mR9&0nBGrnJqM>CwrrAyM-f>tU zNcLD{RlUDmPk}`PoLT`$rpOpmc=lgoR#2|*50gA${g%8SwsH{nNR~q@PDg`QmW!S& z%^!ZX4=jUL2GDwa@5W1qd&U5pMEwm25f$UX@iM8xMh0p9AW;F}gyoeEC6`52l;RRL zF9x-b^9&wzIlfREp{SBIaSof>Y7w(IYIt>?rhu!VH5p_hY}{q{xrzt7ppatT%B_CF zlKX^>6PBtQvob}q2RSy35h(`0iOV2958H5xEntp#<&Y&qqnDM-hxoEbG#5=YoCY?jl$>Kx8|jCK{=1.10 + +library + hs-source-dirs: src + exposed-modules: Lib + build-depends: base >= 4.7 && < 5 + , aeson + , servant-server + , wai + , warp + default-language: Haskell2010 + +executable servant-api-exe + hs-source-dirs: app + main-is: Main.hs + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: base + , servant-api + default-language: Haskell2010 + +test-suite servant-api-test + type: exitcode-stdio-1.0 + hs-source-dirs: test + main-is: Spec.hs + build-depends: base + , servant-api + ghc-options: -threaded -rtsopts -with-rtsopts=-N + default-language: Haskell2010 + +source-repository head + type: git + location: https://github.com/githubuser/servant-api diff --git a/examples/8.10/servant-api/src/Lib.hs b/examples/8.10/servant-api/src/Lib.hs new file mode 100644 index 0000000..f985cc0 --- /dev/null +++ b/examples/8.10/servant-api/src/Lib.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeOperators #-} +module Lib + ( startApp + ) where + +import Data.Aeson +import Data.Aeson.TH +import Network.Wai +import Network.Wai.Handler.Warp +import Servant + +data User = User + { userId :: Int + , userFirstName :: String + , userLastName :: String + } deriving (Eq, Show) + +$(deriveJSON defaultOptions ''User) + +type API = "users" :> Get '[JSON] [User] + +startApp :: IO () +startApp = run 8080 app + +app :: Application +app = serve api server + +api :: Proxy API +api = Proxy + +server :: Server API +server = return users + +users :: [User] +users = [ User 1 "Isaac" "Newton" + , User 2 "Albert" "Einstein" + ] diff --git a/examples/8.10/servant-api/stack.yaml b/examples/8.10/servant-api/stack.yaml new file mode 100644 index 0000000..110dcc6 --- /dev/null +++ b/examples/8.10/servant-api/stack.yaml @@ -0,0 +1,69 @@ +# This file was automatically generated by 'stack init' +# +# Some commonly used options have been documented as comments in this file. +# For advanced use and comprehensive documentation of the format, please see: +# http://docs.haskellstack.org/en/stable/yaml_configuration/ + +# Resolver to choose a 'specific' stackage snapshot or a compiler version. +# A snapshot resolver dictates the compiler version and the set of packages +# to be used for project dependencies. For example: +# +# resolver: lts-3.5 +# resolver: nightly-2015-09-21 +# resolver: ghc-7.10.2 +# resolver: ghcjs-0.1.0_ghc-7.10.2 +# resolver: +# name: custom-snapshot +# location: "./custom-snapshot.yaml" +resolver: nightly-2020-04-08 + +# There is no snapshot that includes ghc-8.10.1 yet +compiler: ghc-8.10.1 + +# User packages to be built. +# Various formats can be used as shown in the example below. +# +# packages: +# - some-directory +# - https://example.com/foo/bar/baz-0.0.2.tar.gz +# - location: +# git: https://github.com/commercialhaskell/stack.git +# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a +# extra-dep: true +# subdirs: +# - auto-update +# - wai +# +# A package marked 'extra-dep: true' will only be built if demanded by a +# non-dependency (i.e. a user package), and its test suites and benchmarks +# will not be run. This is useful for tweaking upstream packages. +packages: +- '.' +# Dependency packages to be pulled from upstream that are not in the resolver +# (e.g., acme-missiles-0.3) +extra-deps: [] + +# Override default flag values for local packages and extra-deps +flags: {} + +# Extra package databases containing global packages +extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +system-ghc: true +# +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: ">=1.1" +# +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 +# +# Extra directories used by stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] +# +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor diff --git a/examples/8.10/servant-api/test/Spec.hs b/examples/8.10/servant-api/test/Spec.hs new file mode 100644 index 0000000..cd4753f --- /dev/null +++ b/examples/8.10/servant-api/test/Spec.hs @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "Test suite not yet implemented" From 16a80ffe234746d766571f30fc012b798f068bf9 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Thu, 9 Apr 2020 09:21:48 +0100 Subject: [PATCH 4/6] Use stack 2.3.0.1 with ghc 8.10 --- 8.10/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/8.10/Dockerfile b/8.10/Dockerfile index e252ae2..edb04e2 100644 --- a/8.10/Dockerfile +++ b/8.10/Dockerfile @@ -5,7 +5,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* ARG GHC=8.10.1 -ARG STACK=2.1.3 +ARG STACK=2.3.0.1 ARG CABAL_INSTALL=3.2 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574 && \ @@ -27,7 +27,7 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43 rm -rf /var/lib/apt/lists/* RUN export GNUPGHOME="$(mktemp -d)" && \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 2C6A674E85EE3FB896AFC9B965101FF31C5C154D && \ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys E17D38358F72BEF7 && \ curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \ curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \ gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \ From 3a41a256f27d96872540eb9b6b3bd68441bb940e Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Fri, 10 Apr 2020 08:43:29 +0100 Subject: [PATCH 5/6] Remove ghc-8.10 example servant-server was not actually compatible with base-4.14 yet. Instead to test it, I just tried installing some popular packages, e.g. `aeson`. --- examples/7.10/snap/.dockerignore | 1 - examples/7.10/snap/.ghci | 4 - examples/7.10/snap/Dockerfile | 19 --- examples/7.10/snap/site_key.txt | Bin 96 -> 0 bytes examples/7.10/snap/snap-example.cabal | 63 ---------- .../snap/snaplets/heist/templates/_login.tpl | 9 -- .../snaplets/heist/templates/_new_user.tpl | 5 - .../snap/snaplets/heist/templates/base.tpl | 13 -- .../snap/snaplets/heist/templates/index.tpl | 19 --- .../snap/snaplets/heist/templates/login.tpl | 3 - .../snaplets/heist/templates/new_user.tpl | 3 - .../snaplets/heist/templates/userform.tpl | 14 --- examples/7.10/snap/src/Application.hs | 31 ----- examples/7.10/snap/src/Main.hs | 114 ------------------ examples/7.10/snap/src/Site.hs | 89 -------------- examples/7.10/snap/static/screen.css | 26 ---- examples/7.8/snap/.ghci | 4 - examples/7.8/snap/Dockerfile | 21 ---- examples/7.8/snap/README.md | 16 --- examples/7.8/snap/server/.ghci | 4 - examples/7.8/snap/server/snap-example.cabal | 63 ---------- .../snaplets/heist/templates/_login.tpl | 9 -- .../snaplets/heist/templates/_new_user.tpl | 5 - .../server/snaplets/heist/templates/base.tpl | 13 -- .../server/snaplets/heist/templates/index.tpl | 19 --- .../server/snaplets/heist/templates/login.tpl | 3 - .../snaplets/heist/templates/new_user.tpl | 3 - .../snaplets/heist/templates/userform.tpl | 14 --- examples/7.8/snap/server/src/Application.hs | 31 ----- examples/7.8/snap/server/src/Main.hs | 114 ------------------ examples/7.8/snap/server/src/Site.hs | 89 -------------- examples/7.8/snap/server/static/screen.css | 26 ---- examples/8.0/servant-api/Dockerfile | 9 -- examples/8.0/servant-api/LICENSE | 30 ----- examples/8.0/servant-api/Setup.hs | 2 - examples/8.0/servant-api/app/Main.hs | 6 - examples/8.0/servant-api/servant-api.cabal | 45 ------- examples/8.0/servant-api/src/Lib.hs | 39 ------ examples/8.0/servant-api/stack.yaml | 66 ---------- examples/8.0/servant-api/test/Spec.hs | 2 - examples/8.10/servant-api/Dockerfile | 9 -- examples/8.10/servant-api/LICENSE | 30 ----- examples/8.10/servant-api/Setup.hs | 2 - examples/8.10/servant-api/app/Main.hs | 6 - examples/8.10/servant-api/cabal.project.local | 6 - .../servant-api/dist-newstyle/cache/compiler | Bin 12503 -> 0 bytes .../servant-api/dist-newstyle/cache/config | Bin 4937 -> 0 bytes examples/8.10/servant-api/servant-api.cabal | 45 ------- examples/8.10/servant-api/src/Lib.hs | 39 ------ examples/8.10/servant-api/stack.yaml | 69 ----------- examples/8.10/servant-api/test/Spec.hs | 2 - 51 files changed, 1254 deletions(-) delete mode 100644 examples/7.10/snap/.dockerignore delete mode 100644 examples/7.10/snap/.ghci delete mode 100644 examples/7.10/snap/Dockerfile delete mode 100644 examples/7.10/snap/site_key.txt delete mode 100644 examples/7.10/snap/snap-example.cabal delete mode 100644 examples/7.10/snap/snaplets/heist/templates/_login.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/_new_user.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/base.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/index.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/login.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/new_user.tpl delete mode 100644 examples/7.10/snap/snaplets/heist/templates/userform.tpl delete mode 100644 examples/7.10/snap/src/Application.hs delete mode 100644 examples/7.10/snap/src/Main.hs delete mode 100644 examples/7.10/snap/src/Site.hs delete mode 100644 examples/7.10/snap/static/screen.css delete mode 100644 examples/7.8/snap/.ghci delete mode 100644 examples/7.8/snap/Dockerfile delete mode 100644 examples/7.8/snap/README.md delete mode 100644 examples/7.8/snap/server/.ghci delete mode 100644 examples/7.8/snap/server/snap-example.cabal delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/_login.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/_new_user.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/base.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/index.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/login.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/new_user.tpl delete mode 100644 examples/7.8/snap/server/snaplets/heist/templates/userform.tpl delete mode 100644 examples/7.8/snap/server/src/Application.hs delete mode 100644 examples/7.8/snap/server/src/Main.hs delete mode 100644 examples/7.8/snap/server/src/Site.hs delete mode 100644 examples/7.8/snap/server/static/screen.css delete mode 100644 examples/8.0/servant-api/Dockerfile delete mode 100644 examples/8.0/servant-api/LICENSE delete mode 100644 examples/8.0/servant-api/Setup.hs delete mode 100644 examples/8.0/servant-api/app/Main.hs delete mode 100644 examples/8.0/servant-api/servant-api.cabal delete mode 100644 examples/8.0/servant-api/src/Lib.hs delete mode 100644 examples/8.0/servant-api/stack.yaml delete mode 100644 examples/8.0/servant-api/test/Spec.hs delete mode 100644 examples/8.10/servant-api/Dockerfile delete mode 100644 examples/8.10/servant-api/LICENSE delete mode 100644 examples/8.10/servant-api/Setup.hs delete mode 100644 examples/8.10/servant-api/app/Main.hs delete mode 100644 examples/8.10/servant-api/cabal.project.local delete mode 100644 examples/8.10/servant-api/dist-newstyle/cache/compiler delete mode 100644 examples/8.10/servant-api/dist-newstyle/cache/config delete mode 100644 examples/8.10/servant-api/servant-api.cabal delete mode 100644 examples/8.10/servant-api/src/Lib.hs delete mode 100644 examples/8.10/servant-api/stack.yaml delete mode 100644 examples/8.10/servant-api/test/Spec.hs diff --git a/examples/7.10/snap/.dockerignore b/examples/7.10/snap/.dockerignore deleted file mode 100644 index 1521c8b..0000000 --- a/examples/7.10/snap/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/examples/7.10/snap/.ghci b/examples/7.10/snap/.ghci deleted file mode 100644 index a882c32..0000000 --- a/examples/7.10/snap/.ghci +++ /dev/null @@ -1,4 +0,0 @@ -:set -isrc -:set -hide-package MonadCatchIO-mtl -:set -hide-package monads-fd -:set -XOverloadedStrings diff --git a/examples/7.10/snap/Dockerfile b/examples/7.10/snap/Dockerfile deleted file mode 100644 index ca58d81..0000000 --- a/examples/7.10/snap/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM haskell:7.10 - -WORKDIR /opt/server - -RUN cabal update - -# Add just the .cabal file to capture dependencies -COPY ./snap-example.cabal /opt/server/snap-example.cabal - -# Docker will cache this command as a layer, freeing us up to -# modify source code without re-installing dependencies -# (unless the .cabal file changes!) -RUN cabal install --only-dependencies -j4 - -# Add and Install Application Code -COPY . /opt/server -RUN cabal install - -CMD ["snap-example"] diff --git a/examples/7.10/snap/site_key.txt b/examples/7.10/snap/site_key.txt deleted file mode 100644 index 9ea55c06a3051e7726edb34fe1b108bef8d66903..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmV-m0H6PB{Z7h9#Ph`=qvz+N7gpwgZEr?hC@!=k2ct-{uS&6Iw)-@#oCGEja2kGB z>X0wVG9?c#B&(gwd+In7tzf8T1Muvq;Z>NOkgDw$$-C%$Kx@Kfz4%Vn0Mhxq)O%zN C$1!^V diff --git a/examples/7.10/snap/snap-example.cabal b/examples/7.10/snap/snap-example.cabal deleted file mode 100644 index 87af735..0000000 --- a/examples/7.10/snap/snap-example.cabal +++ /dev/null @@ -1,63 +0,0 @@ -Name: snap-example -Version: 0.1 -Synopsis: Project Synopsis Here -Description: Project Description Here -License: AllRightsReserved -Author: Author -Maintainer: maintainer@example.com -Stability: Experimental -Category: Web -Build-type: Simple -Cabal-version: >=1.2 - -Flag development - Description: Whether to build the server in development (interpreted) mode - Default: False - -Flag old-base - default: False - manual: False - -Executable snap-example - hs-source-dirs: src - main-is: Main.hs - - Build-depends: - bytestring >= 0.9.1 && < 0.11, - heist >= 0.14 && < 0.15, - MonadCatchIO-transformers >= 0.2.1 && < 0.4, - mtl >= 2 && < 3, - snap >= 0.13 && < 0.15, - snap-core >= 0.9 && < 0.10, - snap-server >= 0.9 && < 0.10, - snap-loader-static >= 0.9 && < 0.10, - text >= 0.11 && < 1.3, - time >= 1.1 && < 1.6, - xmlhtml >= 0.1 && < 0.3 - - if flag(old-base) - build-depends: - base >= 4 && < 4.4, - lens >= 3.7.6 && < 3.8 - else - build-depends: - base >= 4.4 && < 5, - lens >= 3.7.6 && < 4.13 - - if flag(development) - build-depends: - snap-loader-dynamic == 0.10.* - cpp-options: -DDEVELOPMENT - -- In development mode, speed is already going to suffer, so skip - -- the fancy optimization flags. Additionally, disable all - -- warnings. The hint library doesn't give an option to execute - -- compiled code when there were also warnings, so disabling - -- warnings allows quicker workflow. - ghc-options: -threaded -w - else - if impl(ghc >= 6.12.0) - ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2 - -fno-warn-orphans -fno-warn-unused-do-bind - else - ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2 - -fno-warn-orphans diff --git a/examples/7.10/snap/snaplets/heist/templates/_login.tpl b/examples/7.10/snap/snaplets/heist/templates/_login.tpl deleted file mode 100644 index b646e7c..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/_login.tpl +++ /dev/null @@ -1,9 +0,0 @@ -

Snap Example App Login

- -

- -/login -Login - - -

Don't have a login yet? Create a new user

diff --git a/examples/7.10/snap/snaplets/heist/templates/_new_user.tpl b/examples/7.10/snap/snaplets/heist/templates/_new_user.tpl deleted file mode 100644 index 5a9a332..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/_new_user.tpl +++ /dev/null @@ -1,5 +0,0 @@ -

Register a new user

- -/new_user -Add User - diff --git a/examples/7.10/snap/snaplets/heist/templates/base.tpl b/examples/7.10/snap/snaplets/heist/templates/base.tpl deleted file mode 100644 index e4e8127..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/base.tpl +++ /dev/null @@ -1,13 +0,0 @@ - - - Snap web server - - - -
- - - -
- - diff --git a/examples/7.10/snap/snaplets/heist/templates/index.tpl b/examples/7.10/snap/snaplets/heist/templates/index.tpl deleted file mode 100644 index 370dad5..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/index.tpl +++ /dev/null @@ -1,19 +0,0 @@ - - - -

- This is a simple demo page served using - Heist - and the Snap web framework. -

- -

Congrats! You're logged in as ''

- -

Logout

-
- - - - - -
diff --git a/examples/7.10/snap/snaplets/heist/templates/login.tpl b/examples/7.10/snap/snaplets/heist/templates/login.tpl deleted file mode 100644 index 29dc2fe..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/login.tpl +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/7.10/snap/snaplets/heist/templates/new_user.tpl b/examples/7.10/snap/snaplets/heist/templates/new_user.tpl deleted file mode 100644 index aa0fe53..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/new_user.tpl +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/7.10/snap/snaplets/heist/templates/userform.tpl b/examples/7.10/snap/snaplets/heist/templates/userform.tpl deleted file mode 100644 index 0f8a8fc..0000000 --- a/examples/7.10/snap/snaplets/heist/templates/userform.tpl +++ /dev/null @@ -1,14 +0,0 @@ -
- - - - - - - - - - - -
Login:
Password:
-
diff --git a/examples/7.10/snap/src/Application.hs b/examples/7.10/snap/src/Application.hs deleted file mode 100644 index 8378832..0000000 --- a/examples/7.10/snap/src/Application.hs +++ /dev/null @@ -1,31 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - ------------------------------------------------------------------------------- --- | This module defines our application's state type and an alias for its --- handler monad. -module Application where - ------------------------------------------------------------------------------- -import Control.Lens -import Snap.Snaplet -import Snap.Snaplet.Heist -import Snap.Snaplet.Auth -import Snap.Snaplet.Session - ------------------------------------------------------------------------------- -data App = App - { _heist :: Snaplet (Heist App) - , _sess :: Snaplet SessionManager - , _auth :: Snaplet (AuthManager App) - } - -makeLenses ''App - -instance HasHeist App where - heistLens = subSnaplet heist - - ------------------------------------------------------------------------------- -type AppHandler = Handler App App - - diff --git a/examples/7.10/snap/src/Main.hs b/examples/7.10/snap/src/Main.hs deleted file mode 100644 index cad1698..0000000 --- a/examples/7.10/snap/src/Main.hs +++ /dev/null @@ -1,114 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -{- - -NOTE: Don't modify this file unless you know what you are doing. If you are -new to snap, start with Site.hs and Application.hs. This file contains -boilerplate needed for dynamic reloading and is not meant for general -consumption. - -Occasionally if we modify the way the dynamic reloader works and you want to -upgrade, you might have to swap out this file for a newer version. But in -most cases you'll never need to modify this code. - --} -module Main where - ------------------------------------------------------------------------------- -import Control.Exception (SomeException, try) -import qualified Data.Text as T -import Snap.Http.Server -import Snap.Snaplet -import Snap.Snaplet.Config -import Snap.Core -import System.IO -import Site - -#ifdef DEVELOPMENT -import Snap.Loader.Dynamic -#else -import Snap.Loader.Static -#endif - - ------------------------------------------------------------------------------- --- | This is the entry point for this web server application. It supports --- easily switching between interpreting source and running statically compiled --- code. --- --- In either mode, the generated program should be run from the root of the --- project tree. When it is run, it locates its templates, static content, and --- source files in development mode, relative to the current working directory. --- --- When compiled with the development flag, only changes to the libraries, your --- cabal file, or this file should require a recompile to be picked up. --- Everything else is interpreted at runtime. There are a few consequences of --- this. --- --- First, this is much slower. Running the interpreter takes a significant --- chunk of time (a couple tenths of a second on the author's machine, at this --- time), regardless of the simplicity of the loaded code. In order to --- recompile and re-load server state as infrequently as possible, the source --- directories are watched for updates, as are any extra directories specified --- below. --- --- Second, the generated server binary is MUCH larger, since it links in the --- GHC API (via the hint library). --- --- Third, and the reason you would ever want to actually compile with --- development mode, is that it enables a faster development cycle. You can --- simply edit a file, save your changes, and hit reload to see your changes --- reflected immediately. --- --- When this is compiled without the development flag, all the actions are --- statically compiled in. This results in faster execution, a smaller binary --- size, and having to recompile the server for any code change. --- -main :: IO () -main = do - -- Depending on the version of loadSnapTH in scope, this either enables - -- dynamic reloading, or compiles it without. The last argument to - -- loadSnapTH is a list of additional directories to watch for changes to - -- trigger reloads in development mode. It doesn't need to include source - -- directories, those are picked up automatically by the splice. - (conf, site, cleanup) <- $(loadSnapTH [| getConf |] - 'getActions - ["snaplets/heist/templates"]) - - _ <- try $ httpServe conf site :: IO (Either SomeException ()) - cleanup - - ------------------------------------------------------------------------------- --- | This action loads the config used by this application. The loaded config --- is returned as the first element of the tuple produced by the loadSnapTH --- Splice. The type is not solidly fixed, though it must be an IO action that --- produces the same type as 'getActions' takes. It also must be an instance of --- Typeable. If the type of this is changed, a full recompile will be needed to --- pick up the change, even in development mode. --- --- This action is only run once, regardless of whether development or --- production mode is in use. -getConf :: IO (Config Snap AppConfig) -getConf = commandLineAppConfig defaultConfig - - ------------------------------------------------------------------------------- --- | This function generates the the site handler and cleanup action from the --- configuration. In production mode, this action is only run once. In --- development mode, this action is run whenever the application is reloaded. --- --- Development mode also makes sure that the cleanup actions are run --- appropriately before shutdown. The cleanup action returned from loadSnapTH --- should still be used after the server has stopped handling requests, as the --- cleanup actions are only automatically run when a reload is triggered. --- --- This sample doesn't actually use the config passed in, but more --- sophisticated code might. -getActions :: Config Snap AppConfig -> IO (Snap (), IO ()) -getActions conf = do - (msgs, site, cleanup) <- runSnaplet - (appEnvironment =<< getOther conf) app - hPutStrLn stderr $ T.unpack msgs - return (site, cleanup) diff --git a/examples/7.10/snap/src/Site.hs b/examples/7.10/snap/src/Site.hs deleted file mode 100644 index 13624f4..0000000 --- a/examples/7.10/snap/src/Site.hs +++ /dev/null @@ -1,89 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - ------------------------------------------------------------------------------- --- | This module is where all the routes and handlers are defined for your --- site. The 'app' function is the initializer that combines everything --- together and is exported by this module. -module Site - ( app - ) where - ------------------------------------------------------------------------------- -import Control.Applicative -import Data.ByteString (ByteString) -import Data.Monoid -import qualified Data.Text as T -import Snap.Core -import Snap.Snaplet -import Snap.Snaplet.Auth -import Snap.Snaplet.Auth.Backends.JsonFile -import Snap.Snaplet.Heist -import Snap.Snaplet.Session.Backends.CookieSession -import Snap.Util.FileServe -import Heist -import qualified Heist.Interpreted as I ------------------------------------------------------------------------------- -import Application - - ------------------------------------------------------------------------------- --- | Render login form -handleLogin :: Maybe T.Text -> Handler App (AuthManager App) () -handleLogin authError = heistLocal (I.bindSplices errs) $ render "login" - where - errs = maybe mempty splice authError - splice err = "loginError" ## I.textSplice err - - ------------------------------------------------------------------------------- --- | Handle login submit -handleLoginSubmit :: Handler App (AuthManager App) () -handleLoginSubmit = - loginUser "login" "password" Nothing - (\_ -> handleLogin err) (redirect "/") - where - err = Just "Unknown user or password" - - ------------------------------------------------------------------------------- --- | Logs out and redirects the user to the site index. -handleLogout :: Handler App (AuthManager App) () -handleLogout = logout >> redirect "/" - - ------------------------------------------------------------------------------- --- | Handle new user form submit -handleNewUser :: Handler App (AuthManager App) () -handleNewUser = method GET handleForm <|> method POST handleFormSubmit - where - handleForm = render "new_user" - handleFormSubmit = registerUser "login" "password" >> redirect "/" - - ------------------------------------------------------------------------------- --- | The application's routes. -routes :: [(ByteString, Handler App App ())] -routes = [ ("/login", with auth handleLoginSubmit) - , ("/logout", with auth handleLogout) - , ("/new_user", with auth handleNewUser) - , ("", serveDirectory "static") - ] - - ------------------------------------------------------------------------------- --- | The application initializer. -app :: SnapletInit App App -app = makeSnaplet "app" "An snaplet example application." Nothing $ do - h <- nestSnaplet "" heist $ heistInit "templates" - s <- nestSnaplet "sess" sess $ - initCookieSessionManager "site_key.txt" "sess" (Just 3600) - - -- NOTE: We're using initJsonFileAuthManager here because it's easy and - -- doesn't require any kind of database server to run. In practice, - -- you'll probably want to change this to a more robust auth backend. - a <- nestSnaplet "auth" auth $ - initJsonFileAuthManager defAuthSettings sess "users.json" - addRoutes routes - addAuthSplices h auth - return $ App h s a - diff --git a/examples/7.10/snap/static/screen.css b/examples/7.10/snap/static/screen.css deleted file mode 100644 index b052609..0000000 --- a/examples/7.10/snap/static/screen.css +++ /dev/null @@ -1,26 +0,0 @@ -html { - padding: 0; - margin: 0; - background-color: #ffffff; - font-family: Verdana, Helvetica, sans-serif; -} -body { - padding: 0; - margin: 0; -} -a { - text-decoration: underline; -} -a :hover { - cursor: pointer; - text-decoration: underline; -} -img { - border: none; -} -#content { - padding-left: 1em; -} -#info { - font-size: 60%; -} diff --git a/examples/7.8/snap/.ghci b/examples/7.8/snap/.ghci deleted file mode 100644 index a882c32..0000000 --- a/examples/7.8/snap/.ghci +++ /dev/null @@ -1,4 +0,0 @@ -:set -isrc -:set -hide-package MonadCatchIO-mtl -:set -hide-package monads-fd -:set -XOverloadedStrings diff --git a/examples/7.8/snap/Dockerfile b/examples/7.8/snap/Dockerfile deleted file mode 100644 index cf1ed5f..0000000 --- a/examples/7.8/snap/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM haskell:7.8 - -RUN cabal update - -# Add .cabal file -ADD ./server/snap-example.cabal /opt/server/snap-example.cabal - -# Docker will cache this command as a layer, freeing us up to -# modify source code without re-installing dependencies -RUN cd /opt/server && cabal install --only-dependencies -j4 - -# Add and Install Application Code -ADD ./server /opt/server -RUN cd /opt/server && cabal install - -# Add installed cabal executables to PATH -ENV PATH /root/.cabal/bin:$PATH - -# Default Command for Container -WORKDIR /opt/server -CMD ["snap-example"] \ No newline at end of file diff --git a/examples/7.8/snap/README.md b/examples/7.8/snap/README.md deleted file mode 100644 index 7eec9fa..0000000 --- a/examples/7.8/snap/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# docker-library snap-example - -## Build Example: - -``` -docker build -t hsnap . -``` - -## Run Example: - -This command will run the example interactively mapping port 8000 -in the container to 8000 on the host. - -``` -docker run -i -t -p 8000:8000 hsnap -``` \ No newline at end of file diff --git a/examples/7.8/snap/server/.ghci b/examples/7.8/snap/server/.ghci deleted file mode 100644 index a882c32..0000000 --- a/examples/7.8/snap/server/.ghci +++ /dev/null @@ -1,4 +0,0 @@ -:set -isrc -:set -hide-package MonadCatchIO-mtl -:set -hide-package monads-fd -:set -XOverloadedStrings diff --git a/examples/7.8/snap/server/snap-example.cabal b/examples/7.8/snap/server/snap-example.cabal deleted file mode 100644 index 70f24b5..0000000 --- a/examples/7.8/snap/server/snap-example.cabal +++ /dev/null @@ -1,63 +0,0 @@ -Name: snap-example -Version: 0.1 -Synopsis: Project Synopsis Here -Description: Project Description Here -License: AllRightsReserved -Author: Author -Maintainer: maintainer@example.com -Stability: Experimental -Category: Web -Build-type: Simple -Cabal-version: >=1.2 - -Flag development - Description: Whether to build the server in development (interpreted) mode - Default: False - -Flag old-base - default: False - manual: False - -Executable snap-example - hs-source-dirs: src - main-is: Main.hs - - Build-depends: - bytestring >= 0.9.1 && < 0.11, - heist >= 0.14 && < 0.15, - MonadCatchIO-transformers >= 0.2.1 && < 0.4, - mtl >= 2 && < 3, - snap >= 0.13 && < 0.15, - snap-core >= 0.9 && < 0.10, - snap-server >= 0.9 && < 0.10, - snap-loader-static >= 0.9 && < 0.10, - text >= 0.11 && < 1.3, - time >= 1.1 && < 1.6, - xmlhtml >= 0.1 && < 0.3 - - if flag(old-base) - build-depends: - base >= 4 && < 4.4, - lens >= 3.7.6 && < 3.8 - else - build-depends: - base >= 4.4 && < 5, - lens >= 3.7.6 && < 4.10 - - if flag(development) - build-depends: - snap-loader-dynamic == 0.10.* - cpp-options: -DDEVELOPMENT - -- In development mode, speed is already going to suffer, so skip - -- the fancy optimization flags. Additionally, disable all - -- warnings. The hint library doesn't give an option to execute - -- compiled code when there were also warnings, so disabling - -- warnings allows quicker workflow. - ghc-options: -threaded -w - else - if impl(ghc >= 6.12.0) - ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2 - -fno-warn-orphans -fno-warn-unused-do-bind - else - ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2 - -fno-warn-orphans diff --git a/examples/7.8/snap/server/snaplets/heist/templates/_login.tpl b/examples/7.8/snap/server/snaplets/heist/templates/_login.tpl deleted file mode 100644 index b646e7c..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/_login.tpl +++ /dev/null @@ -1,9 +0,0 @@ -

Snap Example App Login

- -

- -/login -Login - - -

Don't have a login yet? Create a new user

diff --git a/examples/7.8/snap/server/snaplets/heist/templates/_new_user.tpl b/examples/7.8/snap/server/snaplets/heist/templates/_new_user.tpl deleted file mode 100644 index 5a9a332..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/_new_user.tpl +++ /dev/null @@ -1,5 +0,0 @@ -

Register a new user

- -/new_user -Add User - diff --git a/examples/7.8/snap/server/snaplets/heist/templates/base.tpl b/examples/7.8/snap/server/snaplets/heist/templates/base.tpl deleted file mode 100644 index e4e8127..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/base.tpl +++ /dev/null @@ -1,13 +0,0 @@ - - - Snap web server - - - -
- - - -
- - diff --git a/examples/7.8/snap/server/snaplets/heist/templates/index.tpl b/examples/7.8/snap/server/snaplets/heist/templates/index.tpl deleted file mode 100644 index 370dad5..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/index.tpl +++ /dev/null @@ -1,19 +0,0 @@ - - - -

- This is a simple demo page served using - Heist - and the Snap web framework. -

- -

Congrats! You're logged in as ''

- -

Logout

-
- - - - - -
diff --git a/examples/7.8/snap/server/snaplets/heist/templates/login.tpl b/examples/7.8/snap/server/snaplets/heist/templates/login.tpl deleted file mode 100644 index 29dc2fe..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/login.tpl +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/7.8/snap/server/snaplets/heist/templates/new_user.tpl b/examples/7.8/snap/server/snaplets/heist/templates/new_user.tpl deleted file mode 100644 index aa0fe53..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/new_user.tpl +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/examples/7.8/snap/server/snaplets/heist/templates/userform.tpl b/examples/7.8/snap/server/snaplets/heist/templates/userform.tpl deleted file mode 100644 index 0f8a8fc..0000000 --- a/examples/7.8/snap/server/snaplets/heist/templates/userform.tpl +++ /dev/null @@ -1,14 +0,0 @@ -
- - - - - - - - - - - -
Login:
Password:
-
diff --git a/examples/7.8/snap/server/src/Application.hs b/examples/7.8/snap/server/src/Application.hs deleted file mode 100644 index 8378832..0000000 --- a/examples/7.8/snap/server/src/Application.hs +++ /dev/null @@ -1,31 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - ------------------------------------------------------------------------------- --- | This module defines our application's state type and an alias for its --- handler monad. -module Application where - ------------------------------------------------------------------------------- -import Control.Lens -import Snap.Snaplet -import Snap.Snaplet.Heist -import Snap.Snaplet.Auth -import Snap.Snaplet.Session - ------------------------------------------------------------------------------- -data App = App - { _heist :: Snaplet (Heist App) - , _sess :: Snaplet SessionManager - , _auth :: Snaplet (AuthManager App) - } - -makeLenses ''App - -instance HasHeist App where - heistLens = subSnaplet heist - - ------------------------------------------------------------------------------- -type AppHandler = Handler App App - - diff --git a/examples/7.8/snap/server/src/Main.hs b/examples/7.8/snap/server/src/Main.hs deleted file mode 100644 index cad1698..0000000 --- a/examples/7.8/snap/server/src/Main.hs +++ /dev/null @@ -1,114 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -{- - -NOTE: Don't modify this file unless you know what you are doing. If you are -new to snap, start with Site.hs and Application.hs. This file contains -boilerplate needed for dynamic reloading and is not meant for general -consumption. - -Occasionally if we modify the way the dynamic reloader works and you want to -upgrade, you might have to swap out this file for a newer version. But in -most cases you'll never need to modify this code. - --} -module Main where - ------------------------------------------------------------------------------- -import Control.Exception (SomeException, try) -import qualified Data.Text as T -import Snap.Http.Server -import Snap.Snaplet -import Snap.Snaplet.Config -import Snap.Core -import System.IO -import Site - -#ifdef DEVELOPMENT -import Snap.Loader.Dynamic -#else -import Snap.Loader.Static -#endif - - ------------------------------------------------------------------------------- --- | This is the entry point for this web server application. It supports --- easily switching between interpreting source and running statically compiled --- code. --- --- In either mode, the generated program should be run from the root of the --- project tree. When it is run, it locates its templates, static content, and --- source files in development mode, relative to the current working directory. --- --- When compiled with the development flag, only changes to the libraries, your --- cabal file, or this file should require a recompile to be picked up. --- Everything else is interpreted at runtime. There are a few consequences of --- this. --- --- First, this is much slower. Running the interpreter takes a significant --- chunk of time (a couple tenths of a second on the author's machine, at this --- time), regardless of the simplicity of the loaded code. In order to --- recompile and re-load server state as infrequently as possible, the source --- directories are watched for updates, as are any extra directories specified --- below. --- --- Second, the generated server binary is MUCH larger, since it links in the --- GHC API (via the hint library). --- --- Third, and the reason you would ever want to actually compile with --- development mode, is that it enables a faster development cycle. You can --- simply edit a file, save your changes, and hit reload to see your changes --- reflected immediately. --- --- When this is compiled without the development flag, all the actions are --- statically compiled in. This results in faster execution, a smaller binary --- size, and having to recompile the server for any code change. --- -main :: IO () -main = do - -- Depending on the version of loadSnapTH in scope, this either enables - -- dynamic reloading, or compiles it without. The last argument to - -- loadSnapTH is a list of additional directories to watch for changes to - -- trigger reloads in development mode. It doesn't need to include source - -- directories, those are picked up automatically by the splice. - (conf, site, cleanup) <- $(loadSnapTH [| getConf |] - 'getActions - ["snaplets/heist/templates"]) - - _ <- try $ httpServe conf site :: IO (Either SomeException ()) - cleanup - - ------------------------------------------------------------------------------- --- | This action loads the config used by this application. The loaded config --- is returned as the first element of the tuple produced by the loadSnapTH --- Splice. The type is not solidly fixed, though it must be an IO action that --- produces the same type as 'getActions' takes. It also must be an instance of --- Typeable. If the type of this is changed, a full recompile will be needed to --- pick up the change, even in development mode. --- --- This action is only run once, regardless of whether development or --- production mode is in use. -getConf :: IO (Config Snap AppConfig) -getConf = commandLineAppConfig defaultConfig - - ------------------------------------------------------------------------------- --- | This function generates the the site handler and cleanup action from the --- configuration. In production mode, this action is only run once. In --- development mode, this action is run whenever the application is reloaded. --- --- Development mode also makes sure that the cleanup actions are run --- appropriately before shutdown. The cleanup action returned from loadSnapTH --- should still be used after the server has stopped handling requests, as the --- cleanup actions are only automatically run when a reload is triggered. --- --- This sample doesn't actually use the config passed in, but more --- sophisticated code might. -getActions :: Config Snap AppConfig -> IO (Snap (), IO ()) -getActions conf = do - (msgs, site, cleanup) <- runSnaplet - (appEnvironment =<< getOther conf) app - hPutStrLn stderr $ T.unpack msgs - return (site, cleanup) diff --git a/examples/7.8/snap/server/src/Site.hs b/examples/7.8/snap/server/src/Site.hs deleted file mode 100644 index 13624f4..0000000 --- a/examples/7.8/snap/server/src/Site.hs +++ /dev/null @@ -1,89 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - ------------------------------------------------------------------------------- --- | This module is where all the routes and handlers are defined for your --- site. The 'app' function is the initializer that combines everything --- together and is exported by this module. -module Site - ( app - ) where - ------------------------------------------------------------------------------- -import Control.Applicative -import Data.ByteString (ByteString) -import Data.Monoid -import qualified Data.Text as T -import Snap.Core -import Snap.Snaplet -import Snap.Snaplet.Auth -import Snap.Snaplet.Auth.Backends.JsonFile -import Snap.Snaplet.Heist -import Snap.Snaplet.Session.Backends.CookieSession -import Snap.Util.FileServe -import Heist -import qualified Heist.Interpreted as I ------------------------------------------------------------------------------- -import Application - - ------------------------------------------------------------------------------- --- | Render login form -handleLogin :: Maybe T.Text -> Handler App (AuthManager App) () -handleLogin authError = heistLocal (I.bindSplices errs) $ render "login" - where - errs = maybe mempty splice authError - splice err = "loginError" ## I.textSplice err - - ------------------------------------------------------------------------------- --- | Handle login submit -handleLoginSubmit :: Handler App (AuthManager App) () -handleLoginSubmit = - loginUser "login" "password" Nothing - (\_ -> handleLogin err) (redirect "/") - where - err = Just "Unknown user or password" - - ------------------------------------------------------------------------------- --- | Logs out and redirects the user to the site index. -handleLogout :: Handler App (AuthManager App) () -handleLogout = logout >> redirect "/" - - ------------------------------------------------------------------------------- --- | Handle new user form submit -handleNewUser :: Handler App (AuthManager App) () -handleNewUser = method GET handleForm <|> method POST handleFormSubmit - where - handleForm = render "new_user" - handleFormSubmit = registerUser "login" "password" >> redirect "/" - - ------------------------------------------------------------------------------- --- | The application's routes. -routes :: [(ByteString, Handler App App ())] -routes = [ ("/login", with auth handleLoginSubmit) - , ("/logout", with auth handleLogout) - , ("/new_user", with auth handleNewUser) - , ("", serveDirectory "static") - ] - - ------------------------------------------------------------------------------- --- | The application initializer. -app :: SnapletInit App App -app = makeSnaplet "app" "An snaplet example application." Nothing $ do - h <- nestSnaplet "" heist $ heistInit "templates" - s <- nestSnaplet "sess" sess $ - initCookieSessionManager "site_key.txt" "sess" (Just 3600) - - -- NOTE: We're using initJsonFileAuthManager here because it's easy and - -- doesn't require any kind of database server to run. In practice, - -- you'll probably want to change this to a more robust auth backend. - a <- nestSnaplet "auth" auth $ - initJsonFileAuthManager defAuthSettings sess "users.json" - addRoutes routes - addAuthSplices h auth - return $ App h s a - diff --git a/examples/7.8/snap/server/static/screen.css b/examples/7.8/snap/server/static/screen.css deleted file mode 100644 index b052609..0000000 --- a/examples/7.8/snap/server/static/screen.css +++ /dev/null @@ -1,26 +0,0 @@ -html { - padding: 0; - margin: 0; - background-color: #ffffff; - font-family: Verdana, Helvetica, sans-serif; -} -body { - padding: 0; - margin: 0; -} -a { - text-decoration: underline; -} -a :hover { - cursor: pointer; - text-decoration: underline; -} -img { - border: none; -} -#content { - padding-left: 1em; -} -#info { - font-size: 60%; -} diff --git a/examples/8.0/servant-api/Dockerfile b/examples/8.0/servant-api/Dockerfile deleted file mode 100644 index 69e732f..0000000 --- a/examples/8.0/servant-api/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM haskell:8.10 - -COPY . /opt/servant-api - -WORKDIR /opt/servant-api - -RUN stack build - -CMD ["stack","exec","servant-api-exe"] diff --git a/examples/8.0/servant-api/LICENSE b/examples/8.0/servant-api/LICENSE deleted file mode 100644 index fc03544..0000000 --- a/examples/8.0/servant-api/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright Author name here (c) 2016 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/examples/8.0/servant-api/Setup.hs b/examples/8.0/servant-api/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/examples/8.0/servant-api/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/examples/8.0/servant-api/app/Main.hs b/examples/8.0/servant-api/app/Main.hs deleted file mode 100644 index f66a415..0000000 --- a/examples/8.0/servant-api/app/Main.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Main where - -import Lib - -main :: IO () -main = startApp diff --git a/examples/8.0/servant-api/servant-api.cabal b/examples/8.0/servant-api/servant-api.cabal deleted file mode 100644 index 1e5adaf..0000000 --- a/examples/8.0/servant-api/servant-api.cabal +++ /dev/null @@ -1,45 +0,0 @@ -name: servant-api -version: 0.1.0.0 -synopsis: Initial project template from stack -description: Please see README.md -homepage: https://github.com/githubuser/servant-api#readme -license: BSD3 -license-file: LICENSE -author: Author name here -maintainer: example@example.com -copyright: 2016 Author name here -category: Web -build-type: Simple --- extra-source-files: -cabal-version: >=1.10 - -library - hs-source-dirs: src - exposed-modules: Lib - build-depends: base >= 4.7 && < 5 - , aeson - , servant-server - , wai - , warp - default-language: Haskell2010 - -executable servant-api-exe - hs-source-dirs: app - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: base - , servant-api - default-language: Haskell2010 - -test-suite servant-api-test - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Spec.hs - build-depends: base - , servant-api - ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 - -source-repository head - type: git - location: https://github.com/githubuser/servant-api diff --git a/examples/8.0/servant-api/src/Lib.hs b/examples/8.0/servant-api/src/Lib.hs deleted file mode 100644 index f985cc0..0000000 --- a/examples/8.0/servant-api/src/Lib.hs +++ /dev/null @@ -1,39 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeOperators #-} -module Lib - ( startApp - ) where - -import Data.Aeson -import Data.Aeson.TH -import Network.Wai -import Network.Wai.Handler.Warp -import Servant - -data User = User - { userId :: Int - , userFirstName :: String - , userLastName :: String - } deriving (Eq, Show) - -$(deriveJSON defaultOptions ''User) - -type API = "users" :> Get '[JSON] [User] - -startApp :: IO () -startApp = run 8080 app - -app :: Application -app = serve api server - -api :: Proxy API -api = Proxy - -server :: Server API -server = return users - -users :: [User] -users = [ User 1 "Isaac" "Newton" - , User 2 "Albert" "Einstein" - ] diff --git a/examples/8.0/servant-api/stack.yaml b/examples/8.0/servant-api/stack.yaml deleted file mode 100644 index d2ae7e0..0000000 --- a/examples/8.0/servant-api/stack.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# http://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# resolver: ghcjs-0.1.0_ghc-7.10.2 -# resolver: -# name: custom-snapshot -# location: "./custom-snapshot.yaml" -resolver: nightly-2016-06-15 - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# - location: -# git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# extra-dep: true -# subdirs: -# - auto-update -# - wai -# -# A package marked 'extra-dep: true' will only be built if demanded by a -# non-dependency (i.e. a user package), and its test suites and benchmarks -# will not be run. This is useful for tweaking upstream packages. -packages: -- '.' -# Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) -extra-deps: [] - -# Override default flag values for local packages and extra-deps -flags: {} - -# Extra package databases containing global packages -extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -# system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=1.1" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor \ No newline at end of file diff --git a/examples/8.0/servant-api/test/Spec.hs b/examples/8.0/servant-api/test/Spec.hs deleted file mode 100644 index cd4753f..0000000 --- a/examples/8.0/servant-api/test/Spec.hs +++ /dev/null @@ -1,2 +0,0 @@ -main :: IO () -main = putStrLn "Test suite not yet implemented" diff --git a/examples/8.10/servant-api/Dockerfile b/examples/8.10/servant-api/Dockerfile deleted file mode 100644 index 69e732f..0000000 --- a/examples/8.10/servant-api/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM haskell:8.10 - -COPY . /opt/servant-api - -WORKDIR /opt/servant-api - -RUN stack build - -CMD ["stack","exec","servant-api-exe"] diff --git a/examples/8.10/servant-api/LICENSE b/examples/8.10/servant-api/LICENSE deleted file mode 100644 index fc03544..0000000 --- a/examples/8.10/servant-api/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright Author name here (c) 2016 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/examples/8.10/servant-api/Setup.hs b/examples/8.10/servant-api/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/examples/8.10/servant-api/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/examples/8.10/servant-api/app/Main.hs b/examples/8.10/servant-api/app/Main.hs deleted file mode 100644 index f66a415..0000000 --- a/examples/8.10/servant-api/app/Main.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Main where - -import Lib - -main :: IO () -main = startApp diff --git a/examples/8.10/servant-api/cabal.project.local b/examples/8.10/servant-api/cabal.project.local deleted file mode 100644 index 55d7e95..0000000 --- a/examples/8.10/servant-api/cabal.project.local +++ /dev/null @@ -1,6 +0,0 @@ - -package * - ghc-location: ghc - -program-locations - ghc-location: ghc diff --git a/examples/8.10/servant-api/dist-newstyle/cache/compiler b/examples/8.10/servant-api/dist-newstyle/cache/compiler deleted file mode 100644 index 066038d50aa664fbe8edf400c6c99de0ae924719..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12503 zcmeHOTX!7Caqgi=iFfcKk`gI9<0y7~$zpjI#Uv*J0fK}Df)D_baAKS8ooy_}n4MWo z&jMH{ar~O!l0T5&k#q7#@{s3zUDH+DGrQ2SPhQP)$epS0tLpCR>gvlhm7+gU{i9Ar zr~K2k?%0;ytVnd$?WK8lu%ATHfB(;a{m1g~t&ncck~*VMS1@Hv@6>`pCimp1!ua!%k^$Cs=A}`Xk@BP_iUheD=5nD>(X@lMU|V%+r3Dd zyZ7z|Dht2wF4m-ORTP=^)SKP)v{&kK(p?&jGSjN;Pf404x=M@OcHgC?am5`h>d~mX zT;!F>E8Bgglh@nc-lyF+)|9q;lxA6XakM`&`C-@Yr$a8VNyv+SoA61~!sNU0ve(8J zLj9?0KMP#u{5qW2Z?mr+Ej|u>6t_6(P!A0LrpduqA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ynmP5f02!0Nbvyc;`>&NST0jsb-;tRgW@Qb*rJp{hX?WY1RrBK(=4#5nH+^M z_wBs8wX=9bFEC~M)#faEol!K-ndx_iMc;jcnl<|~CRh7up1Z)rED_`E9W}uV`y)&?K~dLtXoVl=NX2ng zP#%~qV_^sPlFXkn{x84DOME;=@Rcb(Z+Mf_7`lpEPgW{-U?iA=x?Lg;y11I(o9A_V zRy?J7e4hmtHu?0o_yp=}aUGcD2~JnBn=582xR8{EwJzsi`h_EB3H>Z{lT<4$op-ml zx_iNFcpg)JbMiiwu|v)R3#;i%Q5PXkF|s$_#KN6A?_;3S05?1KJCa_etlJ^WwL>F) zjdQFnxb(o+4U^6x8T!uGCZH`KBe;8stpJ&zBSzS+?e|8S`)#>sxmk7r2e84Ir8UCL~RVi2x!xmK3?e0C9BDs+!n zDxYwlkgMf?Pj4>m@HzjfJHd>LFnG%G@YD^M`psRMd`fp~pU$~dTXX9Bli_XJn(MF8 zK5gBfeLDZ*?9)H~#_ZF^_090AY!eCZ$TpGD^m1$y2yVqT0C7m&*qM8#dftmZPK5Uela|c|o`r#wDAjgew iFXq=jhh}|?yW!`>KZhnRx&J>ylg|fE_@4(Hp8p4WQd^t= diff --git a/examples/8.10/servant-api/dist-newstyle/cache/config b/examples/8.10/servant-api/dist-newstyle/cache/config deleted file mode 100644 index cf899721894a0ab177f1b669e2050a161222e2c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4937 zcmeHLO=u)V6z-m%O+v_KCH_RbjI4qR(_Pg){TC3kt`P#s`m-#82cf$9^-P=jqq}3W z9t1CfH$g!~1TWsadDENT6%pdelk7#jd$oF|UUie58H@~M4|X8$)%*GCy{cEQt4Gr& zk3J<@vsRPbmSJX)zQcxjn~f8Lvyk;``q{>x+h^Z?_SC0uee&_sf4!!x56nBlIx|m_ ze&5VeZbl=11Zlg+vLg^8IAw!zA2QQ7D5(OQ6JTSUj@|~I8~qWN(|q_!?SqeAxckG; zH^2X}jzJwRX_`0%co&)q_vPi_maF%86>z$ECLaysq+8Q}Nq_(QyKl5VUTnPi%)MVf zm+Orw7DFAkLpP*W)5YKPsVVNt6u8)wFTN&Mq#o`5i*G|>)Y*89I5X$lK06&tTO=D% zlI86ooMidkJ}mV9@~7_m=!P?jqFLy(eRj`3=hMg`%NINSw*THar(#%H--YfoSM{PE z58Zc+FrxWIA}y9wmJ$sEUo*_-rj>I}u`U$nR2ZsQvyv@26e880oKg4vQ8zQg8kSJXOF|y@`I!q9K|3CXV&Cezn4HAir)V z!w61|UOwnc8OFNRo5o_uo@R{Ft~6=(@_f95hKRMm0ZnuhIi#vIG4$OSY@0g7a*68` zD+b1?0}ky(K^Oq@?HIrh-8hEWqqgmIyntEY`jOvZ5qCo(k#{MuAY``19m|a<=K*D* z016}9?ErTm0H24hM}>dKqrPXwE?90%7OvG!;xM03E9!JQk?#?1BMxB>_dv|WBN|dCCNy?phceq{QN%oO9Vg@@ zCLwXD6Efz5<CJ8%2A-L9Miz$^~8pQktQp zl4ONNEJe#8QB;WvMMz8I*&N!PqnN+8Ug`Tq?8VOOdR-HYN?-WSHp3S&Cb)92e{=8F z?L9f!BbF%n){W!5H%ePWHh@+SQjp3mdD+^P)Zn9mR9&0nBGrnJqM>CwrrAyM-f>tU zNcLD{RlUDmPk}`PoLT`$rpOpmc=lgoR#2|*50gA${g%8SwsH{nNR~q@PDg`QmW!S& z%^!ZX4=jUL2GDwa@5W1qd&U5pMEwm25f$UX@iM8xMh0p9AW;F}gyoeEC6`52l;RRL zF9x-b^9&wzIlfREp{SBIaSof>Y7w(IYIt>?rhu!VH5p_hY}{q{xrzt7ppatT%B_CF zlKX^>6PBtQvob}q2RSy35h(`0iOV2958H5xEntp#<&Y&qqnDM-hxoEbG#5=YoCY?jl$>Kx8|jCK{=1.10 - -library - hs-source-dirs: src - exposed-modules: Lib - build-depends: base >= 4.7 && < 5 - , aeson - , servant-server - , wai - , warp - default-language: Haskell2010 - -executable servant-api-exe - hs-source-dirs: app - main-is: Main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: base - , servant-api - default-language: Haskell2010 - -test-suite servant-api-test - type: exitcode-stdio-1.0 - hs-source-dirs: test - main-is: Spec.hs - build-depends: base - , servant-api - ghc-options: -threaded -rtsopts -with-rtsopts=-N - default-language: Haskell2010 - -source-repository head - type: git - location: https://github.com/githubuser/servant-api diff --git a/examples/8.10/servant-api/src/Lib.hs b/examples/8.10/servant-api/src/Lib.hs deleted file mode 100644 index f985cc0..0000000 --- a/examples/8.10/servant-api/src/Lib.hs +++ /dev/null @@ -1,39 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeOperators #-} -module Lib - ( startApp - ) where - -import Data.Aeson -import Data.Aeson.TH -import Network.Wai -import Network.Wai.Handler.Warp -import Servant - -data User = User - { userId :: Int - , userFirstName :: String - , userLastName :: String - } deriving (Eq, Show) - -$(deriveJSON defaultOptions ''User) - -type API = "users" :> Get '[JSON] [User] - -startApp :: IO () -startApp = run 8080 app - -app :: Application -app = serve api server - -api :: Proxy API -api = Proxy - -server :: Server API -server = return users - -users :: [User] -users = [ User 1 "Isaac" "Newton" - , User 2 "Albert" "Einstein" - ] diff --git a/examples/8.10/servant-api/stack.yaml b/examples/8.10/servant-api/stack.yaml deleted file mode 100644 index 110dcc6..0000000 --- a/examples/8.10/servant-api/stack.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# This file was automatically generated by 'stack init' -# -# Some commonly used options have been documented as comments in this file. -# For advanced use and comprehensive documentation of the format, please see: -# http://docs.haskellstack.org/en/stable/yaml_configuration/ - -# Resolver to choose a 'specific' stackage snapshot or a compiler version. -# A snapshot resolver dictates the compiler version and the set of packages -# to be used for project dependencies. For example: -# -# resolver: lts-3.5 -# resolver: nightly-2015-09-21 -# resolver: ghc-7.10.2 -# resolver: ghcjs-0.1.0_ghc-7.10.2 -# resolver: -# name: custom-snapshot -# location: "./custom-snapshot.yaml" -resolver: nightly-2020-04-08 - -# There is no snapshot that includes ghc-8.10.1 yet -compiler: ghc-8.10.1 - -# User packages to be built. -# Various formats can be used as shown in the example below. -# -# packages: -# - some-directory -# - https://example.com/foo/bar/baz-0.0.2.tar.gz -# - location: -# git: https://github.com/commercialhaskell/stack.git -# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a -# extra-dep: true -# subdirs: -# - auto-update -# - wai -# -# A package marked 'extra-dep: true' will only be built if demanded by a -# non-dependency (i.e. a user package), and its test suites and benchmarks -# will not be run. This is useful for tweaking upstream packages. -packages: -- '.' -# Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) -extra-deps: [] - -# Override default flag values for local packages and extra-deps -flags: {} - -# Extra package databases containing global packages -extra-package-dbs: [] - -# Control whether we use the GHC we find on the path -system-ghc: true -# -# Require a specific version of stack, using version ranges -# require-stack-version: -any # Default -# require-stack-version: ">=1.1" -# -# Override the architecture used by stack, especially useful on Windows -# arch: i386 -# arch: x86_64 -# -# Extra directories used by stack for building -# extra-include-dirs: [/path/to/dir] -# extra-lib-dirs: [/path/to/dir] -# -# Allow a newer minor version of GHC than the snapshot specifies -# compiler-check: newer-minor diff --git a/examples/8.10/servant-api/test/Spec.hs b/examples/8.10/servant-api/test/Spec.hs deleted file mode 100644 index cd4753f..0000000 --- a/examples/8.10/servant-api/test/Spec.hs +++ /dev/null @@ -1,2 +0,0 @@ -main :: IO () -main = putStrLn "Test suite not yet implemented" From ecdd15a54a245da89e436f67d51d429916d0a436 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Fri, 10 Apr 2020 08:45:11 +0100 Subject: [PATCH 6/6] No longer bundle stack - The Haskell Tool Stack Usage: stack [--help] [--version] [--numeric-version] [--hpack-numeric-version] [--docker*] [--nix*] ([--verbosity VERBOSITY] | [-v|--verbose] | [--silent]) [--[no-]time-in-log] [--stack-root STACK-ROOT] [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc] [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD] [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR] [--with-gcc PATH-TO-GCC] [--with-hpack HPACK] [--[no-]skip-ghc-check] [--[no-]skip-msys] [--local-bin-path DIR] [--[no-]modify-code-page] [--[no-]allow-different-user] [--[no-]dump-logs] [--color|--colour WHEN] [--resolver RESOLVER] [--compiler COMPILER] [--[no-]terminal] [--stack-colors|--stack-colours STYLES] [--terminal-width INT] [--stack-yaml STACK-YAML] [--lock-file ARG] COMMAND|FILE Available options: --help Show this help text --version Show version --numeric-version Show only version number --hpack-numeric-version Show only hpack's version number --docker* Run 'stack --docker-help' for details --nix* Run 'stack --nix-help' for details --verbosity VERBOSITY Verbosity: silent, error, warn, info, debug -v,--verbose Enable verbose mode: verbosity level "debug" --silent Enable silent mode: verbosity level "silent" --[no-]time-in-log Enable/disable inclusion of timings in logs, for the purposes of using diff with logs (default: enabled) --stack-root STACK-ROOT Absolute path to the global stack root directory (Overrides any STACK_ROOT environment variable) --work-dir WORK-DIR Relative path of work directory (Overrides any STACK_WORK environment variable, default is '.stack-work') --[no-]system-ghc Enable/disable using the system installed GHC (on the PATH) if it is available and its version matches. Disabled by default. --[no-]install-ghc Enable/disable downloading and installing GHC if necessary (can be done manually with stack setup) (default: enabled) --arch ARCH System architecture, e.g. i386, x86_64 --ghc-variant VARIANT Specialized GHC variant, e.g. integersimple (incompatible with --system-ghc) --ghc-build BUILD Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected) -j,--jobs JOBS Number of concurrent jobs to run --extra-include-dirs DIR Extra directories to check for C header files --extra-lib-dirs DIR Extra directories to check for libraries --with-gcc PATH-TO-GCC Use gcc found at PATH-TO-GCC --with-hpack HPACK Use HPACK executable (overrides bundled Hpack) --[no-]skip-ghc-check Enable/disable skipping the GHC version and architecture check (default: disabled) --[no-]skip-msys Enable/disable skipping the local MSYS installation (Windows only) (default: disabled) --local-bin-path DIR Install binaries to DIR --[no-]modify-code-page Enable/disable setting the codepage to support UTF-8 (Windows only) (default: enabled) --[no-]allow-different-user Enable/disable permission for users other than the owner of the stack root directory to use a stack installation (POSIX only) (default: true inside Docker, otherwise false) --[no-]dump-logs Enable/disable dump the build output logs for local packages to the console (default: dump warning logs) --color,--colour WHEN Specify when to use color in output; WHEN is 'always', 'never', or 'auto'. On Windows versions before Windows 10, for terminals that do not support color codes, the default is 'never'; color may work on terminals that support color codes --resolver RESOLVER Override resolver in project file --compiler COMPILER Use the specified compiler --[no-]terminal Enable/disable overriding terminal detection in the case of running in a false terminal --stack-colors,--stack-colours STYLES Specify stack's output styles; STYLES is a colon-delimited sequence of key=value, where 'key' is a style name and 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic Rendition) control codes (in decimal). Use 'stack ls stack-colors --basic' to see the current sequence. In shells where a semicolon is a command separator, enclose STYLES in quotes. --terminal-width INT Specify the width of the terminal, used for pretty-print messages --stack-yaml STACK-YAML Override project stack.yaml file (overrides any STACK_YAML environment variable) --lock-file ARG Specify how to interact with lock files. Default: read/write. If resolver is overridden: read-only Available commands: build Build the package(s) in this directory/configuration install Shortcut for 'build --copy-bins' uninstall DEPRECATED: This command performs no actions, and is present for documentation only test Shortcut for 'build --test' bench Shortcut for 'build --bench' haddock Shortcut for 'build --haddock' new Create a new project from a template. Run `stack templates' to see available templates. Note: you can also specify a local file or a remote URL as a template. templates Show how to find templates available for `stack new'. `stack new' can accept a template from a remote repository (default: github), local file or remote URL. Note: this downloads the help file. init Create stack project config from cabal or hpack package specifications setup Get the appropriate GHC for your project path Print out handy path information ls List command. (Supports snapshots, dependencies and stack's styles) unpack Unpack one or more packages locally update Update the package index upgrade Upgrade to the latest stack upload Upload a package to Hackage sdist Create source distribution tarballs dot Visualize your project's dependency graph using Graphviz dot ghc Run ghc hoogle Run hoogle, the Haskell API search engine. Use 'stack exec' syntax to pass Hoogle arguments, e.g. stack hoogle -- --count=20 or stack hoogle -- server --local exec Execute a command run Build and run an executable. Defaults to the first available executable if none is provided as the first argument. ghci Run ghci in the context of package(s) (experimental) repl Run ghci in the context of package(s) (experimental) (alias for 'ghci') runghc Run runghc runhaskell Run runghc (alias for 'runghc') script Run a Stack Script freeze Show project or snapshot with pinned dependencies if there are any such (experimental, may be removed) eval Evaluate some haskell code inline. Shortcut for 'stack exec ghc -- -e CODE' clean Delete build artefacts for the project packages. purge Delete the project stack working directories (.stack-work by default). Shortcut for 'stack clean --full' query Query general build information (experimental) ide IDE-specific commands docker Subcommands specific to Docker use config Subcommands for accessing and modifying configuration values hpc Subcommands specific to Haskell Program Coverage stack's documentation is available at https://docs.haskellstack.org/ - it does not support ghc-8.10 yet --- 8.10/Dockerfile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/8.10/Dockerfile b/8.10/Dockerfile index edb04e2..11c56fc 100644 --- a/8.10/Dockerfile +++ b/8.10/Dockerfile @@ -5,7 +5,6 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* ARG GHC=8.10.1 -ARG STACK=2.3.0.1 ARG CABAL_INSTALL=3.2 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43CAF1CBA3CBA3FFE22B574 && \ @@ -26,16 +25,6 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 427CB69AAC9D00F2A43 zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -RUN export GNUPGHOME="$(mktemp -d)" && \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys E17D38358F72BEF7 && \ - curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz -o stack.tar.gz && \ - curl -fSL https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-x86_64.tar.gz.asc -o stack.tar.gz.asc && \ - gpg --batch --trusted-key 0x575159689BEFB442 --verify stack.tar.gz.asc stack.tar.gz && \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 && \ - /usr/local/bin/stack config set system-ghc --global true && \ - /usr/local/bin/stack config set install-ghc --global false && \ - rm -rf "$GNUPGHOME" /var/lib/apt/lists/* /stack.tar.gz.asc /stack.tar.gz - -ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH +ENV PATH /root/.cabal/bin:/opt/cabal/${CABAL_INSTALL}/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"]