···11-// NOTE: ideally we want something like:
22-// include module type of SExpFunc.Make(ConstAtom)
33-// this doesn't work because reasons. can come back to revisit
44-// but i honestly suspect this is a rescript compiler bug.
55-66-module Atom: SExpFunc.ATOM with type t = string
77-type rec t =
88- | Atom(Atom.t)
99- | Compound({subexps: array<t>})
1010- | Var({idx: int})
1111- | Schematic({schematic: int, allowed: array<int>})
1212- | Ghost
11+module SymbolAtom: SExpFunc.ATOM with type t = string
1321414-include Signatures.TERM
1515- with type t := t
1616- and type meta = string
1717- and type schematic = int
1818- and type subst = Map.t<int, t>
1919-let mapTerms: (t, t => t) => t
33+include module type of SExpFunc.Make(SymbolAtom)
-2
src/SExpFunc.res
···2020})
21212222module Make = (Atom: ATOM): {
2323- module Atom: ATOM with type t = Atom.t
2424-2523 type rec t =
2624 | Atom(Atom.t)
2725 | Compound({subexps: array<t>})
···11-include Signatures.JUDGMENT_VIEW with module Term := SExp and module Judgment := SExp
11+// really feel like this shouldn't be necessary...
22+module SExpJ: Signatures.JUDGMENT with module Term := SExp and type t = SExp.t
33+44+include Signatures.JUDGMENT_VIEW with module Term := SExp and module Judgment := SExpJ
+2-3
src/SExpView.res
···11-module ConstAtom = SExp.Atom
22-module ConstAtomView: SExpViewFunc.ATOM_VIEW with module Atom := SExp.Atom = {
11+module SymbolAtomView: SExpViewFunc.ATOM_VIEW with module Atom := SExp.SymbolAtom = {
32 type props = {name: string, scope: array<string>}
43 let make = (props: props) => React.string(props.name)
54}
6577-include SExpViewFunc.Make(ConstAtom, ConstAtomView, SExp)
66+include SExpViewFunc.Make(SExp.SymbolAtom, SymbolAtomView, SExp)
+1-1
src/SExpView.resi
···11-module ConstAtomView: SExpViewFunc.ATOM_VIEW with module Atom := SExp.Atom
11+module SymbolAtomView: SExpViewFunc.ATOM_VIEW with module Atom := SExp.SymbolAtom
2233include Signatures.TERM_VIEW with module Term := SExp
+1-14
src/SExpViewFunc.res
···77module Make = (
88 Atom: SExpFunc.ATOM,
99 AtomView: ATOM_VIEW with module Atom := Atom,
1010- SExp: {
1111- type rec t =
1212- | Atom(Atom.t)
1313- | Compound({subexps: array<t>})
1414- | Var({idx: int})
1515- | Schematic({schematic: int, allowed: array<int>})
1616- | Ghost
1717- include Signatures.TERM
1818- with type t := t
1919- and type meta = string
2020- and type schematic = int
2121- and type subst = Map.t<int, t>
2222- let mapTerms: (t, t => t) => t
2323- },
1010+ SExp: module type of SExpFunc.Make(Atom),
2411): {
2512 include Signatures.TERM_VIEW with module Term := SExp
2613} => {
···11-type stringSExpAtom = StringS(StringAtom.t) | ConstS(SExp.Atom.t)
11+type stringSExpAtom = StringS(StringAtom.t) | ConstS(string)
22module StringSExpAtom: SExpFunc.ATOM with type t = stringSExpAtom
3344-type rec t =
55- | Atom(StringSExpAtom.t)
66- | Compound({subexps: array<t>})
77- | Var({idx: int})
88- | Schematic({schematic: int, allowed: array<int>})
99- | Ghost
1010-1111-include Signatures.TERM
1212- with type t := t
1313- and type meta = string
1414- and type schematic = int
1515- and type subst = Map.t<int, t>
1616-1717-module Atom: SExpFunc.ATOM with type t := StringSExpAtom.t
1818-let mapTerms: (t, t => t) => t
44+include module type of SExpFunc.Make(StringSExpAtom)
+2-1
src/StringSExpJView.res
···33 let make = ({name, scope}: props) =>
44 switch name {
55 | StringSExp.StringS(name) => <StringAtomView name scope />
66- | StringSExp.ConstS(name) => <SExpView.ConstAtomView name scope />
66+ | StringSExp.ConstS(name) => <SExpView.SymbolAtomView name scope />
77 }
88}
991010+module StringSExpJ = StringSExp
1011module View = SExpViewFunc.Make(StringSExp.StringSExpAtom, StringAtomView, StringSExp)
11121213module TermView = View
+3-1
src/StringSExpJView.resi
···11-include Signatures.JUDGMENT_VIEW with module Term := StringSExp and module Judgment := StringSExp
11+module StringSExpJ: Signatures.JUDGMENT with module Term := StringSExp and type t = StringSExp.t
22+33+include Signatures.JUDGMENT_VIEW with module Term := StringSExp and module Judgment := StringSExpJ