move everything

This commit is contained in:
Joeri Exelmans 2025-05-23 22:35:47 +02:00
parent 3ff7e76694
commit 9050581a10
25 changed files with 37 additions and 42 deletions

View file

@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import './App.css';
import { ExprBlock, type ExprBlockState } from './ExprBlock';
import { GlobalContext } from './GlobalContext';
import { ExprBlock, type ExprBlockState } from '../expr/ExprBlock';
import { GlobalContext } from '../../context/GlobalContext';
import { biggerExample, emptySet, factorial, higherOrder, higherOrder2Params, inc, initialEditorState, lambda2Params, nonEmptyEditorState, pushBool, tripleFunctionCallEditorState } from "./configurations";
import { actionShortcuts } from './actions';
// import { scoreResolved, type ResolvedType } from './eval';

View file

@ -1,4 +1,4 @@
import type { ExprBlockState } from "./ExprBlock";
import type { ExprBlockState } from "../expr/ExprBlock";
export const initialEditorState: ExprBlockState = {
kind: "input",

View file

@ -1,16 +1,15 @@
import { useContext } from "react";
import { EnvContext } from "./EnvContext";
import { EnvContext } from "../../context/EnvContext";
// import { addFocusRightMost, evalCallBlock2, evalExprBlock, recomputeTypeVarsForEnv, scoreResolved, type Environment, type ResolvedType } from "./eval";
import { ExprBlock, type ExprBlockState, type SetStateFn, type State2Props } from "./ExprBlock";
import { GlobalContext } from "./GlobalContext";
import { Value } from "./Value";
import { GlobalContext } from "../../context/GlobalContext";
import { getActions } from "./actions";
import { getActions } from "../app/actions";
import "./CallBlock.css";
import { CallContext } from "./CallContext";
import { inferType, inferTypeCall, type Environment } from "./infer_type";
import { Type } from "./Type";
import { CallContext } from "../../context/CallContext";
import { inferTypeCall, type Environment } from "../../eval/infer_type";
import { Type } from "../other/Type";
export interface CallBlockState {
kind: "call";

View file

@ -3,18 +3,16 @@ import { useContext } from "react";
import { getType } from "dope2";
import { CallBlock, type CallBlockProps, type CallBlockState } from "./CallBlock";
import { EnvContext } from "./EnvContext";
import { GlobalContext } from "./GlobalContext";
import { EnvContext } from "../../context/EnvContext";
import { GlobalContext } from "../../context/GlobalContext";
import { InputBlock, type InputBlockProps, type InputBlockState } from "./InputBlock";
import { LambdaBlock, type LambdaBlockProps, type LambdaBlockState } from "./LambdaBlock";
import { LetInBlock, type LetInBlockProps, type LetInBlockState } from "./LetInBlock";
import { Type } from "./Type";
// import { evalExprBlock, type ResolvedType } from "./eval";
import "./ExprBlock.css";
import { Input } from "./Input";
import { getActions } from "./actions";
import { inferType } from "./infer_type";
import { Input } from "../other/Input";
import { getActions } from "../app/actions";
export type ExprBlockState =
InputBlockState

View file

@ -1,18 +1,18 @@
import { memo, useContext, useEffect, useMemo, useRef, useState } from "react";
import { getType, prettyT, trie } from "dope2";
import { trie } from "dope2";
import { EnvContext } from "./EnvContext";
import { EnvContext } from "../../context/EnvContext";
// import type { Environment, ResolvedType } from "./eval";
import "./InputBlock.css";
import { Type } from "./Type";
import { Type } from "../other/Type";
import type { ExprBlockState, State2Props } from "./ExprBlock";
// import { attemptParseLiteral } from "./eval";
import { Input } from "./Input";
import { CallContext } from "./CallContext";
import { getActions } from "./actions";
import { GlobalContext } from "./GlobalContext";
import { inferTypeInput } from "./infer_type";
import { Input } from "../other/Input";
import { CallContext } from "../../context/CallContext";
import { getActions } from "../app/actions";
import { GlobalContext } from "../../context/GlobalContext";
import { inferTypeInput } from "../../eval/infer_type";
interface Literal {
kind: "literal";

View file

@ -3,13 +3,13 @@ import { useContext } from "react";
// import { eqType, getSymbol, reduceUnification } from "dope2";
import { ExprBlock, type ExprBlockState, type State2Props } from "./ExprBlock";
import { EnvContext } from "./EnvContext";
import { EnvContext } from "../../context/EnvContext";
// import { evalExprBlock, evalLambdaBlock, makeInnerEnv, makeTypeVar } from "./eval";
import "./LambdaBlock.css";
import { Type } from "./Type";
import { Input } from "./Input";
import { inferTypeLambda } from "./infer_type";
import { Type } from "../other/Type";
import { Input } from "../other/Input";
import { inferTypeLambda } from "../../eval/infer_type";
export interface LambdaBlockState {
kind: "lambda";

View file

@ -1,15 +1,15 @@
import { useContext } from "react";
import { ExprBlock, type ExprBlockState } from "./ExprBlock";
import { EnvContext } from "./EnvContext";
import { EnvContext } from "../../context/EnvContext";
// import { evalExprBlock, makeInnerEnv, scoreResolved, type ResolvedType } from "./eval";
import { type State2Props } from "./ExprBlock";
import { GlobalContext } from "./GlobalContext";
import { GlobalContext } from "../../context/GlobalContext";
import "./LetInBlock.css";
import { Input } from "./Input";
import { inferTypeLet } from "./infer_type";
import { Type } from "./Type";
import { Input } from "../other/Input";
import { inferTypeLet } from "../../eval/infer_type";
import { Type } from "../other/Type";
export interface LetInBlockState {
kind: "let";

View file

@ -1,10 +1,10 @@
import { Double, eqType, fnType, IncompatibleTypesError, Int, mergeSubstitutionsN, occurring, prettySS, recomputeTypeVars, substitute, trie, TYPE_VARS, UNBOUND_SYMBOLS, unify } from "dope2";
import type { CallBlockState } from "./CallBlock";
import type { ExprBlockState } from "./ExprBlock";
import type { InputBlockState } from "./InputBlock";
import type { LambdaBlockState } from "./LambdaBlock";
import type { LetInBlockState } from "./LetInBlock";
import type { CallBlockState } from "../component/expr/CallBlock";
import type { ExprBlockState } from "../component/expr/ExprBlock";
import type { InputBlockState } from "../component/expr/InputBlock";
import type { LambdaBlockState } from "../component/expr/LambdaBlock";
import type { LetInBlockState } from "../component/expr/LetInBlock";
export interface Environment {
names: any;
@ -93,7 +93,7 @@ export function inferTypeCall(s: CallBlockState, env: Environment): TypeInfoCall
const subs = unify(
fnTypeInfo.type,
fakeFnType);
console.log("subs:", prettySS(subs));
// console.log("subs:", prettySS(subs));
let type, newEnv;
if (subs.has(returnType!.symbol)) {
type = subs.get(returnType!.symbol);
@ -136,8 +136,6 @@ export function inferTypeLet(s: LetInBlockState, env: Environment): TypeInfoLamb
names: trie.insert(env.names)(s.name)({kind: "value", t: valTypeInfo.type}),
typevars: env.typevars,
};
console.log(s.name);
console.log("innerEnv.names:", innerEnv.names);
return {
...inferType(s.inner, innerEnv),
paramType: valTypeInfo.type,

View file

@ -1,6 +1,6 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { App } from './App.tsx'
import { App } from './component/app/App.tsx'
import './index.css'
import '@fontsource-variable/inconsolata/standard.css';