I hereby claim:
- I am dxtr on github.
- I am dxtr (https://keybase.io/dxtr) on keybase.
- I have a public key whose fingerprint is 97A0 CF43 6922 4351 DC3C 5A0B B00B 3118 0662 D334
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#lang racket | |
(define (string-empty? str) | |
(= (string-length str) 0)) | |
(define (file-name-as-string fn) | |
(cond | |
((path? fn) (path->string fn)) | |
((string? fn) fn) | |
(else (error "Unkonwn type!")))) |
# Load DSL and Setup Up Stages | |
require 'capistrano/setup' | |
# Includes default deployment tasks | |
require 'capistrano/deploy' | |
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } | |
namespace :deploy do |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
IntegrationFlow privateFeedFlow = f -> f.handle(Tcp | |
.outboundGateway( | |
Tcp.netClient(privateFeed.getHostname(), (int) privateFeed.getPort()) | |
.serializer(TcpCodecs.crlf()) | |
.deserializer(TcpCodecs.lengthHeader1()) | |
.id("privateFeed")) | |
.remoteTimeout(m -> 5000)) | |
.transform(Transformers.objectToString()) | |
.handle(System.out::println); |
In the Haskell world effect systems are currently a big thing and one of the most popular libraries on that front is effectful
.
When it comes to libries for creating webservices, the most popular one at the time of writing this is probably servant
.
The two libraries go very well together but it isn't exactly obvious how you can marry them up since there doesn't seem to exist any examples at the moment. That's why I decided to create one. I'll go through setting up a simple service line by line and at the end of post I'll post the whole example. So if you're just after some quick boilerplate you can scroll right to the end.
If you haven't already, create a new project using cabal init -i
.
Then let's add some dependencies to our cabal file. You can probably get away with loosening most of the constraints but with those the example is guaranteed to work on ghc-9.2.7
.