netcore-1.0.0: The NetCore compiler and runtime system for OpenFlow networks.

Safe HaskellNone

Frenetic.Pattern

Synopsis

Documentation

class Eq a => Matchable a whereSource

A class for types that compose similar to wildcards.

All instances must satisfy the following:

  • match defines a partial order; top is the top element of this order and intersect is a meet.
  • Meets are exact: if match x y and match x z, then match x (fromJust (intersect y z)), if such a meet exists.

Minimal complete definition: top and intersect.

Methods

top :: aSource

intersect :: a -> a -> Maybe aSource

match :: a -> a -> BoolSource

overlap :: a -> a -> BoolSource

disjoint :: a -> a -> BoolSource

Instances

data Wildcard a Source

Constructors

Exact a 
Wildcard 

Instances

Functor Wildcard 
Eq a => Eq (Wildcard a) 
Ord a => Ord (Wildcard a) 
Show a => Show (Wildcard a) 
Eq a => Matchable (Wildcard a) 

data Prefix a Source

Constructors

Prefix a Int 

Instances

Eq a => Eq (Prefix a) 
Ord a => Ord (Prefix a) 
(Bits a, Show a) => Show (Prefix a) 
Bits a => Matchable (Prefix a) 

wMatch :: Eq a => a -> Wildcard a -> BoolSource