Commit 4fe10629 authored by Camil Staps's avatar Camil Staps 🚀

Merge branch 'adapt-to-platform-without-overlapping-instances' into 'master'

Adapt to platform without overlapping instances

See merge request !3
parents c19e946c b91ccf0d
Pipeline #32020 passed with stage
in 1 minute and 59 seconds
......@@ -33,7 +33,7 @@ import Clean.Doc
import Clean.Parse
import Clean.Parse.Comments
from Clean.Types import :: Type(Func,Type), :: TypeContext, :: TypeRestriction,
:: TypeVar, :: TVAssignment,
:: TypeVar, :: TVAssignment, :: TypeContext(TypeContext),
allVars
from Clean.Types.Util import instance toString Type, instance == Type,
assign, assignAll
......@@ -349,13 +349,13 @@ where
where
invariant :: Property -> String
invariant (ForAll name args impl) =
name +++ " :: " <+ Func (map noContext argtypes) (Type "Property" []) (concatMap context argtypes) <+ "\n" +++
name +++ " :: " <+ Func (map noContext argtypes) (Type "Property" []) (TypeContext (concatMap context argtypes)) <+ "\n" +++
name +++ concat [" " +++ a \\ (a,_) <- args] +++ " =\n\t" +++
replaceSubString "\n" "\n\t" impl
where
noContext (Func [] t _) = t
noContext t = t
context (Func [] _ c) = c
context (Func [] _ (TypeContext c)) = c
context _ = []
argtypes = map snd args
......@@ -437,7 +437,7 @@ where
tname = fname +++ "_" +++ name``
name`` = fixname name`
name` = if (i == 1) name (name +++ "_" +++ toString i)
type` = fromJust $ assignAll vis $ Func (map snd ts) (Type "Property" []) []
type` = fromJust $ assignAll vis $ Func (map snd ts) (Type "Property" []) (TypeContext [])
gas = map resolveGenerators ts
where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment