• HOME
  • INTEGRATIONS
  • SDKS
  • GUIDES
  • API DOCS
No results for ""
EXPAND ALL
launchdarkly.com

EDIT ON GITHUB

Haskell SDK reference

Read time: 1 minute
Last edited: Jun 18, 2021

Overview

This reference guide documents all of the methods available in the Haskell SDK, and explains in detail how these methods work. If you want to dig even deeper, our 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. Additionally you can clone and run a sample application using this SDK.

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.

1import LaunchDarkly.Server

After you import and install the SDK, create a single shared instance of Client.

Specify your SDK key here to authorize your application to connect to LaunchDarkly for a particular environment.

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

Supported features

This SDK supports the following features: