verismith-1.1.0: Random verilog generation and simulator testing.
Copyright(c) 2020 Yann Herklotz
LicenseGPL-3
Maintaineryann [at] yannherklotz [dot] com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Verismith.Verilog.Distance

Description

Define the distance function for the abstract syntax tree, so that different Verilog files can be compared. This allows us to define a metric on how different two pieces of Verilog are. Currently, differences in expressions are ignored, as these are not that interesting.

Documentation

data Pair a b Source #

Constructors

Pair a b 

Instances

Instances details
(Show a, Show b) => Show (Pair a b) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Methods

showsPrec :: Int -> Pair a b -> ShowS #

show :: Pair a b -> String #

showList :: [Pair a b] -> ShowS #

Eq b => Eq (Pair a b) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Methods

(==) :: Pair a b -> Pair a b -> Bool #

(/=) :: Pair a b -> Pair a b -> Bool #

Ord b => Ord (Pair a b) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Methods

compare :: Pair a b -> Pair a b -> Ordering #

(<) :: Pair a b -> Pair a b -> Bool #

(<=) :: Pair a b -> Pair a b -> Bool #

(>) :: Pair a b -> Pair a b -> Bool #

(>=) :: Pair a b -> Pair a b -> Bool #

max :: Pair a b -> Pair a b -> Pair a b #

min :: Pair a b -> Pair a b -> Pair a b #

eqDistance :: Eq a => a -> a -> Int Source #

emptyDistance :: a -> a -> Int Source #

class Distance a where Source #

Minimal complete definition

distance

Methods

distance :: a -> a -> Int Source #

udistance :: a -> a -> Int Source #

dempty :: a -> Int Source #

Instances

Instances details
Distance Text Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance ConstExpr Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Identifier Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Parameter Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Port Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance PortDir Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance PortType Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Range Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Integer Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Bool Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance Char Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance (ModDecl a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance (ModItem a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance (SourceInfo a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance (Statement a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance (Verilog a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Distance a => Distance (Maybe a) Source # 
Instance details

Defined in Verismith.Verilog.Distance

Methods

distance :: Maybe a -> Maybe a -> Int Source #

udistance :: Maybe a -> Maybe a -> Int Source #

dempty :: Maybe a -> Int Source #

Distance a => Distance [a] Source # 
Instance details

Defined in Verismith.Verilog.Distance

Methods

distance :: [a] -> [a] -> Int Source #

udistance :: [a] -> [a] -> Int Source #

dempty :: [a] -> Int Source #

minimumloc :: Distance a => a -> [a] -> Pair Int Int Source #

removeAt :: Int -> [a] -> [a] Source #

remdist :: Distance a => [a] -> [a] -> Int Source #