Copyright | (c) Dan Doel and Edward Kmett 2013-2014 |
---|---|
License | BSD3 |
Maintainer | Dan Doel <dan.doel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- data PatternMatrix t c a = PatternMatrix {}
- class HasPatternMatrix t t c a | t -> t c a where
- patternMatrix :: Lens' t (PatternMatrix t c a)
- bodies :: Lens' t [Claused c a]
- cols :: Lens' t [[Pattern t]]
- defaultOn :: Applicative c => Int -> PatternMatrix t c a -> PatternMatrix t c (Var () (c a))
- splitOn :: Applicative c => Int -> PatternHead -> PatternMatrix t c a -> PatternMatrix t c (Var Word64 (c a))
- data Claused c a
- = Localized [Scope PatternPath (Scope Word64 c) a] (Guarded (Scope PatternPath (Scope Word64 c) a))
- | Raw (Guarded (Scope PatternPath c a))
- hoistClaused :: Functor c => (forall x. c x -> d x) -> Claused c a -> Claused d a
Pattern Matrix
data PatternMatrix t c a Source
Pattern matrices for compilation. The matrix is represented as a list of columns. There is also an extra column representing the guards.
Functor c => Functor (PatternMatrix t c) | |
Foldable c => Foldable (PatternMatrix t c) | |
Traversable c => Traversable (PatternMatrix t c) | |
(Eq t, Eq a, Monad c, Eq1 c) => Eq (PatternMatrix t c a) | |
(Functor c, Show t, Show a, Show1 c) => Show (PatternMatrix t c a) | |
HasPatternMatrix (PatternMatrix t c a) t c a |
class HasPatternMatrix t t c a | t -> t c a where Source
patternMatrix :: Lens' t (PatternMatrix t c a) Source
HasPatternMatrix (PatternMatrix t c a) t c a |
defaultOn :: Applicative c => Int -> PatternMatrix t c a -> PatternMatrix t c (Var () (c a)) Source
Computes the matrix that should be used recursively when defaulting on the specified column.
splitOn :: Applicative c => Int -> PatternHead -> PatternMatrix t c a -> PatternMatrix t c (Var Word64 (c a)) Source
Computes the matrix that should be used recursively when defaulting on the specified column, with the given pattern head.
Claused
Localized [Scope PatternPath (Scope Word64 c) a] (Guarded (Scope PatternPath (Scope Word64 c) a)) | |
Raw (Guarded (Scope PatternPath c a)) |
hoistClaused :: Functor c => (forall x. c x -> d x) -> Claused c a -> Claused d a Source