sweet-egison-0.1.1.3: Shallow embedding implementation of non-linear pattern matching

Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Control.Egison.Matcher

Description

This module defines a class for matchers and some basic matchers.

Synopsis

Documentation

type Pattern ps im it ot = ps -> im -> it -> [ot] Source #

Type synonym for patterns.

class Matcher m tgt Source #

Class for matchers. Matcher m tgt denotes that m is a matcher for tgt.

Instances
Matcher Something (a :: k) Source # 
Instance details

Defined in Control.Egison.Matcher

Eq a => Matcher Eql (a :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher

Matcher m t => Matcher (Set m :: Type) ([t] :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

Matcher m t => Matcher (Multiset m :: Type) ([t] :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

Matcher m t => Matcher (List m :: Type) ([t] :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

(Matcher m1 t1, Matcher m2 t2) => Matcher (Pair m1 m2 :: Type) ((t1, t2) :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher.Pair

data Something Source #

Matcher that handles pattern variables and wildcards for arbitrary types.

Constructors

Something 
Instances
Matcher Something (a :: k) Source # 
Instance details

Defined in Control.Egison.Matcher

class Eq t => ValuePattern m t where Source #

Minimal complete definition

Nothing

Methods

value :: t -> Pattern () m t () Source #

value :: Eq t => t -> Pattern () m t () Source #

valueM :: m -> t -> () Source #

valueM :: m -> t -> () Source #

Instances
Eq a => ValuePattern Eql a Source # 
Instance details

Defined in Control.Egison.Matcher

Methods

value :: a -> Pattern () Eql a () Source #

valueM :: Eql -> a -> () Source #

(Eq a, Matcher m a, ValuePattern m a) => ValuePattern (Set m) [a] Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

Methods

value :: [a] -> Pattern () (Set m) [a] () Source #

valueM :: Set m -> [a] -> () Source #

(Eq a, Matcher m a, ValuePattern m a) => ValuePattern (Multiset m) [a] Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

Methods

value :: [a] -> Pattern () (Multiset m) [a] () Source #

valueM :: Multiset m -> [a] -> () Source #

(Eq a, Matcher m a, ValuePattern m a) => ValuePattern (List m) [a] Source # 
Instance details

Defined in Control.Egison.Matcher.Collection

Methods

value :: [a] -> Pattern () (List m) [a] () Source #

valueM :: List m -> [a] -> () Source #

(Eq a1, Matcher m1 a1, ValuePattern m1 a1, Eq a2, Matcher m2 a2, ValuePattern m2 a2) => ValuePattern (Pair m1 m2) (a1, a2) Source # 
Instance details

Defined in Control.Egison.Matcher.Pair

Methods

value :: (a1, a2) -> Pattern () (Pair m1 m2) (a1, a2) () Source #

valueM :: Pair m1 m2 -> (a1, a2) -> () Source #

data Eql Source #

Matcher that can handle value patterns of Eq types.

Constructors

Eql 
Instances
Eq a => ValuePattern Eql a Source # 
Instance details

Defined in Control.Egison.Matcher

Methods

value :: a -> Pattern () Eql a () Source #

valueM :: Eql -> a -> () Source #

Eq a => Matcher Eql (a :: Type) Source # 
Instance details

Defined in Control.Egison.Matcher