Mon Jul 20 01:59:41 EDT 2015

Phantom types and existential types

Phantom type representation would be simple: inside it could be lists
of strings, outside it could be Arrow (S i o).

More interesting are existential types.  But they are hard to use if I

Is it possible to have something that is type

   S x

But internally looks like

   (s, s->(x,s))
This might be key actually.  A phantom type as a reduction?

E.g. the outside looks like a proton, but the inside looks like a
bunch of quarks?

EDIT: Going in circles.  Sys.hs already has this existential type for
what is called compilable SSMs (CSSM).

    class CSSM stx m s i o where
      ssmCompile :: SSM m s i o -> stx

This can even fit evaluation if stx is [i] -> [o].

EDIT: Evaluation can be done directly on the CSSM type, feeding s into
(s,i)->(s,o) and recursing.

[1] https://wiki.haskell.org/Existential_type