0 | module Protocol.IDE.Holes
7 | record HolePremise where
8 | constructor MkHolePremise
14 | SExpable HolePremise where
16 | SExpList [ StringAtom premise.name
17 | , StringAtom premise.type
22 | FromSExpable HolePremise where
23 | fromSExp (SExpList [ StringAtom name
26 | ]) = do pure $
MkHolePremise
28 | fromSExp _ = Nothing
31 | record HoleData where
32 | constructor MkHoleData
35 | context : List HolePremise
38 | SExpable HoleData where
39 | toSExp hole = SExpList
40 | [ StringAtom (show hole.name)
41 | , toSExp hole.context
42 | , SExpList [ toSExp hole.type
47 | FromSExpable HoleData where
51 | , SExpList [ conclusion
53 | ]) = do pure $
MkHoleData {name, type = !(fromSExp conclusion), context = !(fromSExp context)}
54 | fromSExp _ = Nothing