clash-lib-1.8.1: Clash: a functional hardware description language - As a library

Copyright | (C) 2021 QBayLogic B.V.
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Clash.Core.HasFreeVars

Description

Utility class to extract free variables from data which has variables.

# Documentation

class HasFreeVars a where Source #

Minimal complete definition

freeVarsOf

Methods

freeVarsOf :: a -> VarSet Source #

isClosed :: a -> Bool Source #

Something is closed if it has no free variables. This function may be replaced with a more efficient implementation.

elemFreeVars :: Var a -> a -> Bool Source #

Check if a variable is free in the given value. This function may be replaced with a more efficient implementation.

notElemFreeVars :: Var a -> a -> Bool Source #

Check if a variable is not free in the given value. This function may be replaced with a more efficient implementation.

subsetFreeVars :: VarSet -> a -> Bool Source #

Check if all variables in a set are free in the given value. This function may be replaced with a more efficient implementation.

disjointFreeVars :: VarSet -> a -> Bool Source #

Check if no variables in a set are free in the given value. This function may be replaced with a more efficient implementation.

#### Instances

Instances details

HasFreeVars Term Source # |
Instance details Defined in Clash.Core.HasFreeVars Methods freeVarsOf :: Term -> VarSet Source # isClosed :: Term -> Bool Source # elemFreeVars :: Var Term -> Term -> Bool Source # notElemFreeVars :: Var Term -> Term -> Bool Source # subsetFreeVars :: VarSet -> Term -> Bool Source # disjointFreeVars :: VarSet -> Term -> Bool Source #
HasFreeVars Type Source # |
Instance details Defined in Clash.Core.HasFreeVars Methods freeVarsOf :: Type -> VarSet Source # isClosed :: Type -> Bool Source # elemFreeVars :: Var Type -> Type -> Bool Source # notElemFreeVars :: Var Type -> Type -> Bool Source # subsetFreeVars :: VarSet -> Type -> Bool Source # disjointFreeVars :: VarSet -> Type -> Bool Source #
(Foldable f, HasFreeVars a) => HasFreeVars (f a) Source # |
Instance details Defined in Clash.Core.HasFreeVars Methods freeVarsOf :: f a -> VarSet Source # isClosed :: f a -> Bool Source # elemFreeVars :: Var (f a) -> f a -> Bool Source # notElemFreeVars :: Var (f a) -> f a -> Bool Source # subsetFreeVars :: VarSet -> f a -> Bool Source # disjointFreeVars :: VarSet -> f a -> Bool Source #