Haskell SDK reference
Read time: 1 minute
Last edited: Jul 28, 2021
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.
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:
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.
1client :: IO Client2client = makeClient $ makeConfig "YOUR_SDK_KEY"
client a singleton. The client instance maintains an internal state that allows us to serve feature flags without making any remote requests.
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.
This SDK supports the following features: