Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forbid kind loops #251

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
ghc: "9.2.5"
os: ubuntu-latest

- cabal: "3.2"
ghc: "8.10.7"
os: ubuntu-latest

# latest GHC, non-default OS
- cabal: "3.8"
ghc: "9.6"
Expand Down
2 changes: 2 additions & 0 deletions examples/non-examples/kind-occurs-check.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Infinite kind detected:
(KindVar 55708) = (META(KindVar 55708) → META(KindVar 55701))
17 changes: 17 additions & 0 deletions examples/non-examples/kind-occurs-check.kl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#lang "prelude.kl"

(datatype (Phantom A)
(mk-phantom))

-- causes the kind equality ?1 ~ ?2 to be unified twice, which previously
-- caused ?2 to point to itself, thus causing zonking ?2 to run forever.
-- should be accepted.
(example
(with-unknown-type [A]
(the (Phantom A)
(mk-phantom))))

-- causes the kind equality ?1 ~ (-> ?1 *).
-- should be accepted by the occurs-check.
(datatype (InfiniteKind A)
(mk-infinite-kind (Phantom (A A))))
1 change: 1 addition & 0 deletions examples/non-examples/type-occurs-check.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Infinite type detected: (MetaPtr 57868) = (List META(MetaPtr 57868))
13 changes: 13 additions & 0 deletions examples/non-examples/type-occurs-check.kl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#lang "prelude.kl"

-- accepted, thanks to let-generalization
(example
(let [xs (nil)]
(:: xs -- (the (List A) xs)
xs -- (the (List (List A)) xs)
)))

-- causes the type equality ?1 ~ List ?1, which must be rejected by the
-- occurs-check.
(defun infinite-type (xs)
(:: xs xs))
1 change: 1 addition & 0 deletions klister.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ library
PartialType
Phase
Pretty
Pretty.Renumber
Scope
ScopeSet
ShortShow
Expand Down
51 changes: 29 additions & 22 deletions src/Expander.hs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
[ ( "open-syntax"
, Scheme [] $ tFun [tSyntax] (Prims.primitiveDatatype "Syntax-Contents" [tSyntax])
, ValueClosure $ HO $
\(ValueSyntax stx) ->

Check warning on line 413 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 413 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 413 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 413 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
case syntaxE stx of
Id name ->
primitiveCtor "identifier-contents" [ValueString name]
Expand All @@ -428,9 +428,9 @@
, Scheme [] $
tFun [tSyntax, tSyntax, Prims.primitiveDatatype "Syntax-Contents" [tSyntax]] tSyntax
, ValueClosure $ HO $
\(ValueSyntax locStx) ->

Check warning on line 431 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 431 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 431 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 431 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueClosure $ HO $
\(ValueSyntax scopesStx) ->

Check warning on line 433 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 433 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 433 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 433 in src/Expander.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueClosure $ HO $
-- N.B. Assuming correct constructors
\(ValueCtor ctor [arg]) ->
Expand Down Expand Up @@ -544,15 +544,17 @@
| (name, fun) <- [("<", (<)), ("<=", (<=)), (">", (>)), (">=", (>=)), ("=", (==)), ("/=", (/=))]
] ++
[ ("pure-IO"
, Scheme [KStar, KStar] $ tFun [tSchemaVar 0 []] (tIO (tSchemaVar 0 []))
, let a = tSchemaVar firstSchemeVar []
in Scheme [KStar, KStar] $ tFun [a] (tIO a)
Comment on lines +547 to +548
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect number of kind annotations in pure-IO function definition

In the definition of pure-IO, the Scheme is given a kind list [KStar, KStar], but only one type variable a is introduced. The number of kinds in the kind list should match the number of type variables.

Apply this diff to fix the issue:

-              in Scheme [KStar, KStar] $ tFun [a] (tIO a)
+              in Scheme [KStar] $ tFun [a] (tIO a)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
, let a = tSchemaVar firstSchemeVar []
in Scheme [KStar, KStar] $ tFun [a] (tIO a)
, let a = tSchemaVar firstSchemeVar []
in Scheme [KStar] $ tFun [a] (tIO a)

, ValueClosure $ HO $ \v -> ValueIOAction (pure v)
)
, ("bind-IO"
, Scheme [KStar, KStar] $
tFun [ tIO (tSchemaVar 0 [])
, tFun [tSchemaVar 0 []] (tIO (tSchemaVar 1 []))
]
(tIO (tSchemaVar 1 []))
, let a:b:_ = [tSchemaVar i [] | i <- [firstSchemeVar..]]
in Scheme [KStar, KStar] $
tFun [ tIO a
, tFun [a] (tIO b)
]
(tIO b)
, ValueClosure $ HO $ \(ValueIOAction mx) -> do
ValueClosure $ HO $ \(ValueClosure f) -> do
ValueIOAction $ do
Expand Down Expand Up @@ -596,22 +598,25 @@
, ("Unit", [], [("unit", [])])
, ("Bool", [], [("true", []), ("false", [])])
, ("Problem", [], [("module", []), ("declaration", []), ("type", []), ("expression", [tType]), ("pattern", []), ("type-pattern", [])])
, ("Maybe", [KStar], [("nothing", []), ("just", [tSchemaVar 0 []])])
, ("List"
, [KStar]
, [ ("nil", [])
, ("::", [tSchemaVar 0 [], Prims.primitiveDatatype "List" [tSchemaVar 0 []]])
]
)
, let a = tSchemaVar firstSchemeVar []
in ("Maybe", [KStar], [("nothing", []), ("just", [a])])
, let a = tSchemaVar firstSchemeVar []
Comment on lines +602 to +603
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Potential type variable conflict due to reuse of firstSchemeVar

The type variable a is defined using tSchemaVar firstSchemeVar [] without ensuring uniqueness. Reusing firstSchemeVar may lead to conflicts if it's used elsewhere. Please ensure that each type variable is unique.

Consider using a mechanism to generate fresh type variable indices for each new type variable. For example:

-          , let a = tSchemaVar firstSchemeVar []
+          , let a = tSchemaVar nextSchemeVar []

Ensure that nextSchemeVar is incremented appropriately to prevent collisions.

Committable suggestion was skipped due to low confidence.

in ("List"
, [KStar]
, [ ("nil", [])
, ("::", [a, Prims.primitiveDatatype "List" [a]])
]
)
Comment on lines +604 to +609
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Potential type variable conflict due to reuse of firstSchemeVar

Similar to the issue above, in the definition of List, the type variable a is defined using tSchemaVar firstSchemeVar []. This may cause conflicts if firstSchemeVar is not unique. Ensure that a is uniquely identified.

Consider generating fresh type variables for each new type. For example:

-          , let a = tSchemaVar firstSchemeVar []
+          , let a = tSchemaVar nextSchemeVar []

Where nextSchemeVar is ensured to be unique.

Committable suggestion was skipped due to low confidence.

, ("Syntax-Contents"
, [KStar]
, [ ("list-contents", [Prims.primitiveDatatype "List" [tSchemaVar 0 []]])
, ("integer-contents", [tInteger])
, ("string-contents", [tString])
, ("identifier-contents", [tString])
-- if you add a constructor here, remember to also add a
-- corresponding pattern in close-syntax!
]
, let a = tSchemaVar firstSchemeVar []
in [ ("list-contents", [Prims.primitiveDatatype "List" [a]])
, ("integer-contents", [tInteger])
, ("string-contents", [tString])
, ("identifier-contents", [tString])
-- if you add a constructor here, remember to also add a
-- corresponding pattern in close-syntax!
]
Comment on lines +612 to +619
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Potential type variable conflict due to reuse of firstSchemeVar

In the definition of Syntax-Contents, the type variable a is introduced using tSchemaVar firstSchemeVar []. Reusing firstSchemeVar can lead to conflicts. Ensure that a is unique within this context.

Modify the code to use a fresh type variable:

-            , let a = tSchemaVar firstSchemeVar []
+            , let a = tSchemaVar nextSchemeVar []

Again, nextSchemeVar should be uniquely generated.

Committable suggestion was skipped due to low confidence.

)
]

Expand Down Expand Up @@ -1211,8 +1216,9 @@
case prob of
ExprDest t dest -> do
argTys <- traverse makeTypeMeta argKinds
let tyStore = S.fromList $ zip [firstSchemeVar..] argTys
unify dest t $ tDatatype dt argTys
args' <- for args \a -> inst dest (Scheme argKinds a) argTys
args' <- for args \a -> inst dest (Scheme argKinds a) tyStore
Comment on lines +1219 to +1221
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure uniqueness of type variable indices in tyStore

In constructing tyStore by zipping [firstSchemeVar..] with argTys, there is a risk of reusing type variable indices, which can lead to conflicts. Ensure that the range of indices starting from firstSchemeVar does not overlap with other uses.

Consider maintaining a separate type variable index or using a function to generate fresh type variables to guarantee uniqueness.

Stx _ _ (foundName, foundArgs) <- mustBeCons stx
_ <- mustBeIdent foundName
argDests <-
Expand All @@ -1225,8 +1231,9 @@
PatternDest patTy dest -> do
Stx _ loc (_cname, subPats) <- mustBeCons stx
tyArgs <- traverse makeTypeMeta argKinds
let tyStore = S.fromList $ zip [firstSchemeVar..] tyArgs
argTypes <- for args \ a ->
inst loc (Scheme argKinds a) tyArgs
inst loc (Scheme argKinds a) tyStore
Comment on lines +1234 to +1236
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure uniqueness of type variable indices when instantiating types

When instantiating argument types with inst, ensure that the tyStore mapping uses unique type variable indices. Reusing firstSchemeVar without managing uniqueness can cause type variable clashes.

Adjust the tyStore to use unique indices:

-                  let tyStore = S.fromList $ zip [firstSchemeVar..] tyArgs
+                  let tyStore = S.fromList $ zip [nextSchemeVar..] tyArgs

Where nextSchemeVar is managed to ensure it provides fresh indices.

Committable suggestion was skipped due to low confidence.

unify loc (tDatatype dt tyArgs) patTy
if length subPats /= length argTypes
then throwError $ WrongArgCount stx ctor (length argTypes) (length subPats)
Expand Down
28 changes: 20 additions & 8 deletions src/Expander/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Expander.Error
( ExpansionErr(..)
, SyntacticCategory(..)
, TypeCheckError(..)
, KindCheckError(..)
, Tenon, tenon, Mortise, mortise
, notRightLength
) where
Expand Down Expand Up @@ -63,10 +64,10 @@ data ExpansionErr
(Mortise SyntacticCategory)
| NotValidType Syntax
| TypeCheckError TypeCheckError
| KindCheckError KindCheckError
| WrongArgCount Syntax Constructor Int Int
| NotAConstructor Syntax
| WrongTypeArity Syntax TypeConstructor Natural Int
| KindMismatch (Maybe SrcLoc) Kind Kind
| CircularImports ModuleName [ModuleName]
deriving (Show)

Expand Down Expand Up @@ -97,6 +98,10 @@ data TypeCheckError
| OccursCheckFailed MetaPtr Ty
deriving (Show)

data KindCheckError
= KindMismatch (Maybe SrcLoc) Kind Kind
| KindOccursCheckFailed KindVar Kind
deriving (Show)

data SyntacticCategory
= ModuleCat
Expand Down Expand Up @@ -216,6 +221,7 @@ instance Pretty VarInfo ExpansionErr where
pp env (NotValidType stx) =
hang 2 $ group $ vsep [text "Not a type:", pp env stx]
pp env (TypeCheckError err) = pp env err
pp env (KindCheckError err) = pp env err
pp env (WrongArgCount stx ctor wanted got) =
hang 2 $
vsep [ text "Wrong number of arguments for constructor" <+> pp env ctor
Expand All @@ -231,11 +237,6 @@ instance Pretty VarInfo ExpansionErr where
, text "Got" <+> viaShow got
, text "In" <+> align (pp env stx)
]
pp env (KindMismatch loc k1 k2) =
hang 2 $ group $ vsep [ text "Kind mismatch at" <+>
maybe (text "unknown location") (pp env) loc <> text "."
, group $ vsep [pp env k1, text "≠", pp env k2]
]
pp env (CircularImports current stack) =
hang 2 $ vsep [ group $ vsep [ text "Circular imports while importing", pp env current]
, group $ hang 2 $ vsep (text "Context:" : map (pp env) stack)]
Expand Down Expand Up @@ -265,10 +266,21 @@ instance Pretty VarInfo TypeCheckError where
]

pp env (OccursCheckFailed ptr ty) =
hang 2 $ group $ vsep [ text "Occurs check failed:"
, group (vsep [viaShow ptr, "", pp env ty])
hang 2 $ group $ vsep [ text "Infinite type detected:"
, group (vsep [viaShow ptr, "=", pp env ty])
]

instance Pretty VarInfo KindCheckError where
pp env (KindMismatch loc k1 k2) =
hang 2 $ group $ vsep [ text "Kind mismatch at" <+>
maybe (text "unknown location") (pp env) loc <> text "."
, group $ vsep [pp env k1, text "≠", pp env k2]
]

pp env (KindOccursCheckFailed v k) =
hang 2 $ group $ vsep [ text "Infinite kind detected:"
, group (vsep [viaShow v, "=", pp env k])
]

instance Pretty VarInfo SyntacticCategory where
pp _env ExpressionCat = text "an expression"
Expand Down
2 changes: 1 addition & 1 deletion src/Expander/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ data EValue
| EPrimPatternMacro (Either (Ty, PatternPtr) TypePatternPtr -> Syntax -> Expand ())
| EPrimUniversalMacro (MacroDest -> Syntax -> Expand ())
| EVarMacro !Var -- ^ For bound variables (the Unique is the binding site of the var)
| ETypeVar !Kind !Natural
| ETypeVar !Kind !SchemeVar
-- ^ For bound type variables (user-written Skolem variables or in datatype definitions)
| EUserMacro !MacroVar -- ^ For user-written macros
| EIncompleteMacro !MacroVar !Ident !SplitCorePtr -- ^ Macros that are themselves not yet ready to go
Expand Down
5 changes: 2 additions & 3 deletions src/Expander/Primitives.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import Data.Text (Text)
import qualified Data.Text as T
import Data.Traversable
import Numeric.Natural

import Binding
import Core
Expand Down Expand Up @@ -130,7 +129,7 @@
Stx scs loc (_ :: Syntax, more) <- mustBeCons stx
Stx _ _ (nameAndArgs, ctorSpecs) <- mustBeCons (Syntax (Stx scs loc (List more)))
Stx _ _ (name, args) <- mustBeCons nameAndArgs
typeArgs <- for (zip [0..] args) $ \(i, a) ->
typeArgs <- for (zip [firstSchemeVar..] args) $ \(i, a) ->
prepareTypeVar i a
sc <- freshScope $ T.pack $ "For datatype at " ++ shortShow (stxLoc stx)
let typeScopes = map (view _1) typeArgs ++ [sc]
Expand Down Expand Up @@ -712,7 +711,7 @@
forkExpanderTask $ AwaitingTypePattern dest exprTy rhsDest rhsStx
return (dest, rhsDest)

prepareTypeVar :: Natural -> Syntax -> Expand (Scope, Ident, Kind)
prepareTypeVar :: SchemeVar -> Syntax -> Expand (Scope, Ident, Kind)
prepareTypeVar i varStx = do
(sc, α, b) <- varPrepHelper varStx
k <- KMetaVar <$> liftIO newKindVar
Expand Down Expand Up @@ -748,23 +747,23 @@
unaryIntegerPrim :: (Integer -> Integer) -> Value
unaryIntegerPrim f =
ValueClosure $ HO $
\(ValueInteger i) ->

Check warning on line 750 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 750 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 750 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 750 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueInteger (f i)

binaryIntegerPrim :: (Integer -> Integer -> Integer) -> Value
binaryIntegerPrim f =
ValueClosure $ HO $
\(ValueInteger i1) ->

Check warning on line 756 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 756 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 756 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 756 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueClosure $ HO $
\(ValueInteger i2) ->

Check warning on line 758 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 758 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 758 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 758 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueInteger (f i1 i2)

binaryIntegerPred :: (Integer -> Integer -> Bool) -> Value
binaryIntegerPred f =
ValueClosure $ HO $
\(ValueInteger i1) ->

Check warning on line 764 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 764 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 764 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 764 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueClosure $ HO $
\(ValueInteger i2) ->

Check warning on line 766 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 766 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 766 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 766 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
if f i1 i2
then primitiveCtor "true" []
else primitiveCtor "false" []
Expand All @@ -773,9 +772,9 @@
binaryStringPred :: (Text -> Text -> Bool) -> Value
binaryStringPred f =
ValueClosure $ HO $
\(ValueString str1) ->

Check warning on line 775 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 775 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 775 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 775 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
ValueClosure $ HO $
\(ValueString str2) ->

Check warning on line 777 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.5

Pattern match(es) are non-exhaustive

Check warning on line 777 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4

Pattern match(es) are non-exhaustive

Check warning on line 777 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6

Pattern match(es) are non-exhaustive

Check warning on line 777 in src/Expander/Primitives.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive
if f str1 str2
then primitiveCtor "true" []
else primitiveCtor "false" []
1 change: 1 addition & 0 deletions src/Expander/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

-- | Utilities for analyzing the form of syntax in the expander monad
module Expander.Syntax where
Expand Down
Loading
Loading