Class.hs 454 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module MA.Coalgebra.Parser.Class
  ( MorphParser
  , ParseMorphism(..)
  ) where

import Data.Vector (Vector)

import Control.Monad.State.Strict (StateT, execStateT)
import MA.Coalgebra.Parser.Internal
import MA.Coalgebra.RefinementTypes
import MA.Parser.Types

type MorphParser l h1 = StateT (ParserState l h1) Parser

class ParseMorphism f where
  parseMorphismPoint :: (Ord x) => f (MorphParser l h1 x) -> MorphParser l h1 (H1 f, Vector (x, Label f))