Skip to content

Commit

Permalink
Adding support for operation request Hashable instances
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed Mar 20, 2016
1 parent b09b267 commit 0764b66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gen/src/Gen/AST/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import Gen.AST.Data.Instance
import Gen.AST.Data.Syntax
import Gen.Formatting
import Gen.Types
import Gen.Types.TypeOf
import HIndent
import Language.Haskell.Exts.Pretty
import Language.Haskell.Exts.Syntax hiding (Int, List, Lit, Var)
Expand All @@ -61,7 +60,7 @@ operationData cfg m o = do
(xd, xs) <- prodData m xa x
(yd, ys) <- prodData m ya y

is <- requestInsts m (_opName o) h xr xs
is <- instances xa <$> requestInsts m (_opName o) h xr xs

cls <- pp Print $ requestD cfg m h (xr, is) (yr, ys)

Expand All @@ -88,6 +87,10 @@ operationData cfg m o = do
yr = o ^. opOutput . _Identity
xn = identifier xr

instances s is
| isHashable s = IsHashable : is
| otherwise = is

shapeData :: HasMetadata a Identity
=> a
-> Shape Solved
Expand Down

0 comments on commit 0764b66

Please sign in to comment.