Derive NFData instance for GenHaxl

Summary: Having an NFData instance allows forcing calls that return a Haxl computation to run.

Reviewed By: xich

Differential Revision: D3906781

fbshipit-source-id: e49448152695383031af6d315a20dbcd1c10720c
This commit is contained in:
Jonathan Coens 2016-09-22 11:03:58 -07:00 committed by Facebook Github Bot 6
parent 528bba5565
commit 78052b9625

View File

@ -11,6 +11,7 @@
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-} {-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MagicHash #-} {-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE MultiWayIf #-}
@ -182,6 +183,7 @@ emptyEnv = initEnv stateEmpty
-- --
newtype GenHaxl u a = GenHaxl newtype GenHaxl u a = GenHaxl
{ unHaxl :: Env u -> IORef (RequestStore u) -> IO (Result u a) } { unHaxl :: Env u -> IORef (RequestStore u) -> IO (Result u a) }
deriving NFData
-- | The result of a computation is either 'Done' with a value, 'Throw' -- | The result of a computation is either 'Done' with a value, 'Throw'
-- with an exception, or 'Blocked' on the result of a data fetch with -- with an exception, or 'Blocked' on the result of a data fetch with