newer ghc
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
13
find-build.clj
Executable 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)))
|
||||||
|
|
||||||
13
rlp.cabal
13
rlp.cabal
@@ -62,11 +62,11 @@ library
|
|||||||
build-tool-depends: happy:happy, alex:alex
|
build-tool-depends: happy:happy, alex:alex
|
||||||
|
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
build-depends: base >=4.17 && <4.20
|
build-depends: base >=4.17 && <4.21
|
||||||
-- required for happy
|
-- required for happy
|
||||||
, array >= 0.5.5 && < 0.6
|
, array >= 0.5.5 && < 0.6
|
||||||
, containers >= 0.6.7 && < 0.7
|
, containers >= 0.6.7 && < 0.7
|
||||||
, template-haskell >= 2.20.0 && < 2.21
|
, template-haskell >= 2.20.0 && < 2.22
|
||||||
, prettyprinter
|
, prettyprinter
|
||||||
, data-default >= 0.7.1 && < 0.8
|
, data-default >= 0.7.1 && < 0.8
|
||||||
, data-default-class >= 0.1.2 && < 0.2
|
, data-default-class >= 0.1.2 && < 0.2
|
||||||
@@ -76,7 +76,6 @@ library
|
|||||||
, text >= 2.0.2 && < 2.2
|
, text >= 2.0.2 && < 2.2
|
||||||
, 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
|
||||||
@@ -89,14 +88,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user