jstolarek / slicer

Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
http://dl.acm.org/citation.cfm?id=3110258
GNU General Public License v3.0
7 stars 0 forks source link

Refactor `TyDecl` to allow only two constructors #14

Closed jstolarek closed 7 years ago

jstolarek commented 7 years ago

Current definition of TyDecl in Absyn is:

data TyDecl = TyDecl
    { name    :: TyVar
    , constrs :: [(Con, Type)]
    } deriving (Show, Eq, Ord)

But it doesn't make sense to have a list of constructors when we only allow to. This is problematic for pattern matching. We should refactor TyDecl to only allow two constructors. We'll revert to a list if we ever add support for more constructors.

jstolarek commented 7 years ago

It probably makes sense to resolve #10 first. The reason is getConstrs function used heavily by current Resugar module - not worth putting effort into reworking code that will get deleted soon.

jstolarek commented 7 years ago

Fixed on branch js-resugaring