/* ----------------------------------------------------------------------------- Copyright 2019-2020 Kevin P. Barry Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ----------------------------------------------------------------------------- */ // Author: Kevin P. Barry [ta0kira@gmail.com] concrete Bool { refines AsBool refines AsInt refines AsFloat refines Formatted defines Equals } concrete Char { refines AsBool refines AsChar refines AsInt refines AsFloat refines Formatted defines Equals defines LessThan } concrete Float { refines AsBool refines AsInt refines AsFloat refines Formatted defines Equals defines LessThan } concrete Int { refines AsBool refines AsChar refines AsInt refines AsFloat refines Formatted defines Equals defines LessThan } concrete String { refines AsBool refines Formatted refines ReadPosition defines Equals defines LessThan @value subSequence (Int,Int) -> (String) @type builder () -> (Builder) } @value interface AsBool { asBool () -> (Bool) } @value interface AsChar { asChar () -> (Char) } @value interface AsFloat { asFloat () -> (Float) } @value interface AsInt { asInt () -> (Int) } @value interface Formatted { formatted () -> (String) } @value interface ReadPosition<|#x> { readPosition (Int) -> (#x) readSize () -> (Int) subSequence (Int,Int) -> (ReadPosition<#x>) } @value interface Builder<#x> { append (#x) -> (Builder<#x>) build () -> (#x) } @type interface Equals<#x|> { equals (#x,#x) -> (Bool) } @type interface LessThan<#x|> { lessThan (#x,#x) -> (Bool) }