This file is a Literate Haskell module, so we must import things before we get going: {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} -- Suppress some warnings which take away from the beauty -- of the post {-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_GHC -Wno-missing-exported-signatures #-} module GeneratingAClient where import ApiAsType ( (…
In the previous post in this series , we derived type-safe links for API endpoints. While this wasn’t a revolutionary use of a computer, it set the stage for better, bolder things. We learned about extending Servant using typeclasses, and the central role of Proxy . Today, we do some real web development stuff: we’ll go too far building abstractions we’ll serve an API. This file is a Literal…
Recall the previous post in this series : we created a bunch of types, such as Get , Capture , and (:>) , to help us represent an API. So far, we can’t do squat with these types, but that changes today. By the end of this post, we’ll be able to do one thing: we’ll determine the string representation of an endpoint type. I know, this isn’t mindblowing, but it will require the use of a basic…
This file is a Literate Haskell module, so we have to get some ceremony out-of-the-way. {-# LANGUAGE DerivingStrategies #-} -- We'll get back to DataKinds {-# LANGUAGE DataKinds #-} module ApiAsType where -- we'll need these later on import Data.Text ( Text ) import Data.Time ( UTCTime , Day ) import GHC.TypeLits ( Symbol ) A web application programming interface (API) can be represent by a tree…
Featured in Haskell Weekly issue 498 A large fraction of software engineers work in web development. I also do some web development these days, exclusively on the backend. Backend software engineers, just like their frontend counterparts, have streamlined their work by packaging development utilities into frameworks . Even in the relatively small Haskell community, there are many web frameworks,…
As you can see from this website, I am quite involved in the Haskell community. Well, I went a step further by applying to join, and then being elected to, the Haskell Foundation ’s board of directors . The Haskell Foundation is driven by a vision . Haskell has a rich history of academic research, innovation, and industry usage driven by strong principles. Within this vision, I personally want…
Featured in Haskell Weekly issue 456 I am a firm believer in the purely functional programming approach, embodied by the Haskell programming language. While the Haskell community is not huge, it is large enough that I can work on most domains. Most domains, but not all; data science remains hard to work on in Haskell. Since data science grew out not from software engineering, but from students and…
I have performed non-trivial scientific calculations, in university and beyond , for almost 15 years. Until the end of undergraduate school, this was mostly done by hand. Optimizing the trajectory of a heavy ball or solving the heat equation are problems with analytical solutions, and thus can be solved with pen(cil) and paper. However, there were instances when numerical tools had to be used,…
I co-founded Powerweave with Mathilde Mounier . We have been working nights and weekends for the better part of a year. Today, I can reveal it publicly. Starting a business is something that I have been thinking about since finishing graduate school. My academic expertise could not be turned into a business outright ( although ex-colleagues are trying! ), but my skills in mathematics, software…
I work in the business of algorithmic power trading, which is the automated trading of various power-related products in regulated electricity markets . Products include short-term inter-jurisdiction arbitrage, financial transmission rights, and more. This year, my employer is expanding its trading operations to a new class of products. Since there is no overlap between this new work and our…