Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class CollectionPattern m t where
- type ElemM m
- type ElemT t
- nil :: Pattern () m t ()
- nilM :: m -> t -> ()
- cons :: Pattern (PP (ElemT t), PP t) m t (ElemT t, t)
- consM :: m -> t -> (ElemM m, m)
- join :: Pattern (PP t, PP t) m t (t, t)
- joinM :: m -> t -> (m, m)
- elm :: Pattern (PP (ElemT t)) m t (ElemT t)
- elmM :: m -> t -> ElemM m
- joinCons :: Pattern (PP t, PP (ElemT t), PP t) m t (t, ElemT t, t)
- joinConsM :: m -> t -> (m, ElemM m, m)
- newtype List m = List m
- newtype Multiset m = Multiset m
- newtype Set m = Set m
Documentation
class CollectionPattern m t where Source #
Class for collection pattern constructors.
nil :: Pattern () m t () Source #
Pattern that matches with empty collections.
[]
is desugared into nil
by the quasi-quoter.
cons :: Pattern (PP (ElemT t), PP t) m t (ElemT t, t) Source #
Pattern that destructs collections into its head and tail.
:
is desugared into cons
by the quasi-quoter.
consM :: m -> t -> (ElemM m, m) Source #
join :: Pattern (PP t, PP t) m t (t, t) Source #
Pattern that destructs collections into its initial prefix and remaining suffix.
++
is desugared into join
by the quasi-quoter.
joinM :: m -> t -> (m, m) Source #
joinM :: m -> t -> (m, m) Source #
elm :: Pattern (PP (ElemT t)) m t (ElemT t) Source #
elmM :: m -> t -> ElemM m Source #
joinCons :: Pattern (PP t, PP (ElemT t), PP t) m t (t, ElemT t, t) Source #
Instances
List
matcher is a matcher for collections that matches as if they're normal lists.
List m |
Instances
(Eq a, Matcher m a, ValuePattern m a) => ValuePattern (List m) [a] Source # | |
Matcher m t => CollectionPattern (List m) [t] Source # | |
Defined in Control.Egison.Matcher.Collection nil :: Pattern () (List m) [t] () Source # nilM :: List m -> [t] -> () Source # cons :: Pattern (PP (ElemT [t]), PP [t]) (List m) [t] (ElemT [t], [t]) Source # consM :: List m -> [t] -> (ElemM (List m), List m) Source # join :: Pattern (PP [t], PP [t]) (List m) [t] ([t], [t]) Source # joinM :: List m -> [t] -> (List m, List m) Source # elm :: Pattern (PP (ElemT [t])) (List m) [t] (ElemT [t]) Source # elmM :: List m -> [t] -> ElemM (List m) Source # joinCons :: Pattern (PP [t], PP (ElemT [t]), PP [t]) (List m) [t] ([t], ElemT [t], [t]) Source # joinConsM :: List m -> [t] -> (List m, ElemM (List m), List m) Source # | |
Matcher m t => Matcher (List m :: Type) ([t] :: Type) Source # | |
Defined in Control.Egison.Matcher.Collection | |
type ElemM (List m) Source # | |
Defined in Control.Egison.Matcher.Collection |
Multiset m |
Instances
Set m |
Instances
(Eq a, Matcher m a, ValuePattern m a) => ValuePattern (Set m) [a] Source # | |
Matcher m t => CollectionPattern (Set m) [t] Source # | |
Defined in Control.Egison.Matcher.Collection nil :: Pattern () (Set m) [t] () Source # nilM :: Set m -> [t] -> () Source # cons :: Pattern (PP (ElemT [t]), PP [t]) (Set m) [t] (ElemT [t], [t]) Source # consM :: Set m -> [t] -> (ElemM (Set m), Set m) Source # join :: Pattern (PP [t], PP [t]) (Set m) [t] ([t], [t]) Source # joinM :: Set m -> [t] -> (Set m, Set m) Source # elm :: Pattern (PP (ElemT [t])) (Set m) [t] (ElemT [t]) Source # elmM :: Set m -> [t] -> ElemM (Set m) Source # joinCons :: Pattern (PP [t], PP (ElemT [t]), PP [t]) (Set m) [t] ([t], ElemT [t], [t]) Source # joinConsM :: Set m -> [t] -> (Set m, ElemM (Set m), Set m) Source # | |
Matcher m t => Matcher (Set m :: Type) ([t] :: Type) Source # | |
Defined in Control.Egison.Matcher.Collection | |
type ElemM (Set m) Source # | |
Defined in Control.Egison.Matcher.Collection |