clash-lib-1.4.7: Clash: a functional hardware description language - As a library
Safe HaskellNone
LanguageHaskell2010

Clash.Core.Termination

Synopsis

Documentation

data RecInfo Source #

Instances

Instances details
Show RecInfo Source # 
Instance details

Defined in Clash.Core.Termination

Semigroup RecInfo Source # 
Instance details

Defined in Clash.Core.Termination

Monoid RecInfo Source # 
Instance details

Defined in Clash.Core.Termination

mkRecInfo :: BindingMap -> RecInfo Source #

Given a map of top-level bindings, identify which terms are recursive and organize them into groups of mutually recursive bindings. For example, calling mkRecInfo on a BindingMap with the definitions

f [] = [] f (x:xs) = g x : h xs

g x = x + 1

h [] = [] h (x:xs) = x : f xs

i [] = [] i (x:xs) = x * 2 : i xs

would identify [f, g] and [i] as recursive groups, and g as non-recursive.

isRecursive :: Id -> RecInfo -> Bool Source #

Check if a global binder is recursive. To be conservative, binders which are not included in the RecInfo are assumed to be recursive.

recursiveGroup :: Id -> RecInfo -> Maybe VarSet Source #

Return the recursive group that a global binder belongs to. If the binder is non-recursive or not included in the RecInfo, Nothing is returned.