module DDC.Core.Fragment
(
Fragment (..)
, mapProfileOfFragment
, Profile (..)
, mapFeaturesOfProfile
, zeroProfile
, Feature (..)
, Features (..)
, zeroFeatures
, setFeature
, complies
, compliesWithEnvs
, Complies
, Error (..))
where
import DDC.Core.Fragment.Feature
import DDC.Core.Fragment.Compliance
import DDC.Core.Fragment.Error
import DDC.Core.Fragment.Profile
import DDC.Core.Module
import DDC.Core.Exp
import DDC.Core.Lexer
import DDC.Data.Token
data Fragment n (err :: * -> *)
= Fragment
{
fragmentProfile :: Profile n
, fragmentExtension :: String
, fragmentReadName :: String -> Maybe n
, fragmentLexModule :: String -> Int -> String -> [Token (Tok n)]
, fragmentLexExp :: String -> Int -> String -> [Token (Tok n)]
, fragmentCheckModule :: forall a. Module a n -> Maybe (err a)
, fragmentCheckExp :: forall a. Exp a n -> Maybe (err a) }
instance Show (Fragment n err) where
show frag
= profileName $ fragmentProfile frag
mapProfileOfFragment
:: (Profile n -> Profile n)
-> Fragment n err -> Fragment n err
mapProfileOfFragment f fragment
= fragment
{ fragmentProfile = f (fragmentProfile fragment) }