1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Derive NFData instances for These & Join These.

This commit is contained in:
Rob Rix 2016-05-31 10:52:49 -04:00
parent c93e0c65c0
commit f58052cca1

View File

@ -1,7 +1,11 @@
{-# LANGUAGE DeriveAnyClass, FlexibleInstances, StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main where
import Criterion.Main
import Data.Bifunctor.Join
import Data.String
import Data.These
import Prologue
import Test.QuickCheck
@ -17,3 +21,9 @@ generativeBenchmark name metric benchmark = do
input <- generate (resize n arbitrary)
let measurement = metric input
pure $! bench (show measurement) (benchmark input)
-- Instances
deriving instance (NFData a, NFData b) => NFData (These a b)
deriving instance NFData a => NFData (Join These a)