stan-0.0.1.0: Haskell STatic ANalyser
Copyright(c) 2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Stan.Pattern.Edsl

Description

Embedded DSL for patterns (AST and Type). Implemented using the Final Taggless approach.

Synopsis

Documentation

class PatternBool a where Source #

Common interface for Bool-like parts of patterns. Allows to write composable and reusable complex pattern definitions from smaller pieces.

Laws (in terms of matching functions that return Bool):

Methods

(?) :: a Source #

Anything. Matching should always return True.

neg :: a -> a Source #

Negation. Inverses the argument.

(|||) :: a -> a -> a infixr 2 Source #

Or-pattern. Choice.

(&&&) :: a -> a -> a infixr 3 Source #

And-pattern. Both.