newer ghc

This commit is contained in:
crumbtoo
2024-03-24 08:05:39 -06:00
parent 9678d3206a
commit 93ef870e56
7 changed files with 24 additions and 25 deletions

View File

@@ -5,7 +5,7 @@ ALEX = alex
ALEX_OPTS = -g ALEX_OPTS = -g
SRC = src SRC = src
CABAL_BUILD = $(shell ./find-build.cl) CABAL_BUILD = $(shell ./find-build.clj)
all: parsers lexers all: parsers lexers

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env sbcl --script
(let* ((paths (directory "dist-newstyle/build/*/*/rlp-*/build/"))
(n (length paths)))
(cond ((< 1 n) (error ">1 build directories found. run `cabal clean`."))
((< n 1) (error "no build directories found. this shouldn't happen lol"))
(t (format t "~A" (car paths)))))

13
find-build.clj Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bb
(defn die [& msgs]
(binding [*out* *err*]
(run! println msgs))
(System/exit 1))
(let [paths (map str (fs/glob "." "dist-newstyle/build/*/*/rlp-*/build"))
n (count paths)]
(cond (< 1 n) (die ">1 build directories found. run `cabal clean`.")
(< n 1) (die "no build directories found. this shouldn't happen lol")
:else (-> (first paths) fs/real-path str println)))

View File

@@ -75,7 +75,6 @@ library
, text >= 2.0.2 && < 2.3 , text >= 2.0.2 && < 2.3
, unordered-containers >= 0.2.20 && < 0.3 , unordered-containers >= 0.2.20 && < 0.3
, recursion-schemes >= 5.2.2 && < 5.3 , recursion-schemes >= 5.2.2 && < 5.3
, monadic-recursion-schemes
, data-fix >= 0.3.2 && < 0.4 , data-fix >= 0.3.2 && < 0.4
, utf8-string >= 1.0.2 && < 1.1 , utf8-string >= 1.0.2 && < 1.1
, extra >= 1.7.0 && <2 , extra >= 1.7.0 && <2
@@ -88,14 +87,8 @@ library
, these >=0.2 && <2.0 , these >=0.2 && <2.0
, free >=5.2 , free >=5.2
, bifunctors >=5.2 , bifunctors >=5.2
, blaze-html , aeson >=2.2.1.0 && <2.3.1.0
, blaze-markup
, clay
, jmacro
, js-jquery
, aeson
, lens-aeson , lens-aeson
-- , servant
hs-source-dirs: src hs-source-dirs: src
default-language: GHC2021 default-language: GHC2021

View File

@@ -22,7 +22,7 @@ import Text.Printf
import Control.Comonad import Control.Comonad
import Control.Comonad.Cofree import Control.Comonad.Cofree
import Data.Fix import Data.Fix
import Data.Functor import Data.Functor hiding (unzip)
import Control.Lens hiding ((:<)) import Control.Lens hiding ((:<))
import Control.Lens.Unsound import Control.Lens.Unsound

View File

@@ -37,7 +37,7 @@ import Data.Traversable
import GHC.Generics (Generic, Generically(..)) import GHC.Generics (Generic, Generically(..))
import Debug.Trace import Debug.Trace
import Data.Functor import Data.Functor hiding (unzip)
import Data.Functor.Foldable hiding (fold) import Data.Functor.Foldable hiding (fold)
import Data.Fix hiding (cata, para) import Data.Fix hiding (cata, para)
import Control.Comonad.Cofree import Control.Comonad.Cofree
@@ -121,6 +121,12 @@ generalise g t = ifoldr (\n _ s -> ForallT n s) t vs
vs = H.difference (freeVariables t ^. hashMap) vs = H.difference (freeVariables t ^. hashMap)
(g ^. contextTyVars) (g ^. contextTyVars)
instantiate :: Type PsName -> HM (Type PsName)
instantiate (ForallT x m) = do
tv <- freshTv
subst x tv <$> instantiate m
instantiate x = pure x
unify :: [Constraint] -> HM [(PsName, Type PsName)] unify :: [Constraint] -> HM [(PsName, Type PsName)]
unify [] = pure mempty unify [] = pure mempty

View File

@@ -30,7 +30,6 @@ import Numeric
import Data.Fix hiding (cata, para, cataM) import Data.Fix hiding (cata, para, cataM)
import Data.Functor.Bind import Data.Functor.Bind
import Data.Functor.Foldable import Data.Functor.Foldable
import Data.Functor.Foldable.Monadic
import Control.Comonad import Control.Comonad
import Effectful.State.Static.Local import Effectful.State.Static.Local
@@ -103,11 +102,7 @@ typeToCore (VarT n) = TyVar n
exprToCore :: (NameSupply :> es) exprToCore :: (NameSupply :> es)
=> TypedRlpExpr PsName => TypedRlpExpr PsName
-> Eff es (Cofree (Core.ExprF Var) Core.Type) -> Eff es (Cofree (Core.ExprF Var) Core.Type)
exprToCore = cataM \case exprToCore = undefined
t :<$ InL e -> pure $ t' :< annotateVar t' e
where t' = typeToCore t
-- InL e -> pure . annotateVars . Fix $ e
-- InR e -> rlpExprToCore e
annotateVar :: Core.Type -> Core.ExprF PsName a -> Core.ExprF Var a annotateVar :: Core.Type -> Core.ExprF PsName a -> Core.ExprF Var a