newer ghc

This commit is contained in:
crumbtoo
2024-03-24 08:05:39 -06:00
parent eca712d0d7
commit 344c631dd0
7 changed files with 26 additions and 27 deletions

View File

@@ -5,7 +5,7 @@ ALEX = alex
ALEX_OPTS = -g
SRC = src
CABAL_BUILD = $(shell ./find-build.cl)
CABAL_BUILD = $(shell ./find-build.clj)
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

@@ -62,11 +62,11 @@ library
build-tool-depends: happy:happy, alex:alex
-- other-extensions:
build-depends: base >=4.17 && <4.20
build-depends: base >=4.17 && <4.21
-- required for happy
, array >= 0.5.5 && < 0.6
, containers >= 0.6.7 && < 0.7
, template-haskell >= 2.20.0 && < 2.21
, template-haskell >= 2.20.0 && < 2.22
, prettyprinter
, data-default >= 0.7.1 && < 0.8
, data-default-class >= 0.1.2 && < 0.2
@@ -76,7 +76,6 @@ library
, text >= 2.0.2 && < 2.2
, unordered-containers >= 0.2.20 && < 0.3
, recursion-schemes >= 5.2.2 && < 5.3
, monadic-recursion-schemes
, data-fix >= 0.3.2 && < 0.4
, utf8-string >= 1.0.2 && < 1.1
, extra >= 1.7.0 && <2
@@ -89,14 +88,8 @@ library
, these >=0.2 && <2.0
, free >=5.2
, bifunctors >=5.2
, blaze-html
, blaze-markup
, clay
, jmacro
, js-jquery
, aeson
, aeson >=2.2.1.0 && <2.3.1.0
, lens-aeson
-- , servant
hs-source-dirs: src
default-language: GHC2021

View File

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

View File

@@ -37,7 +37,7 @@ import Data.Traversable
import GHC.Generics (Generic, Generically(..))
import Debug.Trace
import Data.Functor
import Data.Functor hiding (unzip)
import Data.Functor.Foldable hiding (fold)
import Data.Fix hiding (cata, para)
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)
(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 [] = pure mempty

View File

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