I don't know how to express it. You need to have some dynamic
representation since
dag is a container of `(Int, f Int)`. I've tried to go along this road
type Exp a = Fix (E a)
data E c :: * -> * where
Lit :: Show a => a -> E a c
Op :: Op a -> E a c
App :: Phantom (a -> b) c -> Phantom a c
On Tue, Feb 19, 2013 at 9:28 PM, Anton Kholomiov
wrote:
>
> Do you think the approach can be extended for non-regular (nested)
>> algebraic types (where the recursive data type is sometimes at a different
>> type instance)? For instance, it's very handy to use GADTs to capture
>> embedded language
This should be possible using higher-order terms, as in
http://hackage.haskell.org/packages/archive/compdata/latest/doc/html/Data-Comp-Multi-Term.html
The only complication I see is that the Dag nodes would get
heterogeneous types requiring existential quantification with a
`Typeable` constrai
> Do you think the approach can be extended for non-regular (nested)
> algebraic types (where the recursive data type is sometimes at a different
> type instance)? For instance, it's very handy to use GADTs to capture
> embedded language types in host language (Haskell) types, which leads to
> non-
What a delightfully elegant approach to CSE! I've been thinking about CSE
for DSELs and about functor fixpoints, but it never occurred to me to put
the two together.
Do you think the approach can be extended for non-regular (nested)
algebraic types (where the recursive data type is sometimes at a
Fully understandable! Compdata would be quite a heavy dependency for
your library.
I'm just generally fond of the idea of collecting all DSL implementation
tricks under one umbrella. That requires using the same term representation.
/ Emil
2013-02-19 14:12, Anton Kholomiov skrev:
There are
There are several packages that already define fixpoints (another one is
about unification), but all packages that I'm aware of define a lot of
functionality
that I don't need (and actually don't understand, packages with fixpoint
types
tend to be rather dense with math). I'd like it to be simple a
2013-02-19 12:10, Anton Kholomiov skrev:
I'm glad to announce the package for Commonsubexpression elimination [1].
It's an implementation of the hashconsig algorithm as described in the
paper
'Implementing Explicit and Finding Implicit Sharing in EDSLs' by Oleg
Kiselyov.
Main point of the librar
I'm glad to announce the package for Common subexpression elimination [1].
It's an implementation of the hashconsig algorithm as described in the
paper
'Implementing Explicit and Finding Implicit Sharing in EDSLs' by Oleg
Kiselyov.
Main point of the library is to define this algorithm in the most