-- GeNeRaTeD fOr: ../../CBS-beta/Funcons-beta/Values/Composite/Strings/Strings.cbs
{-# LANGUAGE OverloadedStrings #-}

module Funcons.Core.Values.Composite.Strings.Strings where

import Funcons.EDSL

import Funcons.Operations hiding (Values,libFromList)
entities :: [a]
entities = []

types :: TypeRelation
types = [(Name, DataTypeMembers)] -> TypeRelation
typeEnvFromList
    []

funcons :: FunconLibrary
funcons = [(Name, EvalFunction)] -> FunconLibrary
libFromList
    [(Name
"strings",NullaryFuncon -> EvalFunction
NullaryFuncon NullaryFuncon
stepStrings),(Name
"string",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepString),(Name
"string-append",StrictFuncon -> EvalFunction
StrictFuncon StrictFuncon
stepString_append)]

strings_ :: Funcons
strings_ = Name -> Funcons
FName Name
"strings"
stepStrings :: NullaryFuncon
stepStrings = [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"lists" [Name -> FTerm
TName Name
"characters"]) Env
forall k a. Map k a
env

string_ :: [Funcons] -> Funcons
string_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"string" ([Funcons]
fargs)
stepString :: StrictFuncon
stepString [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"C*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"characters") SeqSortOp
StarOp)] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"list" [MetaVar -> FTerm
TVar MetaVar
"C*"]) Env
env

string_append_ :: [Funcons] -> Funcons
string_append_ [Funcons]
fargs = Name -> [Funcons] -> Funcons
FApp Name
"string-append" ([Funcons]
fargs)
stepString_append :: StrictFuncon
stepString_append [Values]
fargs =
    [NullaryFuncon] -> [MSOS StepRes] -> NullaryFuncon
evalRules [NullaryFuncon
rewrite1] []
    where rewrite1 :: NullaryFuncon
rewrite1 = do
            let env :: Map k a
env = Map k a
forall k a. Map k a
emptyEnv
            Env
env <- [Values] -> [VPattern] -> Env -> Rewrite Env
vsMatch [Values]
fargs [VPattern -> FTerm -> VPattern
VPAnnotated (MetaVar -> SeqSortOp -> VPattern
VPSeqVar MetaVar
"S*" SeqSortOp
StarOp) (FTerm -> SeqSortOp -> FTerm
TSortSeq (Name -> FTerm
TName Name
"strings") SeqSortOp
StarOp)] Env
forall k a. Map k a
env
            FTerm -> Env -> NullaryFuncon
rewriteTermTo (Name -> [FTerm] -> FTerm
TApp Name
"list-append" [MetaVar -> FTerm
TVar MetaVar
"S*"]) Env
env