{-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-tabs #-} module Hcompta.Expr.Dup where -- | Data type to duplicate an expression -- in order to evaluate it with different interpreters. data Dup repr1 repr2 a = Dup { dup1 :: repr1 a , dup2 :: repr2 a } {- -- * Whenever we use a value, we have to duplicate it first, -- to leave the other copy for different interpreters dup_consume ev x = print (ev x1) >> return x2 where (x1, x2) = duplicate x -}