pub enum Pattern<A> {
Wildcard(A),
As(A, Box<Pattern<A>>, Name),
Tuple(A, Vec<Pattern<A>>),
Constructor(A, FQName, Vec<Pattern<A>>),
EmptyList(A),
HeadTail(A, Box<Pattern<A>>, Box<Pattern<A>>),
Literal(A, Literal),
Unit(A),
}Expand description
Pattern for pattern matching.
These are morphir-elm’s eight patterns and no more: a variable binding is an As over a
wildcard, so there is no VariablePattern to read or write.
Variants§
Wildcard(A)
As(A, Box<Pattern<A>>, Name)
Tuple(A, Vec<Pattern<A>>)
Constructor(A, FQName, Vec<Pattern<A>>)
EmptyList(A)
HeadTail(A, Box<Pattern<A>>, Box<Pattern<A>>)
Literal(A, Literal)
Unit(A)
Trait Implementations§
Source§impl<'de, A: Deserialize<'de>> Deserialize<'de> for Pattern<A>
impl<'de, A: Deserialize<'de>> Deserialize<'de> for Pattern<A>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<A: PartialEq> StructuralPartialEq for Pattern<A>
Auto Trait Implementations§
impl<A> Freeze for Pattern<A>
impl<A> RefUnwindSafe for Pattern<A>
impl<A> Send for Pattern<A>
impl<A> Sync for Pattern<A>
impl<A> Unpin for Pattern<A>
impl<A> UnsafeUnpin for Pattern<A>
impl<A> UnwindSafe for Pattern<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more