mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Define the terms for a language of tasks.
This commit is contained in:
parent
6554b5e40f
commit
0888749f7c
@ -7,6 +7,7 @@ module Semantic
|
||||
) where
|
||||
|
||||
import qualified Control.Concurrent.Async as Async
|
||||
import Control.Monad.Free.Freer
|
||||
import Data.Functor.Both
|
||||
import Data.Record
|
||||
import Diff
|
||||
@ -66,6 +67,14 @@ parseBlob decorator SourceBlob{..} = decorator source <$> runParser (parserForLa
|
||||
type Decorator input output = Source -> input -> output
|
||||
|
||||
|
||||
data TaskF output where
|
||||
Parse :: Parser term -> Source -> TaskF term
|
||||
Decorate :: Decorator term term' -> Source -> term -> TaskF term'
|
||||
Render :: Monoid output => Renderer input output -> input -> TaskF output
|
||||
|
||||
type Task = Freer TaskF
|
||||
|
||||
|
||||
-- Internal
|
||||
|
||||
renderConcurrently :: (Monoid output, StringConv output ByteString) => (input -> IO output) -> [input] -> IO ByteString
|
||||
|
Loading…
Reference in New Issue
Block a user