
Sign up to save your podcasts
Or


Building out some hardcoded users
need to supply User before the data
don’t forget the = sign
We could manually build the encode and decode to/from JSON, but Generics, lets you automatically do things based on the data type
adding {-# LANGUAGE DeriveGeneric #-} and import GHC.Generics
don’t forget to add instance
Now we are able to see the output of having the generic encoder
Text errors
Building on our Server API, we want to break down the function called by the route into something more compose-able
get :: RoutePattern -> ActionM () -> ScottyM ()
docker quick
So, following the book is hard. I don’t really learn well that way. I have just enough knowledge that the first part feels boring and repetitive, but I don’t know what I don’t know, so where do I pick up, chapter 2 or maybe 3? So let’s take this from a real JS perspective.
Before we get started a couple tips for shorthand in Prelude
Words are are a list of chars
In Haskell, lists are a homogenous data structure. It stores several elements of the same type.
One of the most basic data types in Haskell
List comprehensions?
List Constructing
stack build and then stack exec hello-world-exe
the build will create an executable in the ./stack-work and look there for executables. cool
The Setup.hs file is a component of the Cabal build system which stack uses. It’s technically not needed by stack, but it is still considered good practice in the Haskell world to include it. The file we’re using is straight boilerplate:
Ok so cabal is a build system that stack uses, but good practice.
It is also important to remember that stack is built on top of the Cabal build system. Therefore, an understanding of the moving parts in Cabal are necessary. In Cabal, we have individual packages, each of which contains a single .cabal file. The .cabal file can define 1 or more components: a library, executables, test suites, and benchmarks. It also specifies additional information such as library dependencies, default language pragmas, and so on.
So it looks like cabal is the actual package builder and stack is a sort of management tool for haskell language, cabal, and all the other bits/pieces
Which ghc is it using?
jtomchak@MeowBook:/c/Users/jtomc/Documents/Haskell/hello-world$ stack exec -- which ghc
Episode 1:
We cover the why of trying to move into Haskell, the format of the show, and what to expect moving forward.
From the publisher's feed