Commit d275f504 authored by Niels Bunkenburg's avatar Niels Bunkenburg

Add recursive search for type variables in static check

parent c84883dc
Pipeline #241 canceled with stage
-- | Check if type variables are used
module StaticAnalysis.StaticChecks.TypeVars (checkForTypVar) where
import AstChecks.Check (TypeCheck)
import AstChecks.Check (TypeCheck, mapOverTyTypesRec)
import Language.Haskell.Exts (Type (..))
import StaticAnalysis.Messages.StaticErrors (Error (..))
-- | Checks if type variables are used
checkForTypVar :: TypeCheck l (Error l)
checkForTypVar (TyFun _ x _) =
case x of
checkForTypVar t =
case t of
(TyVar _ n) -> [TypeVar n]
_ -> []
_ -> mapOverTyTypesRec False checkForTypVar [t]
checkForTypVar _ = []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment