]> Git — Sourcephile - comptalang.git/blob - cli/Hcompta/Expr/Dup.hs
Gather into Writeable instances.
[comptalang.git] / cli / Hcompta / Expr / Dup.hs
1 {-# LANGUAGE NoImplicitPrelude #-}
2 {-# OPTIONS_GHC -fno-warn-tabs #-}
3
4 module Hcompta.Expr.Dup where
5
6 -- | Data type to duplicate an expression
7 -- in order to evaluate it with different interpreters.
8 data Dup repr1 repr2 a
9 = Dup
10 { dup1 :: repr1 a
11 , dup2 :: repr2 a
12 }
13
14
15 {-
16 -- * Whenever we use a value, we have to duplicate it first,
17 -- to leave the other copy for different interpreters
18 dup_consume ev x =
19 print (ev x1) >> return x2
20 where (x1, x2) = duplicate x
21 -}