• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

Haskell SDK reference

Read time: 1 minute
Last edited: Sep 24, 2021

Overview

This reference guide documents all of the methods available in the Haskell SDK, and explains in detail how these methods work. LaunchDarkly's SDKs are open source. To learn more, visit our Haskell SDK GitHub repository. The online API docs contain the programmatic definitions of every type and method. You can also try this SDK out by cloning and running a sample application.

Getting started

Follow the steps below to get started using the LaunchDarkly SDK in your Haskell application.

The root module of the SDK LaunchDarkly.Server re-exports the entire project. That's all that you need to start.

Here is an example:

1import LaunchDarkly.Server

After you import and install the SDK, create a single shared instance of Client. Specify your SDK key to authorize your application to connect to LaunchDarkly for a particular environment.

Here's how:

1client :: IO Client
2client = makeClient $ makeConfig "YOUR_SDK_KEY"
Client must be a singleton

Make client a singleton. The client instance maintains an internal state that allows us to serve feature flags without making any remote requests.

Using client, you can check which variation a particular user should receive for a given feature flag:

1boolVariation client "YOUR_FLAG_KEY" (makeUser "abc") False

Lastly, shut down the client when your application terminates. To learn more, read Shutting down.

Supported features

This SDK supports the following features: