#39 Domain cannot be derived from Union.

None
open
None
5
2014-05-16
2014-05-12
No

When I try to derive a domain from Union as follows:

Bug() : with
    stringify : % -> String
  == Union(Integer, Float, List(%)) add
    ...

... compiler gets confused. However this works well:

)abbrev domain BUG Bug
Bug() : with
    stringify : % -> String
  == add
    Rep := Union(Integer, Float, List(%)) 

I could use the latter but I'd like the domain to behave as an union with extra methods attached - i.e. I'd expect default construction / coercion rules for unions to be applied to this domain.

1 Attachments

Discussion

  • Bill Page

    Bill Page - 2014-05-12

    Yes! I would like to click +1 for this bug, and similar use of other builtin domains.

     
  • Krystian Bacławski

    I only spotted those two, are there any others? Could you provide a list?

     
  • Krystian Bacławski

    Ok. While we'd like to keep Mapping a first class citizen, I'm having some doubts about it.

    Functions are usually a stateless "objects" unless you grabbed a closure. What'd be the semantics of delivering a domain from Mapping? What are your expectations?

     
    Last edit: Krystian Bacławski 2014-05-16

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks