stan-0.1.2.1: 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 #

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 #

Anything. Matching should always return True.

neg :: a -> a #

Negation. Inverses the argument.

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

Or-pattern. Choice.

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

And-pattern. Both.