haskell-servant / haskell-servant.github.io Goto Github PK
View Code? Open in Web Editor NEWservant website
Home Page: http://haskell-servant.github.io/
License: Creative Commons Attribution 4.0 International
servant website
Home Page: http://haskell-servant.github.io/
License: Creative Commons Attribution 4.0 International
It would be nice to have multiple versions of the tutorial, corresponding to the major versions of servant
. Preliminary work here.
The way I'd propose to do this:
versions/0.4
, versions/0.5
, etc.).deploy.sh
script check what branch it's on.
tutorial/0.4/somecontent.html
).tutorial
folder.tutorial/somecontent.html
to tutorial/<latest>/somecontent.html
.In https://haskell-servant.github.io/tutorial/api-type.html#response-headers, the line
type UserAPI = "users" :> Get '[JSON] (Headers [Header "User-Count" Integer] [User])
should read
type UserAPI = "users" :> Get '[JSON] (Headers '[Header "User-Count" Integer] [User])
otherwise the example won't compile.
When doing a search for [servant tutorial] the top result is https://haskell-servant.github.io/tutorial/, but the tutorial appears to have been moved to http://haskell-servant.readthedocs.io. My guess would be that the latter is what most people are looking for so it may make sense to add a canonical link so that search engines rank it higher. Just a thought :)
Following the discussions that happened in the team I would like us to visibly vote in favour of our affiliation with the Haskell Foundation
This will cement Servant's place as a cornerstone of the ecosystem, as well as allow companies to make in-kind donations to the Foundation that can be directed to Servant.
@haskell-servant/maintainers let us vote. Please comment with your explicit approval.
The pretty instance for Mul
:
instance (Pretty l, Pretty r) => Pretty (Mul l r) where
pretty (Mul a b) = unwords [autoParens a, "*", autoParens b]
where autoParens a@(Add _ _) = "(" ++ pretty a ++ ")"
autoParens a = pretty a
Gives the following error:
• Couldn't match expected type ‘Add l0 r0’ with actual type ‘l’
‘l’ is a rigid type variable bound by
the instance declaration
at /home/leif/Documents/type-level/src/Lib.hs:91:10-49
• In the first argument of ‘autoParens’, namely ‘a’
In the expression: autoParens a
In the first argument of ‘unwords’, namely
‘[autoParens a, "*", autoParens b]’
• Relevant bindings include
a :: l (bound at /home/leif/Documents/type-level/src/Lib.hs:92:15)
pretty :: Mul l r -> String
(bound at /home/leif/Documents/type-level/src/Lib.hs:92:3)
And the same for autoParens b
. I think I'm missing a LANGUAGE pragma somewhere that would prevent autoParens (Add _ _)
from collapsing to Add l r -> String
.
It would be nice if the client-in-5-minutes.md blog post could be refreshed to current servant.
AFAICT the code dates from around servant 0.4 (LTS 5), so it is not that easy to build any more.
I want to look into setting this up for the tutorial (and all the documentation in this repo), mainly in preparation for the servant-0.5
release. Any objections?
cc: @alpmestan @jkarni
I cloned the project and followed the instruction and I have got the following errors:
haskell-servant.github.io git:(hakyll) ✗ cabal build
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: haskell-servant-github-io-0.4.0 (user goal)
next goal: pandoc (dependency of haskell-servant-github-io-0.4.0)
Dependency tree exhaustively searched.
Trying configure anyway.
Configuring haskell-servant-github-io-0.4.0...
cabal: Encountered missing dependencies:
hakyll ==4.6., pandoc ==1.13.
I am using the latest haskell-platform
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Prelude>
Is the doc up to date? Or is there anything beside listed steps that is missing? Thanks for your help.
These past few days, a few folks asked why "import Servant" doesn't work when just depending on servant. We should make it clear quite early in the tutorial that Servant
is the go-to module when writing a webapp and exports servant's combinators as well as all the server-side machinery, hence belonging to servant-server, whereas Servant.API
"just" exports all the type-level combinators.
Folks usually don't suspect that they can nest APIs. We should add a note about that and how that affects the Server
.
I'm 99% certain this is due to use of slidy.
Firstly, vertical scrolling is essentially completely broken. Scrolling down by touch brings up the menu and scrolling up just doesn't happen.
Secondly, whenever there is a wide element like a code snippet which causes horizontal scrolling to be enabled, page flipping by swipe doesn't work either.
Like I said, this is basically slidy, and I couldn't find an issue tracker for that so I'm raising it here so you know about it.
On the positive side, what I've been able to understand about Servant looks really interesting so I'll be checking it out further on a desktop browser.
Could I publish Japanese translation of this document in my github pages in order to introduce servant to Japanese programmers? I would like to know the license and rules to publish translations if you have.
The website says:
The whole code is available in servant’s repo, under the servant-examples/hackage directory.
But there is no such directory anymore
Thank you for the post. Would you apply the patch, please.
$ git diff posts/2017-03-03-servant-and-db.markdown
diff --git a/posts/2017-03-03-servant-and-db.markdown b/posts/2017-03-03-servant-and-db.markdown
index 6c62dc2..dc181c7 100644
--- a/posts/2017-03-03-servant-and-db.markdown
+++ b/posts/2017-03-03-servant-and-db.markdown
@@ -134,7 +134,7 @@ app' :: Pool Connection -> Logger -> Application
app' pool logger = serve api $ hoistServer api nt $ createCat' :<|> readCat'
where
nt :: H x -> Handler x
- nt m -> runLogT "api" logger (runReaderT (runH m) pool)
+ nt m = runLogT "api" logger (runReaderT (runH m) pool)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.